Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Hide dimension when expression is zero

Hi all,

I have a chart with multiple dimensions (Name and Phone number).

I have one expression, called "Year Sales". The expression shows the sales of that year (a bit more complex than sum(Sales), but that does not matter).

I want to hide all names without any sales, basically all names with Year Sales = 0. In my example below, the row of customer C should be gone.

Guess I could do this with a dimension "supress when value is null", but I do not know how to re-write the calculated dimension for "Name" so that every line with "Year sales = 0" would become "Null()".

Sales.JPG

If possible to solve it a different way, that is also fine with me.

Thanks in advance!

1 Solution

Accepted Solutions
Not applicable
Author

Found my own solution!

I used a calculated aggr.dimension. I changed my first dimension "Name" into:

=aggr(if(sum({$<Year=,Month=,Week=, YTD=>} Sales)<>0, Name), Name)

And I then used the "Suppress When Value Is Null"-option in the dimension tab.

It worked

View solution in original post

27 Replies
avinashelite

Did you check the suppress zero values in the presentation tab of chart properties ??

dineshraj
Partner - Creator
Partner - Creator

Hi Wiebke,

Try this in text color expression

If(sum(Sales)=0,White())

Thanks and Regards

Not applicable
Author

Yes, "suppress zero-values" of that expression is checked off.  (there is a "V" in the box).

miguelbraga
Partner - Specialist III
Partner - Specialist III

Try this in te script, lad:

If([Year Sales] = 0, null(), [Year Sales]) as [Year Sales]

Best regards,

D.A. MB

avinashelite

will be able to share the sample data ??

miguelbraga
Partner - Specialist III
Partner - Specialist III

Check this out:

MB

effinty2112
Master
Master

Hi Wiebke,

                    If the field your summing to get Year Sales is called Sales then try:

Sum({$<Sales = {">0"}>Sales}

good luck

Andrew

trdandamudi
Master II
Master II

Please see the attached for the solution:

HideValueRowIsZero.jpg

Not applicable
Author

The dimension is not called YearSales.

The expression to get the YearSales is a lot more complex. I named it Year Sales, but the expression is:

sum({$<Year=,Month=,Week=, YTD=>} Sales)

I cannot just copy your example, because then I would lose all the other information I've got there (being the "=" signs).