Skip to main content
Announcements
Introducing a new Enhanced File Management feature in Qlik Cloud! GET THE DETAILS!
cancel
Showing results for 
Search instead for 
Did you mean: 
cramkumar86
Contributor III
Contributor III

MTD, YTD, LTD calculations with ODAG

Hi,

Due to the high data volume, I am currently using ODAG approach to create on-demand reports. I have a DATE filter on my selection app. Selecting a date would mean that only the data corresponding to the selected date would load/appear on the on-demand report. As I am calculating MTD, LTD and YTD values within Qlik, loading only the dates selected on the selection app is causing issues with the above mentioned calculations. Due to this, I am ignoring the DATE filter so that I load data for all the dates and the calculations would work just as expected. However, I am afraid that it might cause performance issues in the long run.

Here is the formula I use for MTD in Qlik master item.

Sum({<Year=, Month=, Quarter=, Week=, DateField=, report_date={">=$(=Num(MonthStart(Max(report_date))))<=$(=Max(report_date))"}>} transactional_amt)

To sort this out, instead of calculating this as a part of master item, I am trying to calculate this from the data load script itself. I tried the below formula. But it does not seem to be considering the selections I make on the DATE filter. It always populates the SUM of data for all dates. 

Sum({<Year=, Month=, Quarter=, Week=, DateField=, report_date={">=$(=Num(MonthStart(report_date)))<=$(=report_date)"}>} transactional_amt)

Is there an option to pre-calculate YTD, MTD and LTD in Qlik without having to load data for all the dates on the on-demand app?

 

Labels (4)
1 Reply
vikasmahajan

Hi,

Please find demo here Flags are created for this requirement & you can use this a template in ODAG

https://community.qlik.com/t5/Member-Articles/As-of-Table-with-YTD-MTD-QTD-amp-Calculation-of-Rollin...

 

Hope this resolve your issue.
If the issue is solved please mark the answer with Accept as Solution & like it.
If you want to go quickly, go alone. If you want to go far, go together.