Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
freceena
Contributor II
Contributor II

Finding maximum value of previous week

I want to calculate the difference between max(particular week for eg. week 21) - max(previous week for eg. week 20). I tried the following expression in expression editor :

max([Counter])-max({$<Date={">=$(=Date(WeekStart(Max([Date of Measurement]),-1, 0),'DD-MM-YYYY'))<=$(=Date(WeekEnd(Max([Date of Measurement]),-1, 0),'DD-MM-YYYY'))"}>}[Counter])

Could anyone please help me on this?

Labels (3)
1 Solution

Accepted Solutions
MayilVahanan

Hi @freceena 

max([Counter])-max({$<Date={">=$(=Date(WeekStart(Max([Date of Measurement]),-1, 0),'DD-MM-YYYY'))<=$(=Date(WeekEnd(Max([Date of Measurement]),-1, 0),'DD-MM-YYYY'))"},Year=,Week=,Month=>}[Counter])

Your expression looks correct , just need to exclude the Time filter in the expression.

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.

View solution in original post

1 Reply
MayilVahanan

Hi @freceena 

max([Counter])-max({$<Date={">=$(=Date(WeekStart(Max([Date of Measurement]),-1, 0),'DD-MM-YYYY'))<=$(=Date(WeekEnd(Max([Date of Measurement]),-1, 0),'DD-MM-YYYY'))"},Year=,Week=,Month=>}[Counter])

Your expression looks correct , just need to exclude the Time filter in the expression.

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.