2 Replies Latest reply: Oct 16, 2015 10:27 AM by Joanna Seldon RSS

    Difference bar (By week) - Qlik sense

    Joanna Seldon



      I have a bar chart


      this shows Customer_ID totals for each week. 05/01/2015, 12/01/2015  column labelled =  Week_Beginning


      I need an expression that will show the difference between the two weeks




      count({$< Department = {"Catering"},  Week_Beginning - Date(Week)  >}Customer_ID)




      05/01/2015 total was 30

      12/01/2015 total was 35  ...so customer difference bar will show the total difference of 5




      please help

        • Re: Difference bar (By week) - Qlik sense
          bruno bertels

          Hi Joanna


          I've faced the same problem few days ago


          I was needed to calculate the difference between sales from a week with the week before. It's seems that it is what you are looking for.


          below the way you may test It :


          count({$< Department = {"Catering"}>}Customer_ID)


          rangesum(above(count({$< Department = {"Catering"}>}Customer_ID)),1,1))



          For my need I was able with this kind of formula to have this :


          bar chart :


          take Week Or Week_Beginning as dimension and the formula above as mesure.


          here the same as a table :



          hope this will help you





            • Re: Difference bar (By week) - Qlik sense
              Joanna Seldon



              this works great thank you however, the subtraction is showing on the wrong week bar week beginning date, its showing the correct figure, but on the week before


              Dimension Week_Beginning


              e.g difference of 5 is showing on 05/10/2015, where it should be showing on 12/10/2015


              if you can help, please do but not to worry as chart looks ok


              Kind Regards