4 Replies Latest reply: Feb 14, 2014 1:59 AM by Soumya Gowda RSS

    YTD based on selections

      Dear all,


      I want to be able to compare last years figures and this years figures based on current selections.  Meaning that if I select 2013 and February, I will compare January + February this year against January and February last Year. I have made the following expression for this year, but have not been able to make an expression for last year.


      =Sum({< År={$(=Max(År))},Kvartal=,Måned=,DatoNum={'>=$(=YearStart(Max(DatoNum)))<=$(=Max(DatoNum))'}>} FaktBeløp)






      I have a mastercalendar including YTDifjor (YTDlastyear) and YTD:

      (Year(TempDate)=Year(Today()) and TempDate<= $(varToday), 1) as YTD,

      if(Year(TempDate)=Year(Today())-1 and TempDate<= AddYears($(varToday), -1), 1) as YTDifjor,


      I want to calculate the last years figures based on the selections. If I select 2013 and February, I want to calculate last years figures for January and February.


      What is the expression for last year?