3 Replies Latest reply: Oct 18, 2015 7:46 AM by Martin Majer RSS

    Stacked bar chart not working properly - all parts are equal

      Hello everybody,

       

      I am new to Qlik Sense and set analysis and I came across a problem I can't solve. I created two variables for sales in fiscal year 2014 and fiscal year 2015 which are calculated using set analysis from three tables:

       

      varFY14 = sum({<[PY.Year]={14},Category={LICENSING},Type*={AO,RN}>}[PY.Price]) + sum({<[Bg.Year]={14},Category={LICENSING},Type*={AO,RN}>}[Bg.Price])

      varFY15 = sum({<[Year]={15},Category={LICENSING},Type*={AO,RN}>}[Price]) + sum({<[PY.Year]={15},Category={LICENSING},Type*={AO,RN}>}[PY.Price]) + sum({<[Bg.Year]={15},Category={LICENSING},Type*={AO,RN}>}[Bg.Price])

       

      I got the correct results for variables but I can’t get the stacked bar chart to work. I use valuelist as dimension and the stacked dimension should be Type (AO or RN).

       

      first_dimension = valuelist('FY14','FY15')

      second_dimension = Type

      measure = if(valuelist('FY14','FY15') = 'FY15',varFY15,if(valuelist('FY14','FY15') = 'FY14',varFY14))

       

      First dimension works as expected but the "stacked Type dimension" does not. Both AO and RN parts shows same value (same percentage) and takes up equal space in the bar which doubles its height. I have also created a pivot table to see the values and when nothing is selected in filter pane, both AO and RN show same value which is equal to the full value of varFY14 and varFY15. When I click on the AO or RN part in the stacked bar chart, values in pivot table are recalculated to the correct value. Same goes for selecting AO or RN in filter pane - bar chart shows bar with correct height and pivot table shows the right value.

       

      I am not sure if I am explaining this clearly so I made few screenshots (unfortunately I can not share the data file).

       

       

      1) No filters are selected, both AO and RN are equal to varFY14/15 which is incorrect

       

      all_chart.pngall_pivot_table.png

      2) RN selected by clicking on green part of the chart, pivot table shows correct value for RN, hover on chart still shows 56k for RN

      RN_chart.pngRN_pivot_table.png

      3) AO selected by clicking on red part of the chart, pivot table shows correct value for AO, hover on chart still shows 56k for AO

      AO_chart.pngAO_pivot_table.png

      4) AO selected in filter pane, both bar chart and pivot table show correct value for AO and bar has correct height

      AO_selected.png

      How can I fix this and make Qlik Sense show the correct ratio and values in stacked bar char and pivot table? Or is this some native set analysis behaviour?

       

      Thank you for your help,

       

      Martin