Skip to main content

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
Qlik Cloud Maintenance is scheduled between March 27-30. Visit Qlik Cloud Status page for more details.
cancel
Showing results for 
Search instead for 
Did you mean: 
John3
Contributor III
Contributor III

creating a bar chart that has two years.

How do I create a bar chart with two dimensions? The first dimension is a year chosen and the second dimension automatically becomes the previous year?

Labels (1)
1 Solution

Accepted Solutions
MayilVahanan

HI @John3 

Try like below

Sum({<Year={$(=Max(Year)), $(=Max(Year)-1)}>}Sales)

Hope you can learn set analysis in near by future.

Thanks & Regards,
Mayil Vahanan R
Please close the thread by marking correct answer & likes if you like the post.

View solution in original post

6 Replies
Dalton_Ruer
Support
Support

That is called Set Analysis. I've written an entire hands on Workshop that walks through all of the wonderful use cases for it, including this exact example.

https://community.qlik.com/t5/Documents/Hands-on-Set-Analysis-from-the-ground-up/ta-p/1799118

I would recommend you follow some starting examples where I FORCE the date in question to be 2018 and 2017 so you can get familiar with Set Analysis, but if you want to try and jump into the deep end page 20 has examples very much like what you are trying to do. 

 

 

MayilVahanan

HI @John3 

Try like below

Sum({<Year={$(=Max(Year)), $(=Max(Year)-1)}>}Sales)

Hope you can learn set analysis in near by future.

Thanks & Regards,
Mayil Vahanan R
Please close the thread by marking correct answer & likes if you like the post.
John3
Contributor III
Contributor III
Author

Thanks Mayil Vahanan. Do you know any good set analysis courses?

John3
Contributor III
Contributor III
Author

Thanks Mayil Vahanan.

MayilVahanan

Hi @John3 

In Community, you can see many set analysis pdf which will help you

https://community.qlik.com/t5/Qlik-Education-Documents/Set-Analysis-Presentation-pdf/ta-p/1487937

https://community.qlik.com/t5/Documents/Set-Analysis-1-pdf/ta-p/1480757

 

Thanks & Regards,
Mayil Vahanan R
Please close the thread by marking correct answer & likes if you like the post.
John3
Contributor III
Contributor III
Author

Thanks.