Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
ckiesling
Contributor II
Contributor II

Age Histogram

I need to make an age histogram. Typically the bins should be equal which would be something like:

0-9, 10-19, 20-29, 30-39, 40-49, 50-59, 60-69, 70+

However I need to include 17 an an end mark. Individuals who are looking at this graph will need to be able to visualize those under 17 years of age. This cause the bins to be uneven and it seems weird to have bins of 7 or 8 when visualizing age. 

What is the best practice here?

Labels (1)
1 Reply
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

I think simplest is to use a calculated dimension (or create a field in the script) like:

if(Age >= 70, '70+'
,if(Age >= 60, '60-69'
,if(Age >= 50, '50-59'
,etc
if(Age >= 17, '17-19'
,'Under 17'
)))

-Rob