Announcements
cancel
Showing results for
Did you mean:
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)
• bar chart comparisons

1 Solution

Accepted Solutions
MVP

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
6 Replies
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.

MVP

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
Contributor III
Author

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

Contributor III
Author

Thanks Mayil Vahanan.

MVP

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