Qlik Community

QlikView Layout & Visualizations

Discussion Board for collaboration on QlikView Layout & Visualizations.

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

Re: How to display current selections with separators in a textbox?

Hi,

use if clause for it

like

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

Regards

Regards,
Prashant Sangle

Re: How to display current selections with separators in a textbox?

May be this:

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

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

'Market:'&GetFieldSelections(Market_Name)

manucamon
Valued Contributor III

Re: How to display current selections with separators in a textbox?

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

Re: How to display current selections with separators in a textbox?

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

Re: How to display current selections with separators in a textbox?

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

Community Browser