Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
See here. Once you've calculated the YTD and MTD flags you can also calculate the sums in the script if you want.
Hi Gysbert,
But i don't want to use set analysis. I have to calculate in Load it self and store it in CSV directly.
Thanks,
Selva