2 Replies Latest reply: Aug 25, 2013 5:36 PM by Francesco Ravagnolo RSS

    Current and Previous YEAR MTD, QTD and YTD

      Dear all,

       

      I'm trying to set on my Master Calendar some key flags...However, if the CYTDFlag and LYTDFlag works correctl, the month and quarter indicators are not working correctly.

      In fact ONLY the current month (July 2013) is selected based on the date set by the $(varTD) which is 31/07/2013.

      What I want is to have the Full Q3 selected. for the month, the issue is on the LMTDFlag.

       

      START ---------------------

      InMonth (TempDate, $(varTD),0)*-1 as CMTDFlag, // Current MONTH (select from 1st date of varTD month to last date eg. 01/07/2013 to 31/07/2013)

                     InMonth (TempDate, $(varTD),-1)*-1 as LMTDFlag, // Same MONTH LATS YEAR (eg. 01/07/2012 to 31/07/2012)

                     InQuarter (TempDate, $(varTD),0)*-1 as CQTDFlag, // Current QUARTER (select from 1st date of varTD quarter to last date eg. 01/07/2013 to 31/09/2013)

                     InQuarter (TempDate, $(varTD),-1)*-1 as LQTDFlag, // Same Quarter from Last Year (eg. 01/07/2012 to 31/09/2012)

                     InYearToDate (TempDate, $(varTD),0)*-1 as CYTDFlag, // Year to Date (select form 1st date of varTD  to last date eg. 01/01/2013 to 31/09/2013)

                     InYearToDate (TempDate, $(varTD),-1)*-1 as LYTDFlag// Same Year to Date BTU last year (eg. 01/01/2012 to 31/09/2012)