Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Dynamic Week calculation - YTD

Hi,

I try to reaise a dynamic investments dashboard on a weekly basis.

I picked up the formulas from Jason's "YTD calculations using set analysis" and it works well for the current week calculation as I replaced Month by Week.

sum({$<Year = {$(=max(Year))}, Week = {"<=$(=max({<Year={$(=max(Year))}>} Week))>$(=max({<Year={$(=max(Year))}>} Week)-1)"}>} Field)

But for "Previous Week" calculation, a function "addmonths" is used and apparently there is not the same for Week purpose.

sum({$<Year = {$(=max(Year) - $(=if(max(Month) = 1, 1, 0)))}, Month = {$(=month(addmonths(max(MonthYear), -1)))}>} Field)

Does anyone have a trick to get through ?

Regards,

Julien

0 Replies