Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello everyone!
I am looking to make a bar chart showing different levels of individual income- 1 bar that would sum up to 100%, and show how many percent are people under £15k, between 15 and 60, and over 60k. Currently using income as a dimension and counting the number of people with relative income. Not sure how to structure the expression (s) or use set analysis in this case?
Thank you,
Anna
It sounds as if you for the dimension should define income brackets, either in the script or as calculated dimension:
If(Income<15000,'<15k',
If(Income<60000,'15k-60k','>60k')) as IncomeBracket
The percentages can then be calculated using
Count(PersonID) / Count(total PersonID)
HIC
Can you provide a sample file?
I am fairly new to Qlikview but one idea is to create the field in your data model. Depending on how you want the data structured you may have to create a resident table that keeps your "Customer" identifier and then sums up the total value before then assigning a field that Categorizes the Income
It would very easy for you then to produce a graph that counts the frequency of each group
or
create X number fields in you data model One called <£15k, £15, £60 and then create a counter of 1 or 0 that can be simply summed up.
Can you provide a sample file?
It sounds as if you for the dimension should define income brackets, either in the script or as calculated dimension:
If(Income<15000,'<15k',
If(Income<60000,'15k-60k','>60k')) as IncomeBracket
The percentages can then be calculated using
Count(PersonID) / Count(total PersonID)
HIC
That worked, thank you! Question, at the moment it shows as 3 separate bars and the option to stack them up is 'shaded out' so I can't select it, any ideas how to overcome that? I want one big bar showing me different percentages.
That means that you should use the Income bracket as 2nd dimension. If you add another field as first dimension (or just a dummy dimension, e.g. a calculated dimension =1) it will work.
You may need to change your expression to
Count(PersonID) / Count(total <IncomeBracket> PersonID)
HIC
Thank you!