Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
mparker123
Creator
Creator

Calculate the last 4 weeks in Expression

Hello All,

I am trying to calculate the last 4 weeks from today and have that rolling each day. I do not have a week field but i do have a day, month, and year field. the expression i am currently trying to use is

Sum(If(week(Date(Today()-4)) and DEPT='44840'and epic_status<>'Not Required' and epic_status<>'Done',HOURS)).

This does not seem to work. I was wondering if their was any other expression i could try to accomplish this.

1 Solution

Accepted Solutions
Clever_Anjos
Employee
Employee

week(Date(Today()-4)) should be week(Today()-4*7)

View solution in original post

4 Replies
MK9885
Master II
Master II

Week(YourDatefield) as Week <<<< use this in your scrip.

and in front end...

Maybe something like below?

=sum({<epic_status-={'Not Required'},epic_status-={'Done'},

DEPT={'44840'},Week = {$(=Max(Week-4))}>} YourDimension)

Clever_Anjos
Employee
Employee

week(Date(Today()-4)) should be week(Today()-4*7)

vikasdesai
Partner - Contributor III
Partner - Contributor III

Hello Friend

Please use Following Expression,

Sum({<Date={">=$(=Weekstart(max(Date),-3))<=$(=max(Date))"},Year=,Month=>} Hours)

Regards

Vikas

Clever_Anjos
Employee
Employee

Did this solve your needs?

If yes, please kindly close this thread