3 Replies Latest reply: Jul 11, 2017 3:36 AM by Роман Хаитов RSS

    csum + order by + contribution

    Роман Хаитов

      Good afternoon!

      I need your help!

      Please please) I'm new to Qlik Sense.

      I need to get the contribution, and then the total amount. But before that, sort the measure (with the contribution) in descending order. All this I want to do for three measures in one dimension.

       

      For example:

       

      [OPS_SALES]:

      LOAD * Inline [

          Category, Opsum1, Opsum2, Opsum3

          'A', 150, 300, 58

          'B', 100, 250, 30

          'C', 200, 208, 88

          'D', 153, 400, 65

      ];

       

      column 1 (first measure):

      Sum(Opsum1)

       

      column 2 (contribution):

      Sum(Opsum1) / Sum(Total Opsum1)

       

      column 3 (rank for order by):

      Rank(Sum(Opsum1)/Sum(total Opsum1))

       

      column 4 (Cumulative with order by) uncorrectly:

      RangeSum(above((

      Sum(Opsum1)/Sum(total Opsum1)

      ), 0, Rank(Sum(Opsum1)/Sum(total Opsum1)) ))

       

      For last column i want get to example from excel screenshot.

       

      I can not use the sorting of dimension in the measure, since I want to get a cumulative sum of three measures(opsum1, opsum2, opsum3)

       

      Thank you!