Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Advanced Alternate State Selection

Hi,

I'm new to alternate states my problem is i have a listbox with a default state and a listbox with state 1 and two listboxes below with some codes(picture1). Now i want whenever I select the default state that it automaticly selects like in the default code the "SGDX" in the State 1 Code (picture2).

I know that i could disable the Alternate state state 1 in the properties of the listbox but I would like to keep it there for other reason. Better would be a solution with an expression like set analysis and I'm kind of confused how to solve it.

For example something like this:

IF "Default state" selected, select the same "default code" for the "state1 code" too.

Thanks in advance!

Frage01.JPGFrage02.JPG

15 Replies
sunny_talwar

Not really sure I understand? Would you be able to elaborate?

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

So when a selection if made in [Default State $] field "Default", you want to select values in [State 1] "Code"  using possible values of [$[ Code?

So do as Sunny suggested, but the action would be Select in Field = Code. Set the Action alternate State to [State 1]. Create the selection value as something like

='(' & concat{$} Code , '|') & ')'

I may not have that concat exactly right. Play with it in a text object.

-Rob

http://masterssummit.com

http://qlikviewcookbook.com

sunny_talwar

Looks right except the missing parenthesis after Concat

='(' & concat({$} Code, '|') & ')'


If Code can have multiple words, than this:

='("' & concat({$} Code, '"|"') & '")'

Not applicable
Author

I mean if I do it with your method. I would get a selection in the listbox State 1 too. I wouldn't get the options of "A01" and "P10" like in the picture below. I would only get the selection "A01".

Thats my aim that I make a selection in the "default state" and it copies the options of the "default state code" to the options of the "state 1 code" and reduces the options for "state 1" like in the lowest picture.

Hope it helps to understand my problem.

swuehl
MVP
MVP

I think it should work if you use the correct field names as indicated by Rob for your Select - Select in field action.

Could you upload your current working sample, if you still have issues making the selections right?

Oleg_Troyansky
Partner Ambassador/MVP
Partner Ambassador/MVP

If you wanted the same, solved in an expression with Set Analysis, it's rather easy to do:

sum({Group1<MyField = $::MyField>} Value)

This Set Analysis expression uses the Alternate State Group1, while the selections in the field MyField are replaced with the selections in the same field in the Default state.

I'm actually in the process of adding Alternate States to my Set Analysis lecture for the Masters Summit for Qlik. Check it out if you'd like to learn more.

cheers,

Oleg Troyansky