Discussion Board for collaboration on QlikView Scripting.
My script has this syntax:
COST_GAS, COST_DEPR, COST_MAIN, COST_HWY, COST_ADMIN, COST_SALARY,
(COST_GAS + COST_DEPR + COST_MAIN + COST_HWY + COST_ADMIN + COST_SALARY) As [TOTAL_COST]
In qlikview pivot chart, i have an expression- SUM(TOTAL_COST)
The result of it is wrong!
If I create expression summing all costs like this- SUM(COST_GAS) + SUM(COST_DEPR) + ..... and so on.
The result is correct.
Why is the script adding won't work.
Go to Solution.
Your fields may contain null values.
Try using Alt(COST_GAS, 0) + Alt(COST_DEPR, 0) + etc... as TOTAL_COST.
Yes, using arithmetic operator + with NULL operands will result in NULL. Use rangesum(FIELD1,FIELD2,...) instead if you want to handle NULL as zero.