2 Replies Latest reply: Mar 20, 2013 8:11 AM by Selvakumar S RSS

    Calculating YTD and MTD in Load Script

      Hi All,

       

      Is thee any way to calculate the YTD in Load Script?

       

      I have calculate the daily slaes like below,

      FinalSales:

       

      Load

       

      DATE(SALESDATE,'DD/MM/YYYY')AS SALESDATE,

      sum(STORE_SALES_AMT_CY) as DailySales

      resident Fact_Sales group by SALESDATE;

       

      Now i want to calculate the YTD and MTD for the same

       

      Load

       

      DATE(SALESDATE,'DD/MM/YYYY')AS SALESDATE,

      sum(STORE_SALES_AMT_CY) as YTD

      resident Fact_Sales where min date in that year to Max date in that year group by SALESDATE;

       

      Kindly help,

       

      Thanks,

      Selva