Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Wanted to get previous year data by clicking one button

Can ayone please tell me how to achive below one:

I wanted to create a button with the name "Previous Year", when you click on that button the entire dashboard should shows only previous year data.

Please help, Thanks in Advance

5 Replies
ashfaq_haseeb
Champion III
Champion III

Hi,

May be like this.

Regards

ASHFAQ

Not applicable
Author

Thanks Ashfaq for the reply

Can you please send me the process in reply only if possible, since i am using desktap version of QV, i can not open this file

ashfaq_haseeb
Champion III
Champion III

Hi

Create a button.

and add trigger Select in field

and Select field Year assuming you have year and write the below expression.

=year(today())-1

Please find the snapshot attached.

Hope it helped.

Regards

ASHFAQ

Not applicable
Author

It did not help, sorry

Actualy i created two chart having three years of the data, my requirement is

if you are showing 2014 data in one chart, by clicking previous year button the second chart should show previous year data.

Thank you so much Ashfaq

Not applicable
Author

Hi

Try to use set analysis

In the first diagrams display the current year. expression should be something like:

sum ({DimensionYear = {$ (=Year(Today()))}} Value)

The second diagram shows the previous year. Expression:

sum ({DimensionYear = {$ (=Year (Today()) -1)}} Value)

DimensionYear - the name of the field that contains year in the data model


It will work without buttons. Use Previous year button you can show/hide the second diagram.