4 Replies Latest reply: Mar 28, 2016 7:50 AM by Hatim Taj RSS

    Sorting of Stacked Bar Chart does not work properly in Qlik sense desktop

    Hatim Taj

      Using Qlik Sense Desktop we would like to create a Staked bar chart using the following fields:



      1. Week (Week of the Year)
      2. Product Type


      Measure: Sales


      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?