Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello everyone,
I have a problem.
I have a field with normal values and null values. When perform a group by in the script with sum(field), the result returns 0 even if the values are null. I even tried placing a 'N' when null, but i get the same result sum(field)=0 for these values. I want the sum of null values to be a null value as well.
Basically I have this:
for values=null or 'N', sum(field)=0
I need this:
for values=null or 'N', sum(field)=Null or 'N' and not 0
Thank you,
Bogdan
Well, Sum(field) is 0 if field is NULL... So QlikView does the right thing.
If your Group By in the script looks like the following:
Load
Dimension,
Sum(Number) as NumberSum
From ... Group By Dimension ;
Then you might get NumberSum=0 for some values of "Dimension". If you want to omit these records, you should simply add a Where clause, e.g.:
Load
Dimension,
Sum(Number) as NumberSum
From ... Where IsNum(Number)
Group By Dimension ;
HIC
you cannot unfortunately, because sum gives always 0 even with null values.
Well, Sum(field) is 0 if field is NULL... So QlikView does the right thing.
If your Group By in the script looks like the following:
Load
Dimension,
Sum(Number) as NumberSum
From ... Group By Dimension ;
Then you might get NumberSum=0 for some values of "Dimension". If you want to omit these records, you should simply add a Where clause, e.g.:
Load
Dimension,
Sum(Number) as NumberSum
From ... Where IsNum(Number)
Group By Dimension ;
HIC