Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

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
MVP
MVP

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

How about this:

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

4 Replies
MVP
MVP

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

What about

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

MVP
MVP

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

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])

MVP
MVP

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

How about this:

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

Not applicable

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

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