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

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Set Analysis For calculating Last 4 weeks total

Hi experts,

I am stuck in writing an expression for calculating the last 4 weeks total customers.

I have a data set like below

1.JPG.jpg

I want to display the chart which shows me week wise total customers. But the total customers must be calculated based on last four weeks. This means result should be

Week 1 - Total Customer=4

Week 2 - Total Customer=11

Week 3 - Total Customer = 18

Week 4 - Total Customer = 25

Week 5 - Total Customer= 28 and so on

Please help me in writing the set expression for this scenario.

Appreciate your help.

13 Replies
Not applicable
Author

None of the solution specified is working. Can anybody please suggest any other solution?

Thanks,

Ruchika

mato32188
Specialist
Specialist

Hello Ruchika,

try RangeSum ( above (total Count (Customers) , 0, 4) )

BR

M

ECG line chart is the most important visualization in your life.
VishalWaghole
Specialist II
Specialist II

Hi Ruchika,

PFA Qvw application.

Hope it will solve your problem.

-- Regards,

Vishal Waghole

Not applicable
Author

Thanks for the solution Vishal.

But the defined solution will only display last four months data. I want to display all the weeks prior to the selected week. So if I select 'Week 15' from listbox, then it should show all weeks data from 'Week 1' to 'Week15'. Also these must be aggregated from prior four weeks data.

So in your example, If I select 'Week 15' then Week 1 to 15 must be displayed with rolling four weeks data for each week.