Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Not applicable

creating a text box that displays the filter selections

Hi,

I am relatively new to Qlik Sense and i am producing a dashboard for a view of different KPIs.  I was told there was a function that i could use within a text box perhaps at the bottom of the sheet that would display each of the criteria that a user has selected.  My goal is for the user to tell from a snapshot exactly what fields/criteria is contributing to each metric (without having to look at the green selected items in each drop-down).  I would like for the user to see a snapshot of the dashboard and be able to tell for instance that they are looking at sales and margin for x,y,z retailers in oct,nov,and dec of 2014.  Any help would be greatly appreciated!

Thanks!

Tags (1)
1 Solution

Accepted Solutions
Employee
Employee

Re: creating a text box that displays the filter selections

sam, create a brand new text box.  Add one measure as follows:

if(getselectedcount(Year)>0,'Year: ' & concat(distinct Year,', ')) 

...where Year is a field in your data model.  Try to apply a selection and watch what happens. It shows the selection for Year. You would need to repeat for some or all of the other fields. It is probably exhaustive but it can give you finer level control if you only want to show a subset. getfieldselections() shows all of them ...period.

Please also note that you can influence the number of points where getfieldselections() shows a list of selected values instead of x of y values.

getfieldselections ( FieldName [, ValueSep [, MaxValues [, State]]])


You can enter a value for the 3rd argument to raise this to 20, 50, 100 etc..  


Does this help clarify things ? 

10 Replies

Re: creating a text box that displays the filter selections

Within qlikview you could take getcurrentselections() for this. By Sense I'm not sure if it available.

- Marcus

Employee
Employee

Re: creating a text box that displays the filter selections

it is.

You can also fine tune it using a series of measures spaced out using:   concat( distinct <fieldname>,', ' )

Capture.PNG

Not applicable

Re: creating a text box that displays the filter selections

thanks for the quick response! i'm trying to use the concatenate function you suggested to list out the years, but i keep getting an "error in expression '>' expected" when i try to create it... is that function to be used along with the getcurrentselections function?  Any idea what i am doing wrong?

Employee
Employee

Re: creating a text box that displays the filter selections

separately or at least in a different measure.

also its not concatenate, its concat().  can you post your syntax for review.

Not applicable

Re: creating a text box that displays the filter selections

concat(distinct<YYYY/MM>,',')

right now it's showing 11 of 36 for the YYYY/MM field and i wanted to see how it would look to list them out within the text box

also, i have a region field and it has "NOT". i'm not sure what that means.

Not applicable

Re: creating a text box that displays the filter selections

i also tried getcurrentselections(concat(distinct<YYYY/MM>,',')) and it did not work

Employee
Employee

Re: creating a text box that displays the filter selections

For the <> i was just using it as shorthand. If YYYY/MM is the actual field name, wrap it in []. I also changed ',' to ', ' for better spacing


concat(distinct [YYYY/MM],', ')

Not applicable

Re: creating a text box that displays the filter selections

this works but it adds the listed dates to the end of the last selection in the text box instead of listing after the YYYY/MM column which is where i would like it displayed

Employee
Employee

Re: creating a text box that displays the filter selections

sam, create a brand new text box.  Add one measure as follows:

if(getselectedcount(Year)>0,'Year: ' & concat(distinct Year,', ')) 

...where Year is a field in your data model.  Try to apply a selection and watch what happens. It shows the selection for Year. You would need to repeat for some or all of the other fields. It is probably exhaustive but it can give you finer level control if you only want to show a subset. getfieldselections() shows all of them ...period.

Please also note that you can influence the number of points where getfieldselections() shows a list of selected values instead of x of y values.

getfieldselections ( FieldName [, ValueSep [, MaxValues [, State]]])


You can enter a value for the 3rd argument to raise this to 20, 50, 100 etc..  


Does this help clarify things ?