Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

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

2 Replies
Gysbert_Wassenaar

See here. Once you've calculated the YTD and MTD flags you can also calculate the sums in the script if you want.


talk is cheap, supply exceeds demand
Not applicable
Author

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