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

set expression: average of latest N day of week

Hello everyone, 

I am stuck with a requirement in my project. 

I need to create a measure that returns the average of the latest N weeks for each day of week. For example if the user sets N=25, so the table must show the sales forecast by calculating  the average of the latest 25 Mondays, Tuesdays, ... 

The output is something similar as the following table:

Jimmyguel_0-1589909523569.png

The Forecast measure needs to identify the day of week of the date (The Week Of day helps with that) in the row and sum the latest N days of week (from previous weeks) and divided by N. 

I am having issues trying to sum the previous N weeks because the set analysis only evaluates once instead of evaluates by row.

Do you have any ideas?

 

Thank you!

 

 

 

Labels (2)
0 Replies