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

Announcements
Discover how organizations are unlocking new revenue streams: Watch here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Sorting multi dimensional Bar Chart

HI,


Please take a look at the attached sample application. What I want to accomplish is to chart the top 10 zip codes based on the expression value sum(population) for year 2012. So, I tried the following sort expression in the Sort tab as you can see in the app:

=rank(aggr(sum({$<year={2012}>}population),year))


But it's not working. Can someone point me to the right direction.

3 Replies
amit_saini
Master III
Master III

Dennis,

Try something like this for top 10:

=aggr(if(rank(sum(Data))<=10, User),User)

Thanks,
AS

Not applicable
Author

Hi amit,

Thanks for the reply. But, I am not sure if I follow your suggestion. Are you saying in my case to use this expression in the Sort tab:

=aggr(if(rank(sum(population<=10,year),year)

My chart displays the expression four times for each zip code in the x-axis (one for each year). I need to sort the x-axis (zip codes) based on the last year (2012) expression values.


amit_saini
Master III
Master III

Dennis ,

You have to use this concept as Calculated dimension and than expression.

Thanks,

AS