Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Not applicable

Dynamic Week calculation - YTD


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 ?