Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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?
How about this:
Sum({<AGE_DIS = {'>=0<0.5'}>} [2013_Census_0-9_Years])
What about
if (round(AGE_DIS,10)=0, sum([2013_Census_0-9_Years]),0)
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])
How about this:
Sum({<AGE_DIS = {'>=0<0.5'}>} [2013_Census_0-9_Years])
Thank you so much for your answer, Sunny, it worked very well.