6 Replies Latest reply: Jun 24, 2016 8:49 AM by Jon Maginess RSS

    min of max calculation

    Jon Maginess

       

      If I have the dimension of customer, and the two measures of Sales value and Date.

       


      How in a table grouped at Customer level can I show the minimum date WHERE the sales value is the maximum, ie the same sales value could repeat across dates and I want the earliest that the max has occured.

       

       

       

      I have tried to manipulate an AGGR function but to no avail

       

       

       

      Is there a way of doing this without changing the load script

       

       

       

      For example if i have the raw data below

       

       

       

      Customer

      Sales

      Date

      A

      50

      10/12/2015

      A

      100

      09/12/2015

      A

      100

      08/12/2015

      B

      75

      10/12/2015

      B

      100

      09/12/2015

      B

      150

      08/12/2015

       

       

       

      I want this table chart in my Qlikview app so for customer A, the max sales is 100, which occurs on two days and in this case i want the earlies date.

       

       

       

      Customer

      MAX(Sales)

      Min(Date)

      A

      100

      08/12/2015

      B

      150

      08/12/2015