How to get same numerator value on dividing by zero in Webdatarocks table

117 Views Asked by At

I want to get same numerator value when Denominator is zero in Webdatrocks table. In documentation they have mentioned function "divideByZeroValue", but it can hold only static value.

https://www.webdatarocks.com/doc/number-formatting/

Please assist is there any way to do so.

1

There are 1 best solutions below

0
On

I suppose "divideByZeroValue" does not work for your case. It just allows setting an appropriate alias for the division by zero representation.

It seems that writing an if() formula should solve your case. For example, if you write the following formula if( count("Color") == 0, sum("Price") , sum("Price")/count("Color")) you will avoid division by zero cases.