Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi there,
Probebly a very simple question:
I would like to make calculations in the loading script, but I stumble on fields without values.
Please take a look at the calculation in the script of the attached file.
When there is no value in one of the fields the result of the calculation is empty, which imo is wrong.
How should I make this calculation?
Or is there an easy way to autogenarate '0' when there is no value in a field?
Thanks,
Dennis.
Hi, Dennis,
I would suggest this expression:
If(Not IsNull(Start),Start,0) + If(Not IsNull(Mutatie),Mutatie,0) as Calculation
Hi, Dennis,
I would suggest this expression:
If(Not IsNull(Start),Start,0) + If(Not IsNull(Mutatie),Mutatie,0) as Calculation
Hello Dennis,
You can go to the chart properties, Presentation tab, and set "0" as the Null Symbol instead of the "-" sign. However I don't think this is the best solution. Instead, checking that both fields in the script are not empty and, if they are, assign them a 0, would be harder to code but will return better results:
If(Len(Start) = 0, 0, Start) + If(Len(Mutatie) = 0, 0, Mutatie) AS Calculation
In this case, you have to do this (or use the NullDisplay variable if your ODBC returns nulls) because the "+" operator returns null when one of the values is null. But the Sum() functions returns zero even when some values are null.
Hope that helps.
BI Consultant
Thanks, that works perfect!
Thanks, that works also