Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
See why BI users voted Qlik #1 in 11 categories. GET REPORT
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Contributor II
Contributor II

How to show only last 6 weeks data in Qliksense Pivot table and bar chart

HI,

I am developing an app using my data sheet in Qliksense.

In my data sheet i have data from week 49 of 2019 to week 6 of 2020 and i uploaded the complete data sheet in my app. and now i want to show only last 6 weeks data in Pivot table.i.e from Week 1 of 2020 to Week 6 of 2020.

My dimensions are Client, Name as rows and Week as Column and Sum(Count) as Measure.

i have Week as Week 1, Week 2 ...Week field

Date i.e Weekstart day(Sunday) as my date for ex: Date for Week 1 is 05.01.20 and Week 2 is 12.01.20 and ....Week 6 is 09.02.20 etc.

I have Week and Date as Date fields in my data.

Can anyone please help me how can i show only last 6 weeks data in Pivot table, Bar chart by using above date fields.

Thanks in advance

Labels (1)
2 Replies
Highlighted
Creator II
Creator II

Sum({<Date={$(=Date(Week(Max(Date)-6)))}>}Count)

Highlighted
Contributor III
Contributor III

Create a measure that looks like: 

Sum({<WeekNumField={">$(=$(Week(Max(Date)))-6)"}>}[YourField])