Qlik Community

QlikView Layout & Visualizations

Discussion Board for collaboration on QlikView Layout & Visualizations.

Not applicable

Display Current selection in text box

i want to display the current selection in text box. i tried Getcurrentselection(Agency_Name) = 'Selected  '

this is my field

List Box

Agency_Name

     abc

     bcd

     cde

     def

     efg

so when i select an agency it should display me as Agency Selected in a text box

5 Replies
mov
Esteemed Contributor III

Re: Display Current selection in text box

If you use GetCurrentSelections(), you do not specify filed, it shows all fields selections.

For one field, use GetFieldSelections(Agency_Name)

MVP
MVP

Re: Display Current selection in text box

Do you want to append ' Selected' to the list of selected agencies?

Then use the string concatenation operator &:

=GetFieldSelections(Agency_Name) & ' Selected'

Not applicable

Re: Display Current selection in text box

you might also want to make sure that if there is no value selected the text does not appear.

another expression u could use

=if(isnull(getfieldselections(Agency_Name))<>-1, 'Agency Selected: ' & getfieldselections(Agency_Name))

Highlighted
Employee
Employee

Re: Display Current selection in text box

GetFieldSelections() will return a string that look like in the current selections object. This means that it will look like the actual search string, if your seleciton is search based. It will also turn into "9 of 152" format when you select multiple values and the seleciton string is too long to display.

If you want to show the actual selected or posible values in the text object, you need to use Concat() function instead.

=Concat(DISTINCT Agency_Name, ', ')

If you only want to show the values when there is a selection you need to find a logic for that.

=If(Len(GetFieldSelections(Agency_Name)), Concat(DISTINCT Agency_Name, ', '), '')

Employee
Employee

Re: Display Current selection in text box

You can replace


IsNull(GetFieldSelections(Agency_Name))<>-1


with


Not IsNull(GetFieldSelections(Agency_Name))