Im trying to produce an if and only if statement where if only does the calculation if the denominator is not zero.
Where did I go wrong?
Calc: iif(
[listpriceorig]<>0,
[listprice]/
[listpriceorig]*100,0])
Im trying to produce an if and only if statement where if only does the calculation if the denominator is not zero.
Where did I go wrong?
Calc: iif(
[listpriceorig]<>0,
[listprice]/
[listpriceorig]*100,0])
Try:
Calc: IIF(Nz([listpriceorig],0)<>0,[listprice]/[listpriceorig]*100,0])
Hello cmf0106,
You have to make sure that both the numerator and denominator are not Zero and also are not null.
There are two function you can use to check for Null Values. That is NZ() aka Not Zero and IsNull() for if a value is null will return true.
The function will check for a null value and then you can set it to whatever value you wish.
Example: NZ(VariableNameHere, Numerical Value to set to when NULL)
Example: IsNull(VariableNameHere)
Usage like IIF(NZ(ListPrice,0) > 0 AND NZ(Listpriceorig,0) > 0,[listprice]/[listpriceorig]*100],0)