19 Replies Latest reply: Apr 15, 2015 9:24 AM by Enikö Karlecz RSS

    How to get the values of the earliest/latest month relative to the quarter?

      Hi. I'm new to QlikView and needing help. My concern is that I can't get the correct values when there are no current selections.

       

      I used the expression:

       

      =Sum({$<QUARTER=P({1<MONTH={$(vMinMonth)}>}QUARTER)>}OPEN_BAL)

       

      where:

      vMinMonth =min(num(MONTH))

       

      There's probably a syntax missing in the expressions used. Or is there a more practical way to do this?  I attached a sample file for your reference. Thanks in advance.

       

      EDIT: Used these expressions:

       

      =sum(Aggr(If(Min(TOTAL<QUARTER> MONTH) = MONTH, sum(OPEN_BAL)),COMPANY, QUARTER, MONTH))

      =sum(Aggr(If(Max(TOTAL<QUARTER> MONTH) = MONTH, sum(CLOSE_BAL)),COMPANY, QUARTER, MONTH))