Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Sort Stacked Bar Chart (2 dimensions 1 measure)

I know there might be many similar queries posted here, but still giving in as layman language as possible.

There are 2 dimensions - Country and Sports, and 1 measure - Followers

I need to create a stacked bar-chart with Country in X axis and Sports as stacked.

This should be sorted in descending order.

Pic below (table is simply added so that one can replicate this exact data). I need only chart in sorted order.

qlik.JPG

6 Replies
Lisa_P
Employee
Employee

In the sort tab you can put in an expression to sort by

dx_anupam
Creator
Creator

Hi Abhishek,

Sorting will not work straight away. please go through the below link @marcowedel explained exact way to achieve it.

Sort Stacked Chart by Y and 2nd Dimension

Regards,

Anupam

Anonymous
Not applicable
Author

Thanks Anupam, but the screenshot you shared looks like from qlikview and not qliksense.

Also, I don't want to sort the stacks inside every bar.

I simply want to sort the bars in descending order based on total value from left to right

Anonymous
Not applicable
Author

Thanks Lisa, but looking for the expression.
It'd be great if you can help me with that..

nsetty
Partner - Creator II
Partner - Creator II

sportsdata:

CrossTable (sports, followers,1)

load * inline

[

country, cricket, football, hockey

india, 3000000, 2000000, 900000

australia, 2000000, 1500000, 400000

south africa, 1500000, 1000000, 250000

];

stacked combo chart

1 dimension

country

3 Measures

Sum({1<sports={'cricket'}>}followers)

Sum({1<sports={'football'}>}followers)

Sum({1<sports={'hockey'}>}followers)

country, sports, followers.PNG

balabhaskarqlik

May be modify one of your dimension with Dual(), then it'll sort.

Refer this:

Sorting inner segments of Stacked Bar