Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Employee
Employee

Re: How to skip zero values

From what i can gather the following documentation snippet is at play here..   a sum() on a field that has true nulls will 'not normally be affected by NULLs' and 'dont use the record with the NULL in the calculation'.  That *i think* means you are going to get a 0.

Capture2.PNG

So if i load data that has an explicit NULL (see below for a manufactured NULL in the load script)

Capture.PNG

The sum() shows 0 for the null record, but as a dimension it shows null() and the nullcount() function picks it up.

Capture2.PNG

hic

Not applicable

Re: How to skip zero values

So it seems like the only way to suppress these manufactured 0 values in a table is to use a set expression? This is poor work around because it makes using a master expression not possible. The expression will need to reference the dimensions in the object.


To me the way null is being handled/displayed in an aggregation function is incorrect. The Sum of a null is not 0. Do you agree or am I missing something?


thanks for the help

Employee
Employee

Re: How to skip zero values

The other way is use a calculated dimension that checks for Nulls in the measure expression. If its is a null , then assign null() and turn off the checkbox 'show nulls' for that same dimension.

So in the previous example the first row can be supressed by changing F1 to be the following expression:

if( aggr(nullcount(Amount)>0,F1),null(),F1)


and turning off the 'show nulls' checkbox.


As for the right / wrongness in how sum() works on NULLs that is worth posing as a followup to this blog entry. ( i also tagged HIC in the previous post in case he can comment directly).


NULL handling in QlikView


Capture.PNG

Capture2.PNG

Not applicable

Re: How to skip zero values

Thanks again Jonathan,

I guess it is bugging me so much because QlikView suppresses the zeros created by default. Where in Sense there is no option to easily do this. The results of sum(null()) are the same in both products, IMO QlikView handles this more gracefully. Suppress zeros is an option in the bar chart. I guess it just didn't make the cut for the table objects.

3-13-2015 10-50-52 AM.png

The work-arounds do work but also introduce a whole bunch of complexity and challenges as well. In the case you show above, a dimension would need to be created for each instance of a measure. The combination of these things can total in the hundreds making things very confusing.

Employee
Employee

Re: How to skip zero values

I don't disagree with you.  the suppress zeros option on the presentation tab of a chart object in QV is there for all charts and summarized tabular displays are INCLUDED in that... straight tables / pivot tables.

In Sense, charts DO have a supress zero option in the addons section  (as patrick mentioned below) but this does not exist in a table object, even if the table object is very similar to a straight table in QV, does aggregations etc... zero suppression should be in there.

I don't think this is the first community post i've seen on this . i'll pass it around internally.

adambrian
New Contributor III

Re: How to skip zero values

Hi micheal tarallo,

from your file qvf, can i hide customer 3? i want all customer but not customer 3?

katsafone
Contributor

Re: How to skip zero values

Hi Patrik,

Perfect, you solved my issue.

Thank you,

Ozzie

Highlighted
rajeshqvd
Contributor II

Re: How to skip zero values

Go to >> Add-ons>>Uncheck Include Zero Values