Qlik Community

Ask a Question

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
Our next Qlik Insider session will cover new key capabilities. Join us August 11th REGISTER TODAY
cancel
Showing results for 
Search instead for 
Did you mean: 
lweny
Contributor
Contributor

Get a value from selected value in filter pane

Anyone know how to get a value from filter pane? For example in "Year" filter pane user choose 2018, then I need to use this value in the expression. Thanks a bunch!
1 Solution

Accepted Solutions
jonathandienst

GetFieldSelections(Year) will return a list of years if the user selects more than one, and will return nothing of nothing is selected. This behaviour may be what you want.

An alternative is to use =Max(Year). This will always return exactly one value. If the user selects a year, this will return the selected year. If no selections are made, it will return the latest year in the data set. If the user selects more than one year, then this expression will return the maximum of the selected years. T

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein

View solution in original post

6 Replies
shiveshsingh
Master
Master

Hi, Use this.

 

=GetFieldSelections(Year)

jonathandienst

GetFieldSelections(Year) will return a list of years if the user selects more than one, and will return nothing of nothing is selected. This behaviour may be what you want.

An alternative is to use =Max(Year). This will always return exactly one value. If the user selects a year, this will return the selected year. If no selections are made, it will return the latest year in the data set. If the user selects more than one year, then this expression will return the maximum of the selected years. T

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein

View solution in original post

lweny
Contributor
Contributor
Author

@shiveshsingh Thanks for reply! I tried your solution in my expression but got an error sum({<[Year]={GetFieldSelections(Year)}, [Type]={"*Forecast"}>}[Sales], did I make a mistake here?

shiveshsingh
Master
Master

Try this

=sum({<[Year]={"$(=GetFieldSelections(Year))"}, [Type]={"*Forecast"}>}[Sales])

lweny
Contributor
Contributor
Author

@jonathandienst thanks for the solution, it works for me, cool! thanks so much

lweny
Contributor
Contributor
Author

yes, this format works, sometimes I got confused with the brackets, they are so many! anyway, thanks for your help shiveshsingh