6 Replies Latest reply: Apr 13, 2016 8:07 AM by Sangram Reddy RSS

    Last 4 Quarters

    Kumar Pramod

      Hi all,

       

      I am displaying a values in a line graph for last 4 Quarters, Using the Below Dimension and Measures

       

      Dimension : if(Last4Quarters = 1, Month(QuarterEnd(CanonicalDate)) & '-' & year(QuarterEnd(CanonicalDate)))

      Measure : Count({$<DateType = {invitation}, client_id ={'12','13','15','18','19'}>}invitation_id)

       

      Load Script:

      let varRyear   = Num(AddYears(today(),-1));

      let varLast4Quarters = num(QuarterEnd(Addmonths(today(),-3)));

      let varStartDate  = num(AddYears($(varLast4Quarters),-1));

                

      CalendarMaster:

      Load *,   

           if (([CanonicalDate] > $(varStartDate)),if(([CanonicalDate] < $(varLast4Quarters)),1)) as [Last4Quarters];

       

       

      As we are in 4th month it should display mar-2016 in graph but it is not.

      quarter.png

       

      Please help where i am doing wrong.

       

      Regards,

      Pramod