Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

'Correct' monthly aggregation of weekly amounts

Hi,

I´ve weekly amounts (e.g. Week 40: 15) and I want to aggregate these on a daily basis to a correct montly value. How can I achieve this in a elegant manner?

weeklyAmounts.PNG.png

Thanks for yout ideas in advance...

Thorsten

1 Solution

Accepted Solutions
Not applicable
Author

I´ve found a solution by assigning 1/5 of the weekly amounts to each weekday (mo-fr)

starting by get the weekstart-date for the given week/year, I generate the necessary dates in a for...next loop...

weeklyAmounts-2.PNG.png

here are the associated scriptcode

weeklyAmounts-1.PNG.png

View solution in original post

2 Replies
Not applicable
Author

Hi Thorsten

the best way is to store your data at day level.

Then when you sum at weeks or months it will give you the right aggregated result because each day will be calculated in regard of according week and month

Best regards

chris

Not applicable
Author

I´ve found a solution by assigning 1/5 of the weekly amounts to each weekday (mo-fr)

starting by get the weekstart-date for the given week/year, I generate the necessary dates in a for...next loop...

weeklyAmounts-2.PNG.png

here are the associated scriptcode

weeklyAmounts-1.PNG.png