Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Qlik Community
I have an unexpected issue with sorting a stacked by chart.
I want to sort my chart by the "bottom" category as seen below. However, it only sorts correctly when I select exactly 1 value in my year filter. Then it looks like the first image, sorted as expected. But if I select 2 or more or none, in the year filter, the sort will not behave like I expect. See the 2nd image.
My measure is as follows:
My sort is as follows:
Any help is appreciated
You need to have the same set expression in your measure and in your sort expression. Otherwise the sort expression will use other values than the ones you base your chart on.
I understand. But the crux of the issue is that I would like to sort on just the "size" of one of the categories like in the first image. My measure is a percentage distribution of the 2 measures combined.
It is difficult for me to see what happens since I don't have the data, but...
it looks as if the first 9 bars are correctly sorted, and the only one wrong is the last one. Probably since the sort expression for this bar evaluates to NULL. Could it be that the last bar is excluded by the set expression in the sort? E.g. if there are no 'cat2' here?
Bottom line is in any case that you need to decide how to sort the bars that are excluded by the set expression in the sort. (My guess: [dep_name] that have 'cat1' but not 'cat2').