Skip to main content
Announcements
Introducing a new Enhanced File Management feature in Qlik Cloud! GET THE DETAILS!
cancel
Showing results for 
Search instead for 
Did you mean: 
curiousfellow
Specialist
Specialist

two listboxes--same sourcefield

I have to charts, one with the results  of year selected in listbox 1 and one with the results of year selected in listbox 2.

the fields in both listboxes have the same source : field year in table results.

How can I refer to listbox 2 as selection in set analysis. ?

1 Solution

Accepted Solutions
Gysbert_Wassenaar

Both listboxes act on the same field. Set analysis expressions do not refer to listboxes but fields. So you can't refer to a listbox is a set analysis expression. But what you can do is create different Alternate States on the General tab of the Document Properties window. Once you've created those Alternate States you can assign the two listboxes to those alternate states (choose different alternate states for each of the two listboxes). Open the properties window of the listbox and on the General tab change the alternate state from Inherited to the alternate state you wish to use for this listbox. Then you can refer to the alternate state in the set analysis expression. For example sum(Amount) would change like this to refer to alternate states named AlternateStateA and AlternateStateB

=sum( {AlternateStateA} Amount)

=sum( {AlternateStateB} Amount)


talk is cheap, supply exceeds demand

View solution in original post

4 Replies
Gysbert_Wassenaar

Both listboxes act on the same field. Set analysis expressions do not refer to listboxes but fields. So you can't refer to a listbox is a set analysis expression. But what you can do is create different Alternate States on the General tab of the Document Properties window. Once you've created those Alternate States you can assign the two listboxes to those alternate states (choose different alternate states for each of the two listboxes). Open the properties window of the listbox and on the General tab change the alternate state from Inherited to the alternate state you wish to use for this listbox. Then you can refer to the alternate state in the set analysis expression. For example sum(Amount) would change like this to refer to alternate states named AlternateStateA and AlternateStateB

=sum( {AlternateStateA} Amount)

=sum( {AlternateStateB} Amount)


talk is cheap, supply exceeds demand
curiousfellow
Specialist
Specialist
Author

Thank you Gysbert

I don't have much experience in using the alternate option. I think this is a good moment to try.

I did not know an alternate state could inherited from another alternate state

Gysbert_Wassenaar

They can't. Objects can inherit. Sheets inherit from the Document. Objects on Sheets inherit from the Sheet. And then you can override that per object and specify which alternate state should be used for the object.


talk is cheap, supply exceeds demand
curiousfellow
Specialist
Specialist
Author

I did some readings ..but just to be sure ;

I don't want the other selections to be to be affected. The only way to achieve that is to set every other selection to {field1=$,field2=$,field3=$} etc, etc ?