1 Reply Latest reply: Jan 5, 2012 8:22 PM by Karl Pover RSS

    QTD and QTD Previous Year Calcs

      Can anyone tell me why these expressions aren't working?

       

      QTD:

      sum(if([Date] = QuarterStart(Today())

      AND year(Date) = year(Today())

      ,Value))

       

      Same Quarter Previous Year:

      sum(if(DayNumberOfYear([Date]) <= DayNumberOfYear(Today())

      AND [Date] = QuarterStart(Today())

      AND year(Date) = year(Today())-1

      ,Value))

       

      And if anyone has an idea of what will work, I am all ears.

      I've been working on this forever it seems and can't figure it out. I need QTD values and same quarter last year values but can't seem to get it to work.

       

      Thanks
      Jared

        • QTD and QTD Previous Year Calcs
          Karl Pover

          Jared,

           

          Try

           

          sum(if(Date>=QuarterStart(Today()) and Date<=QuarterEnd(Today()), Value))

           

          Since QuarterStart() and QuarterEnd() return a full date with year, you don't have to compare year.

           

          The same quarter previous year would be:

           

          sum(if(Date>=QuarterStart(Today(),-4) and Date<=QuarterEnd(Today(),-4), Value))

           

          Karl