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

How to display current selections with separators in a textbox?

Hi,

I want to display the current filter selections in a text box with separators like below:

Year: 2016; Month: May; Market: USA;

I tried the below code:

='Year:'&GetFieldSelections (fiscal_year) &';'&'Month:'&GetFieldSelections (Month)&';'&'Market:'&GetFieldSelections (Market_Name)

which returns the below output when the filters like month are not selected:

     Year: 2016;Month:;Market:USA;

I would like to hide the separator & the label when 'month' is not selected:

     Year: 2016;Market:USA

    

Regards,

Venugopal G

5 Replies
PrashantSangle

Hi,

use if clause for it

like

=if(GetSelectedCount(Month)>0,'final_val : ' & GetFieldSelections(Month) & ' ;')

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
sunny_talwar

May be this:

=If(GetSelectedCount(fiscal_year) > 0, 'Year:' & GetFieldSelections (fiscal_year) & ';') &

If(GetSelectedCount(Month) > 0, 'Month:'&GetFieldSelections (Month) & ';') &

'Market:'&GetFieldSelections(Market_Name)

Anonymous
Not applicable
Author

Hi Venugoapl,

Use GetCurrentSelections: GetCurrentSelections(';',' ',',').

getcurrentselections ([RecordSep [, TagSep [,ValueSep [, MaxValues [, State]]]]])

Returns a string with the current selections in the document. It is possible to query an alternate state.

RecordSep is the separator to be put between field records. The default is <CR><LF>.

TagSep is the separator to be put between the field name tag and the field values. The default is ': '.

ValueSep is the separator to be put between field values. The default is ', '.

Maxvalues is the maximum number of field values to be individually listed. When a larger number of values is selected the format 'x of y values' will be used instead. The default is 6.

State is the alternate state to query.

Examples

getcurrentselections ( )

getcurrentselections ( chr(13)&chr(10) , ' = ' )

getcurrentselections ( chr(13)&chr(10) , ' : ' , ' ; ' )

getcurrentselections ( chr(13)&chr(10) , ' : ' , ' ; ' , 10 )

Thanks!!!

Not applicable
Author

Thanks for the reply. It works for us. We are able to display:

Year: 2016; Month: January;

Our requirement is to have only one label as "Timeline" for both:

Timeline: 2016; January;

Timeline should appear even when any one value from Year & Month are selected:

Timeline: 2016;

Timeline: January;

Not applicable
Author

Thanks Max for the reply. We got some clues from your solution.