Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Select per trigger event

Hi,

could you please help me with the attached sample?

I would like have the following:

Clicking on values in 'RAD Phase' sets the variable vRAD to 1 and selects 'RAD' in the field Sicht.

Deselecting all values in 'RAD Phase' sets the vRAD back to 0 and selects 'Standard'.

The same should be done for 'RAD Segment', so clicking on any value sets the variable to 1 and selects 'RAD', deselecting all set the variable to 0 and selects 'Standard'.

Thanks.

1 Solution

Accepted Solutions
saumyashah90
Specialist
Specialist

Sorry if i missed that..

This will help  you

View solution in original post

14 Replies
saumyashah90
Specialist
Specialist


Check this

Not applicable
Author

Okay, the variable is working for one of the two fields now, I can handle the other one. But what about the deselection of a RAD... value that shall select 'Standard'?

Many thanks.

saumyashah90
Specialist
Specialist

Sorry if i missed that..

This will help  you

saumyashah90
Specialist
Specialist

Request you please mark it correct if you got your answer

Not applicable
Author

Thanks a lot, your solution is working fine and I will mark your answer as correct.

I have one issue, nevertheless. When I implement the solution into my real application, the "step back" does not work.

Meaning a phase and  "RAD" are selected, I deselect the phase, then the variable is changing to 0, but the 'Sicht' is still 'RAD' and not 'Standard'. Do you have an idea what might be the issue? I compared everything several time from the demo to the application, but I don't see a difference.

Thanks!

Not applicable
Author

It seems that the OnChange event for the variable is not fired at all, as I added an action to lock a different field for testing purpose. This is not done, too.

saumyashah90
Specialist
Specialist

1)You should not lock any fields

2)check  On Change trigger for the variable and also the definition of the variable

Not applicable
Author

1) Yeah, this is only to check if the onchange event trigger is fired.

2.) I put the change trigger expression into a textbox and it behaves as intended. This is the variable definition:

=if((GetSelectedCount([RAD_Phase.P])>0 or GetSelectedCount([RAD_Segment.P])>0) and Sicht='RAD' ,'1','0')

I only changed the field names accordingly to my application.

The onchange event only seems to fire when I still have a phase or segment selected and change 'Sicht' manually.

saumyashah90
Specialist
Specialist

It should work

Use this:

=if((GetSelectedCount([RAD_Phase.P])>0 or GetSelectedCount([RAD_Segment.P])>0),'1','0')