Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Staffan
Contributor II
Contributor II

Compare two years in line chart

Hello,

How do I compare the same dates in different years on a line chart? I would like to display two lines, one for 2020 and one for 2021 for comparison, not one line as in the attached screenshot.

Thanks,

/Staffan

21 Replies
Taoufiq_Zarra

Capture.PNG

be sure you don't have any selection

dimension =DAY(Date)

measure

=Sum({<Date = {">=$(=Max(Addyears(YearStart(Date),-1))) <=$(=Max(Addyears(YearEnd(Date),-1)))"} >} Visits)

=Sum({<Date = {">=$(=Max(YearStart(Date))) <=$(=Max(Yearend(Date)))"} >} Visits)

 

Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉
Staffan
Contributor II
Contributor II
Author

@Taoufiq_Zarra Ah, I had an uncleared selection that I had to remove. Now it works! Thank you! 🙂