Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Live chat with experts, bring your API Integration questions. June 15th, 10 AM ET. REGISTER TODAY
cancel
Showing results for 
Search instead for 
Did you mean: 
simondachstr
Luminary Alumni
Luminary Alumni

Conditional trigger Select field

Hello everyone,

I have a hard time finding a solution to the following challenge:

There is a variable called vselection.

While vselection has the value 1, I want an automatic trigger on Field 1, which selects the same values in Field 2. Something like a synchronisation.

When the variable is on 0, the synchronisation should be turned off, thus selections in Field 1 don't affect selections in Field 2 anymore.

Idea 1:

The code should look something like this:

Trigger in Field 1

Select Field

Field:

=if(vselection=1, [Field 2])

Selection:

='=sum({<[Field 2]=[Field 1]>}1)'

Unfortunality though, QlikView does not support conditional statements in the Field section which means that the above code is not working.

Idea 2:

Trigger in Field 1

Select Field

Field:

[Field 2]

Selection

=if(vselection=1,'=sum({<[Field 2]=[Field 1]>}1)')

This works fine while vselection has the value 1. Once it's 0 though, the trigger clears Field 2 which is not desirable. I want to keep the selections in Field 2.

Your help is appreciated


Sincerely,

Martin

2 Replies
mov
Champion III
Champion III

Martin,

I didn't try this but hope it works:
Action is selection in flield.
Field is Field2.
Search string is:      =if(vSelection=1, <value of Field1>, <value of Field2>).

If it doesn't work, the oly alternative is to use macro, I think.

Regards,
Michael

simondachstr
Luminary Alumni
Luminary Alumni
Author

Thank you for your reply, Michael.

I actually tried this aswell but I didn't manage to work it out. The problem was how to syntax that the trigger should select the already selected Values in Field 2.

Luckily, I found a working solution using alternate states:

Copy selection in <Standart> state to an alternate state, if vselection=1 is selected.

Make all necessary selection with "Select Field" Trigger.

If vselection=1, copy back alternate state 1 to <Standart>.