Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I am tying to make a chart that shows the top 5 most populous colleges in a certain state (Minnesota). I have a variable called [States], a variable called [College Name], and a variable called [College Population]. What script can I use to do this?
Thanks,
HI,
Try to create one calculated dimension as below
Dim1: [States]
Dime2: =if(Aggr(rank(sum( [College Population]),4),[States],[College Name])<=5,[College Name])
* check suppress null values.
Expression:
Sum([College Population])
Hope this helps,
Sasi
Hi,
Please, have a look at this post:
https://community.qlik.com/t5/New-to-Qlik-Sense/To-show-top-5-values/td-p/1114961
This should answer your question.
Sorry, this is not what I am looking for - I am looking for the top 5 values only, not just to have the rest of the values hidden behind a scroll wheel. I am doing this because my requirements are to have these 5 values fit into a stacked bar chart - when using your method I have over 100 items in a single stacked bar.
Thanks,
HI,
Try to create one calculated dimension as below
Dim1: [States]
Dime2: =if(Aggr(rank(sum( [College Population]),4),[States],[College Name])<=5,[College Name])
* check suppress null values.
Expression:
Sum([College Population])
Hope this helps,
Sasi
Thank you - you wouldn't happen to have a method to get a stacked 100% bar chart would you? I Tried to use Sum([College Population])/Sum(TOTAL <[States]> [College Population]) but it doesn't seem to work
HI,
Your requirement is to display top 5 colleges for every state based on population measure.
my previous response would work for the above scenario,
select stacked option in bar chart properties
output would be like below chart,
do let me know if it is not what you are looking for
Thank,
Sasi