Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
manoranjan_d
Specialist
Specialist

Stacked bar chart

Hi all,

I m using stacked bar chart, in that no dimension and i m using only expression, now i want to sort the value from low to high

how can i do that in sort tad?

pls help me

10 Replies
Gysbert_Wassenaar

You can't afaik. To sort a bar chart you need at leas one dimension to have values that can be sorted.


talk is cheap, supply exceeds demand
Not applicable

Hi,

Create a inline table int the sort order and use that.

Gysbert_Wassenaar

There are no dimension values to sort in the chart because there is no dimension. There are only expressions.


talk is cheap, supply exceeds demand
gautik92
Specialist III
Specialist III

you cannot sort it without a dimension

nagarjuna_kotha
Partner - Specialist II
Partner - Specialist II

Its Impossible

vincent_ardiet
Specialist
Specialist

Hi Manoranjan,

I have found a solution but the bar chart will be horizontal:

- Create a Mekko chart

- Create a dimension with =Valueloop(1,X) where X=number of expressions you are using

- In the expression, use only one:

    =pick(ValueLoop(1,X)

       ,<expression1>

       ,<expression2>

       ,...

       ,<expressionX> )

- Sort by Y-value

- Go also in the background color settings of the expression in order to make the color change regarding the expression (you can reuse the pick or create a formula mixing RGB() and ValueLoop()).

I have tested with the Funnel, it's well orienteted but in a triangle.

Regards,

Vincent

manoranjan_d
Specialist
Specialist
Author

hi all,

when it came impossible means then i ll use dimension .

now i m using the one dimension and 3 expression, when i go to sort and give sort the value is not sorted and i m usin the stacked bar, please let me know how to sort the value in stacked bar chart

manoranjan_d
Specialist
Specialist
Author

hi all can u pls reply me

vincent_ardiet
Specialist
Specialist

We already answered, it's not possible to sort expressions. If you create 3 expressions, the resulting numbers will always be displayed in the same order than your expressions.

The only solution is to have a dimension (ok you did it), but a single expression.

Then you will face another difficulty,  to create a stacked bar chart with a single expression, you will need... 2 dimensions. The first one will be the x axis, the second one the dimension used to organize your stack.

Ok fine, you can create a fake dimension with a single value as a first dimension.

But, yet another joke. You can only sort the first dimension of the Y value.

Maybe it's possible to use an expression to sort on the second dimension but with the valueloop I haven't managed to do this.

With the mekko and the funnel you can have something close to want your looking for.

But finally, you can maybe compare in your expressions, all of them (if you have only 3) like =if (expr1> expr2, if(expr1> expr3, expr1, expr3), if (expr2> expr3, expr2, expr3)), if. Or use many combinations of youf expressions and use the conditional field to activate them in the proper order.