Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I'm using Qlik Sense Desktop February 2020 Patch 9, attached you can find the test app used with some data.
I'm having troubles sorting the legend of a stacked bar chart. The data is something like this
YearQuarter | Risk_ID | Functional_Area | Priority | Priority_long_name |
2019Q4 | RSK-023 | N | Buona | 3 - Buona |
2019Q4 | RSK-024 | N | Buona | 3 - Buona |
2019Q4 | RSK-030 | O | Lieve | 1 - Lieve |
2019Q4 | RSK-030 | O | Discreta | 2 - Discreta |
2019Q4 | RSK-030 | O | Ottima | 4 - Ottima |
2019Q4 | RSK-020 | P | Lieve | 1 - Lieve |
2019Q4 | RSK-002 | P | Discreta | 2 - Discreta |
I want a stacked bar chart with Funcional_Area and Priority, with the value being Count(Risk_ID). I need the Priority values to be ordered according to the number in Priority_long_name (i.e. by left(Priority_long_name,1)) , this works great in a table but doesn't quite work for the legend of the stacked bar chart, see below
As you can see above, even though the Priority values are correctly sorted for every record (I highlighted A which has all 4 values), the legend is not sorted correctly.
To me, this doesn't make sense and I don't know how to fix it. Making Priority dual doesn't seem to fix it. Is this a bug or am I missing something? Why does the legend in the Bar Chart works in such a weird (to me) manner?
You can do some test to find out that sorting of legend is based on the sequence of the field that appears on the chart.
Ottima is always above Buona because there is no Buona in Function area "F".
I would suggest that you could use other extension such as "Bar & area chart" in Qlik Visualization bundle.
Or you could also change the data source to calculate RiskID number for all possible Function_Area and Priority. Then you will get all 4 Priorities for each Function_Area.
Thanks for your answer, but I thought that having all 4 Priority values on a single Functional_Area would suffice. The Functional_Area value A has all 4 values, do I need to have all 4 of them for every Functional_Area value?