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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
lucasx15
Contributor III
Contributor III

GetFieldSelections Multiple Values

I'm stuck in a situation. I have a line chart with 1 dimension and 4 expressions. And I need to make each expression appear as I select the corresponding filter, especially if the user selects more than one filter.
What I did: I added a conditional

 

=IF(GetFieldSelections(DIMEN)=7,1,0)

 

Where the number 7 is the sequence number of my expression.


However, it's still not working

Labels (1)
1 Solution

Accepted Solutions
henrikalmen
Specialist II
Specialist II

Ok, so you have different measures and you want them to be conditionally visible (or hidden) based on selections made in the DIMEN dimension. All of them are hidden by default, until selections are made in DIMEN.

Try this as the condition for measures: =match(DIMEN, x)
Replace x with the value from the field, so in the measure that should be visible when the value 1 is selected you write =match(DIMEN, 1) and so on. If a measure should be visible when DIMEN is 3 and/or 5 you just add comma separated values like =match(DIMEN, 3, 5)

But maybe I have misunderstood, since you say you have only four measures but the selected value in DIMEN can be higher than 4...

View solution in original post

3 Replies
henrikalmen
Specialist II
Specialist II

I'm not sure what you are saying that you want to do, but I can tell you what the formula you have written does. The result is that if a selection of the numeric value 7 is done in the field called DIMEN, then your expression will return 1. Otherwise, i.e. if the selected value in field DIMEN is not (only) 7, the expression will return 0.

lucasx15
Contributor III
Contributor III
Author

Thanks for the answer. Exactly. The issue is that I would like to select multiple values ​​in my filter. that is, when selecting 7 and 9, it returns lines 7 and 9 to me on the graph.
That is, the lines according to the selection.

Captura de tela 2023-02-27 100340.jpg

 

henrikalmen
Specialist II
Specialist II

Ok, so you have different measures and you want them to be conditionally visible (or hidden) based on selections made in the DIMEN dimension. All of them are hidden by default, until selections are made in DIMEN.

Try this as the condition for measures: =match(DIMEN, x)
Replace x with the value from the field, so in the measure that should be visible when the value 1 is selected you write =match(DIMEN, 1) and so on. If a measure should be visible when DIMEN is 3 and/or 5 you just add comma separated values like =match(DIMEN, 3, 5)

But maybe I have misunderstood, since you say you have only four measures but the selected value in DIMEN can be higher than 4...