Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

abhishek_verma
New Contributor

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
Employee
Employee

Re: Sort Stacked Bar Chart (2 dimensions 1 measure)

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

dx_anupam
Contributor

Re: Sort Stacked Bar Chart (2 dimensions 1 measure)

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

abhishek_verma
New Contributor

Re: Sort Stacked Bar Chart (2 dimensions 1 measure)

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

abhishek_verma
New Contributor

Re: Sort Stacked Bar Chart (2 dimensions 1 measure)

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

Partner
Partner

Re: Sort Stacked Bar Chart (2 dimensions 1 measure)

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
Honored Contributor

Re: Sort Stacked Bar Chart (2 dimensions 1 measure)

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

Refer this:

Sorting inner segments of Stacked Bar