Using Qlik Sense Desktop we would like to create a Staked bar chart using the following fields:
Aim: The final Staked chart should display stacks (“Product Type”) of each bar in sorted order based on the “Sales” figure.
The default chart with Sort property set to “Auto” looks like as given below:
Now in order to apply sorting we have turned on the “Custom” sorting features for “Product Type” dimension and selected “Sort by expression” and entered the same expression “sum(QTY_Delivery)” that we have used in measure (i.e. Sales). The chart looks as below
On closely looking at the chart, we have found that chart is not sorted properly. There are some bars (e.g. bar at 46 Week) has wrong order (you can see the first two stacks from the bottom - blue color stack is longer than the green one)
Other than that we have tried another expression “sum(total<Week> QTY_Delivery)” to group the sum by “Week” but it sorts chart differently and the chart looks as below:
Please suggest how we can sort it properly?
See this discussion: Bar Chart 2 Dimentions sorting. The same approach should work in Qlik Sense too.
Sorry the link suggested does not resolve our issue We have downloaded the .qvw file and did not found any sheet in it to test, so we have created a test Sheet and attached a .qvf file here. Please feel free to modify it and we would appreciate if someone could help us in sorting the chart in this app.
Sorry the link suggested does not resolve our issue We have downloaded the .qvw file and did not found any sheet in it to test
If you convert a qvw file to a Qlik Sense app then only the data model is converted.
I've modified the qvf file you provide. See attached example.
Thanks for your help. The suggested expression helps in sorting the chart but now if we use that expression, we have below issues in the chart:
5. The same color repeats twice e.g. for yearmonth “2008-03”, “2008-10”
I have attached the modified qvf with more data. Please see "My new sheet (2)" for the issue.