# New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

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.

6 Replies
Employee

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

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

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

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

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

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

sportsdata:

CrossTable (sports, followers,1)

[

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)

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