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

Changing a variable if a specific field value is selected

Hello,

i defined a variable in my document:

showBrain = 0

Now i have an image with the condition that it will only be shown if showBrain = 1.

I now need some kind of trigger or something similar which detects when a specific value in a table is selected.

So for instance i have the table:

Eye

Brain

Stomache

...

Only if the Brain is selected (exclusively meaning no other value in the table) then the variable showBrain is switched to =1.

Eye

Brain

Stomache

...

Also i need a second trigger. Even if the Brain is selected but anything else within the table is selected then the variable should switch back to showBrain =0.

My biggest problem is that i do not exactly know where and how to define this trigger. I guess in the trigger properties for the document?

But i am not sure. Any help is very much appreciated!

1 Solution

Accepted Solutions
swuehl
MVP
MVP

I think there are two ways:

1) Create a variable that changes value depending on your conditions, something like

showBrain:

= If( Only( YourFieldName ) = 'Brain', 1,0)

2) Create a field event trigger OnSelect of  YourFieldName, with an action to change the variable (with a similar expression like above).

I think I would go for 1), since it's easier to understand what's happening when checking the variable.

View solution in original post

2 Replies
swuehl
MVP
MVP

I think there are two ways:

1) Create a variable that changes value depending on your conditions, something like

showBrain:

= If( Only( YourFieldName ) = 'Brain', 1,0)

2) Create a field event trigger OnSelect of  YourFieldName, with an action to change the variable (with a similar expression like above).

I think I would go for 1), since it's easier to understand what's happening when checking the variable.

Not applicable
Author

Thank you for that great reply,

i went for your first suggestion and it works great!!!