Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
balasundaram
Creator II
Creator II

CY vs PY Comparison in Line chart

I want to show Details Of CY and PY in single report..

based on Year and Month.

For example..if i selected Current Year and May month...same chart need to display Previous Year and Previous year may month..

1 Reply
senpradip007
Specialist III
Specialist III

Create a variable vPrevYear = Max(Year) - 1

Use these two expressions

Sum({<Year={$(=Max(Year))}, Month={$(=Max(Month))}>} [Your Field])

Sum({<Year={$(vPrevYear)}, Month={$(=Max(Month))}>} [Your Field])