8 Replies Latest reply: Mar 10, 2017 10:27 AM by Roberto Moreno RSS

    YTD in Qlik Sense

    Amir Jaber

      I am trying to get the YTD sum of Debit - Credit. This is based on [TRX Date].

       

      I have tried the following but it's only returning 0.

       

      sum(

           {$<

           [TRX Date]= {"<=$(=max(total([TRX Date])))>=$(=YearStart(date( max( total [TRX Date]),'DD/MM/YYYY'),0))"},

           >}

           (Debit-Credit)

           )

       

      As a side note, I tried to modify the code from the answers to the following threads but neither one worked

      Current YTD vs Previous year YTD | Qlik Community

      YTD,QTD,MTD,WTD IN Qlik Sense

      YTQ, QTD, MTD and WTD

       

      Thanks!

       

      Edit: I forgot to mention that the YTD should be based on the maximum selected [TRX Date] in the filter (and not based on Today())

       

      Message was edited by: Amir Jaber