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: 
Rama1
Contributor II
Contributor II

How to get last 4 weeks data

Hi,

 

In my Dashboard i have few tables and charts calculating  last 4 weeks data. Now as the year is changed i can only see Week1 data in my table instead of last 4 weeks. (3 weeks previous year data and one week this year data)

I want to see my last 4 weeks data i.e Week 50, 51, 52,53(last 2 days of the year) of the previous year and Week 1 of this year in the table.

I am using 

SUM({<[WeekSerial]={">$(=max(WeekSerial)-4)<=$(=max(WeekSerial))"} , My_flag = {'No'} >} [My field] * [My Field]) as set analysis expression to get last 4 weeks data

But this expression now generating only Week1 of 2020 data.

Can anyone help me how to get last 4 weeks data.

Thanks in advance.

Labels (1)
1 Solution

Accepted Solutions
Kashyap_R
Partner - Specialist
Partner - Specialist

Hi

Try this 

sum({<[Date]={">=$(=Weekstart(WeekName(max([Date]),-4)))<=$(=Weekend(WeekName(max([Date]))))"}>}Value)

Hope this helps 

Thanks

Thanks and Regards
Kashyap.R

View solution in original post

2 Replies
Kashyap_R
Partner - Specialist
Partner - Specialist

Hi

Try this 

sum({<[Date]={">=$(=Weekstart(WeekName(max([Date]),-4)))<=$(=Weekend(WeekName(max([Date]))))"}>}Value)

Hope this helps 

Thanks

Thanks and Regards
Kashyap.R
Rama1
Contributor II
Contributor II
Author

Thanks Kashyap,

Its working

Thanks

Rama