Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

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

Tags (2)
2 Replies
Gysbert_Wassenaar
Not applicable

Re: Calculating YTD and MTD in Load Script

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

Re: Calculating YTD and MTD in Load Script

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