Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
ShellyG
Creator
Creator

Limit Last 5

Hello guys,

I was searching for a similar question/issue but I was not able to find, so I am opening this one. 

I have a pivot table with calculations for quarters (they are working properly and the numbers are correct). My issue is that the table consists of all of the available data quarters that we have and I have a requirement to show only the last 5. 

Is there any way to limit only the last 5 columns to be shown in a pivot table? 

Thanks in advance!

1 Solution

Accepted Solutions
AndrewHughes
Partner - Contributor III
Partner - Contributor III

Hi Shelly,

If you are trying to limit the last 5 quarters it is probably best to do this at a script level by adding to your calendar. If you are using a standard Qlik calendar something like this would work nicely. Then you can simply replace your quarters field with the last 5 quarters field from the calendar.

https://community.qlik.com/t5/New-to-QlikView/Last-5-complete-Quarter-Flag/m-p/1328453

-Andrew

View solution in original post

5 Replies
Kushal_Chawda

How quarter is calculated ?

ShellyG
Creator
Creator
Author

Hello!

As rows dimension - I am using the details about the customers and as columns dimension - I am using the quarters (I have a field, called 'Quarter' and it contains data in the following format - '2013Q1', '2013Q2', '2013Q3', '2013Q4', '2014Q1' etc...

The field 'Data' that contains the scores for the customers.

The measure I am using to get the specific numbers for the customers is as follows:

Sum(Data)/Aggr(NODISTINCT Sum({$}TOTAL <Quarter> Data), Quarter)

Let me know if anything else is needed.

davidfdezcalleja
Contributor II
Contributor II

 

Hi,

Captura.JPG

is this?

regards,

David.

ShellyG
Creator
Creator
Author

Hello David,

This doesn't work with me, because I have added the Quarters as columns to the right and every row corresponds to a specific customer for the specific quarter. 

If I go to the options of the Quarters and I set the limitation to 5 for example, it only removes some of the data, but I still see all of the Quarters in the table... 

Not sure if that makes sense... It is the same as your table, only that my Quarters are not to the left as rows, but to the right as columns. 

Thanks! 

AndrewHughes
Partner - Contributor III
Partner - Contributor III

Hi Shelly,

If you are trying to limit the last 5 quarters it is probably best to do this at a script level by adding to your calendar. If you are using a standard Qlik calendar something like this would work nicely. Then you can simply replace your quarters field with the last 5 quarters field from the calendar.

https://community.qlik.com/t5/New-to-QlikView/Last-5-complete-Quarter-Flag/m-p/1328453

-Andrew