Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Field Selection using triggers

I have two fields in two different tables which have same values i.e. it can act as a Primary Key. If i am joining those tables with that field, ambigous loop is getting formed. so i have renamed one field as FIELD1 and other as FIELD2. I have two list boxes with FIELD1 and FIELD2. Now i want that if i select any value in first list box the same value in the second list box should be selected. How can we do this using triggers ??

I am attaching a sample qvw file here.

3 Replies
Not applicable
Author

Open document properties. In the tab "Triggers" go to "Field Event Triggers".

Add a trigger for the "On Select" event of the field "Region1". This tigger must be an action "Select in Field", field: "Region2" and Search String: "=only(Region1)".

With this, when one value of region1 is selected, the same value of region2 will be selected too.Sample.jpg

Not applicable
Author

Quick follow up question that might solve my current issue, what is 2 or more values were selected in the Region1 field and the desire is for Region2 to have the exact same selections?

This works fine for me with 1 value, but isn't working for 2 or more.   I was using =Region1 (to follow this example) instead of =only(Region1)

Thanks very much!

Richard

Not applicable
Author

FYI  in case it helps someone else, I was able to get this to work by using:

='('&Concat(DISTINCT REGION1,'|')&')

as the Search String so that all selected values are duplicated between fields.