Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
ashishpalkar
Creator III
Creator III

GetFieldSelections() - show selected values in list box/table

Hi There

I am using GetFieldSelections(), and it given me output like

what I want to achieve is , the values selected from GetFieldSelections() should show in a list box where I can select / un-select. like below

Thanks in advance..

20 Replies
sunny_talwar

You can specify its third parameter so that it doesn't group things:

Capture.PNG

Something like this:

=GetFieldSelections(Year, ',', 100000)

ashishpalkar
Creator III
Creator III
Author

Thanks Sunny, but this doesn't helped...

sunny_talwar

You want to make selection and use that selection to create another list box for selection? I don't understand the point of this?

ashishpalkar
Creator III
Creator III
Author

yes, this is a requirement. I have around 500+ attributes.

ashishpalkar
Creator III
Creator III
Author

Hi There

Does anyone knows better workaround for this?

Not applicable

You can try creating a straight table.  It won't be exactly per your requirements but might work

Dimension - Year

Expression - 1

    -Hide the expression column

Suppress header row

Create conditional show in layout tab - GetSelectedCount(Year)

See attached

stigchel
Partner - Master
Partner - Master

You can use a listbox with an expression instead of an field (on the bottom of the field list choose <expression>) and for expression like

=Aggr(Only(Year),Year)

This will display only the selected years

Not applicable

You can try Aggr( Year ,Year) to discard the excluded values from List box

or

GetFieldSelections have 3rd parameter to show how many values.

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

Returns a string with the current selections in a field.

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.

Examples

getfieldselections ( Year )

getfieldselections ( Year, '; ' )

getfieldselections ( Year, '; ' , 10 )

Not applicable

Try perhaps

=aggr(only(Datum),Datum)

as a Expression for your listbox. If nothing is selected all values are shown, but otherwise it fullfills your requirement. So add a if like:

=if(GetSelectedCount(Datum)>0,aggr(only(Datum),Datum))

(my field names come from my test application)

Hope I could help