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

Announcements
Only at Qlik Connect! Guest keynote Jesse Cole shares his secrets for daring to be different. Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
LP27
Creator II
Creator II

Show only last year data in pivot table

Hi,

I have a date Field as - (Period) in format of 'MMM-YYYY' .  I need to only show last year data(2018).

How do i go with the script.

For Example - 

Name20192018201720162015
List-4   
Top 6   

 

Now i need to show only last year column, ie. 2018

Note: Period Field has auto calendar applied.

 

Thanks in advance.

Labels (2)
1 Solution

Accepted Solutions
StarinieriG
Partner - Specialist
Partner - Specialist

Hi,

you could do it with set analysis, but if you want to do it with the script:

- you could create a new field year inside calendar like this if(year(period)=Year(Today())-1,Year(Period) 

- then use this field in the pivot

View solution in original post

2 Replies
StarinieriG
Partner - Specialist
Partner - Specialist

Hi,

you could do it with set analysis, but if you want to do it with the script:

- you could create a new field year inside calendar like this if(year(period)=Year(Today())-1,Year(Period) 

- then use this field in the pivot

LP27
Creator II
Creator II
Author

Thanks a alot! It worked.