
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How to show only last 5 days of data in Qlik Sense Pivot Table
Hi, I have a pivot table that looks like the one below in Qlik Sense.
'Where first seen' and 'Date' are dimensions. The 'T/S', 'T/C', 'C', 'D/C' and 'D/S' are measured values that use the count function. I would like to show only the last 5 days of data in the table without the user having to touch anything.
Only loading 5 days of data in the script isn't an option as we have multiple pivot tables showing different lengths of time on the same sheet (eg. 5 days of data, 10 days of data, 30 days of data).
Can anyone please help with this ? Thanks a lot!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I notice you have date as a dimension. You could try to replace it with an calculated dimension. Define the dimension like this:
if([Date]>max(total [Date])-5, [Date], Null())
Alternatively you can add a set modifier to all your expressions limiting the Date span of the calculation.
Qlik Community MVP

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks a lot. The calculated dimension works but it requires you to select the specific dates in the filter. This means all the tables are then filtered for these dates. Is there a way to have different calculated dimensions for each table?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
try
create two variables
vFromDate=Max(date)-5
vToDate=Max(Date)
try this expression in measure
=Sum({<Date={">=$(vFromDate)<=$(vToDate)"}>} Value)
