Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Macro

Hi,

I'm looking for a macro : when I select a year it selects  selected year and the previous year.

Any idea is appreciated.

Thanks,

19 Replies
Not applicable
Author

Hi,

I want to make it dynamic means: if the user selects one year for example 2010 them it shows 2010 & 2009 but if the selects 2010 and 2008 then it shows these 2 years not any thing else.

Do you think if this is possible?

Thanks,

MayilVahanan

HI,

     Try like this,

     =if(GetSelectedCount(Year) > 1, '(*'&vT1&'*|*'&vT&'*)','(*'&vT1&'*|*'&vT&'*|*'&vT2&'*|*'&vT3&'*)')

     But it helps for two year selection only..

  Where vT1 => Max(Year) and vT => Max(Year)-1, vT2 => Min(Year) and vT3 =>Min(Year)-1

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

I changed it to this and worked for me , thanks

=if(GetSelectedCount(YEAR) = 1, '(*'&vT1&'*|*'&vT&'*)',

if(GetSelectedCount(YEAR) > 1, '(*'&vT1&'*|*'&vT3&'*)',vT1))

Not applicable
Author

Hi Mayil,

I have another request for you Mayil,

If we want to this action just for certain pages how we can do that?

Thanks,

Nima

MayilVahanan

Hi,

     If you use qlikview -11 , use alternate state for certain page ..sheet->properties->alternate state..

     But make sure, no change affect in that sheet..For more info about alternat state, please refer qlikview manual or help..

Hope it helps..

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

I'm in qlik -11 but I don't have this option.

Thanks,

MayilVahanan

Hi,

     Setting->Document properites->general->alternate state..

     Add alternate state in that. Then you use it in sheet properties->general.

Hope it helps

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

Sorry Mayil,

But it works for every selection , I just need it to be done on only one slection like "year".

Thanks,

MayilVahanan

Hi,

     Actually, you want to select a year , in one sheet. but no reflection on another sheet ?? but want to reflect in same page for year.

or

donot want to change any reflect in all page when select the year field and no reflect in the same page also means, you can set alternate state for that particular field ..without alternate state, inspite of my knowledge i dono how to exclude selection in all page..

If you want for it and also for understand the alternate state, please refer the following page

http://community.qlik.com/message/240621#240621

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

Thanks for reply,

The only thing I want is to make the trigger we created for the year, works on certain page not all the pages . And it seems it's not doable???