Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Join us at the Cloud Data and Analytics Tour! REGISTER TODAY
cancel
Showing results for 
Search instead for 
Did you mean: 
simondachstr
Luminary Alumni
Luminary Alumni

Passing selections to alternate states

Hey there everybody,

I have 2 different alternate states. Now I want to be able to pass field selections in state 1 to state 2 so that the field looks synchronized in one way (only state 1 to state 2).

I have no clue how to solve this challenge. Something like the function copying alternate states is what I am looking for, but I only for specific fields. Maybe a workaround with a variable is the answer?

Your help is greatly appreciated.

Martin.

1 Solution

Accepted Solutions
simondachstr
Luminary Alumni
Luminary Alumni
Author

Hey everybody,

I found the solution and want to present it to whomever it might find useful:

First set up a dynamic variable which reads in the selection from Field A in alternate stat 1 with GetFieldSelection():

varname

=if(GetSelectedCount(Field A)>0  ,'("' & concat(DISTINCT Field A, '"|"') & '")'  ,''  )

Next, whenever a selection on Field A is made it should trigger the following:

Trigger: SelectValue

Field: Field A

Value: varname

Alternate State 2

Credits go to the following thread:

http://community.qlik.com/thread/35287

Cheers,

Martin.

View solution in original post

4 Replies
Not applicable

You need to alter Set analysis to tell it to match the fields across states.

{[AltStateName]<[Field] = $::[Field]>}

Edit: See page 766 of the reference manual, this helps explain

simondachstr
Luminary Alumni
Luminary Alumni
Author

Hey everybody,

I found the solution and want to present it to whomever it might find useful:

First set up a dynamic variable which reads in the selection from Field A in alternate stat 1 with GetFieldSelection():

varname

=if(GetSelectedCount(Field A)>0  ,'("' & concat(DISTINCT Field A, '"|"') & '")'  ,''  )

Next, whenever a selection on Field A is made it should trigger the following:

Trigger: SelectValue

Field: Field A

Value: varname

Alternate State 2

Credits go to the following thread:

http://community.qlik.com/thread/35287

Cheers,

Martin.

View solution in original post

hiromisawa
Contributor
Contributor

Hello, Martin.

Your post was very helpful.  This is the information I was looking for.

However, I am not very used to QlikView and I can't follow the last step you stated.  More specifically,

Next, whenever a selection on Field A is made it should trigger the following:

Trigger: SelectValue

Field: Field A

Value: varname

Alternate State 2

I am not sure how to implement this step.  Will you please elaborate on this last step?

Thank you.

Hiro

mjtaft2017
Partner
Partner

I was recently trying to accomplish something similar in Qlik Sense and was not successful. 

On sheet 1 - the app opens to default settings I have in a bookmark.  The bookmark has  2 Periods selected in the field YearPeriod.  The user then wants to use those selections to transfer to another sheet (sheet 2) where the selected Periods are compared (not added together) in a few other visuals.  Therefore, on sheet 1  I was using the navigation button extension to set 2 variables that I planned to use for the default selections on sheet 2- one for the YearPeriod filter in 'state 1' and one for the YearPeriod filter in 'state 2' - then it cleared the selections in the YearPeriod field on sheet 1 and transferred to sheet 2. 

What I found on sheet 2 is that the YearPeriod filters in 'state 1' and 'state 2' did not show the default selections - even though the variables had the values.  If I toggled the 'state' on the YearPeriod filter to the default state it showed the value selected. 

I am not sure why the variable I set could not be used as the default selection for the filter in an alternate state. 

I hope this makes sense how I explained it and that someone can help.  There are many extensions which have actions you can choose to make selections in a field - however I have not found one where you can make selections in a field associated with a specific 'state'.  That is what I need to do.