Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
DrCPB
Contributor
Contributor

Sum the values of two periods in current period

Dear Community,

so far it was, unfortunately, not possible for me to find a solution from all your brilliant support here! Which shall not mean that it is not yet there, probably I was unable to find and/or apply what I have found.

I have multiple locations, from which I get monthly data to calculate KPIs. For one KPI I need to implement the following formula logic:

Screenshot 2023-02-02 093033.jpg

For Year_Date the auto calendar function is available, however, there is also year and month seperately as integer available. 

 

Looking forward to your support on this topic!

 

Regards,

 

DrCPB

Labels (2)
3 Replies
ogster1974
Partner - Master II
Partner - Master II

In your script load your data in the order you want the data to be processed. Looks like Location and Year_Date desc then

Load

*,

[Inventory Operative]/ (Previous([Material Costs])*[Material Costs])*(Previous([Working Days])*[Working Days]) as DoH

;

 

DrCPB
Contributor
Contributor
Author

Dear ogster1974,

thx for your feedback. Is there an option to get it realised in the analysis and not in the loading script. If I take the average of the DoH later on e.g. plant or regional level, there will be an mathematical error. Sorry, this requirement I forgot to state in my initial post.

thx for your support!

Regards DrCPB

ogster1974
Partner - Master II
Partner - Master II

something like.

Avg(Aggr(Sum([Inventory Operative]/ (Above([Material Costs])*[Material Costs])*(Above([Working Days])*[Working Days])),Location, Year_Date))