Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to conditionally trigger an action

Hi,I have a list box called AcademicYearofEntry on a tab. I want to pre-select a specific value in this list box when opening the tab. This I can do via a Select in Field action triggered on activating the tab (or by a bookmark action). However I actually only want that default list box value to be selected if a value for this field has not already been selected on a different tab. If a value has already been selected on a different tab then instead I want that value to be carried across to the list box on the second tab.

Can anyone help?

P.S. I cannot check the 'Always One Selected Value' checkbox on the listbox as the listbox is actually an expression based on the field.

Thanks

7 Replies
jagannalla
Partner - Specialist III
Partner - Specialist III

Hbutters,

Try the attached file. I written OnActivateSheet Trigger for sheet1 please check it. Hope it helps you.

Jason_Michaelides
Luminary Alumni
Luminary Alumni

In your Select in Field action try:

IF(GetSelectedCount(YourField)=0,'YourRequiredValue')

Hope this helps,

Jason

Not applicable
Author

Hi, this is what I had tried but it did not appear to work and I am not sure if it is due to me having an expression as the basis for the list box field.

Jason_Michaelides
Luminary Alumni
Luminary Alumni

That would probably explain it.  What's the expression?

Not applicable
Author

=if (match(AcademicYearofEntry,'2010-11','2011-12','2012-13')>0,AcademicYearofEntry)

Jason_Michaelides
Luminary Alumni
Luminary Alumni

Hmm.  I can't test it now but if you select a value in that listbox I think it should make the selection in the AcademicYearofEntry field so it should work.  Are there any other actions/triggers that might be removing selections in this field?

Not applicable
Author

Hi that actually seems to work now sorry –I did not have the inverted commas around the fieldname. However now I wanted to do the same code/action on the other tab and it is having none of it! Thanks anyway.