Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Show measure only for specific value of dimension in Qlik Sense chart

Hi I am trying to create a chart that has age distribution on X axis as dimension and population measures from census data in 10 yearly groups (0-9 year olds, 10-19 year olds etc.)

My dimension (AGE_DIS) has integer numbers (0,1,2,3...116), so I rounded it to 10 to correspond to my measure: =ROUND(AGE_DIS,10).

Currently my expression, Census population for 0-9 year olds shows for all age groups (0,10,20...) and it should only show for when the dimension is 0, otherwise it should be 0.

I have tried to use the following IF statement in the measure, but it does not seem to work:

if (round(AGE_DIS,10={"0"},sum([2013_Census_0-9_Years]),0)

Could you please, help me find a solution?

1 Solution

Accepted Solutions
sunny_talwar

How about this:

Sum({<AGE_DIS = {'>=0<0.5'}>} [2013_Census_0-9_Years])

View solution in original post

4 Replies
swuehl
MVP
MVP

What about

if (round(AGE_DIS,10)=0, sum([2013_Census_0-9_Years]),0)

swuehl
MVP
MVP

It might also be a good idea to create a new field in the script:

LOAD AGE_DIS,

          Round(AGE_DIS,10) as AGE_DIS_BUCKET,

          ....

Then create your chart with dimension AGE_DIS_BUCKET and as expression:

sum({<AGE_DIS_BUCKET = {0}>} [2013_Census_0-9_Years])

sunny_talwar

How about this:

Sum({<AGE_DIS = {'>=0<0.5'}>} [2013_Census_0-9_Years])

Not applicable
Author

Thank you so much for your answer, Sunny, it worked very well.