Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Rama1
Contributor II
Contributor II

How can i get Last 4 weeks data in Pivot table from Excel data which contains 9 weeks data

HI,

I need help on the below requirement.

I'm trying to do something i can do in excel but on a pivot table in QlikSense.

I am using 2 dimensions Week and Customer and Count as measure.

In my excel sheet i have 9 weeks of data with Week column as Week 40, Week 41......Week 49.

I have Date column as Week start data i.e Sunday 6.10.19,27.10.19.......1.12.19.

and  count column for each Client as 1.i want only last 4 weeks data Client count. 

Attached my pivot table sample.

Thank you.

Labels (1)
2 Replies
Wlad_Masi
Employee
Employee

@Rama1  Can you please attach the excel file with the result you are trying to accomplish ?

To help users find verified answers, please don't forget to mark a correct resolution or answer to your problem or question as correct.
srdheekonda
Contributor III
Contributor III

Hi Rama,

I was able to create the last 4 weeks start date dimension for each client based on the available data. Create a flag on top of this dimension to filter the latest 4 weeks records.

Last 4 Weeks Start Date by Client: 

=AGGR(DATE(WeekStart(MAX(DATE_COLUMN))-21,'YYYY-MM-DD'),CLIENT)

I hope this helps