Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Set analysis

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

1 Solution

Accepted Solutions
hic
Former Employee
Former Employee

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

View solution in original post

7 Replies
MK_QSL
MVP
MVP

Can you provide a sample file?

Not applicable
Author

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.

santharubban
Creator III
Creator III

Can you provide a sample file?

hic
Former Employee
Former Employee

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

Not applicable
Author

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.

hic
Former Employee
Former Employee

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

Not applicable
Author

Thank you!