Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
A_PR
Contributor III
Contributor III

GetFieldSelections not working

Hi All,

I'm trying to do a very simple task. I have a filter with user id and a text box with formula =GetFieldSelections(name)

I want the name to be displayed in the textbox but I'm not getting any result, its just blank.

Is this a bug? What should I do?

Labels (3)
2 Solutions

Accepted Solutions
Lisa_P
Employee
Employee

GetFieldSelections will only work on the field being selected (Green selection state). You can use the Concat function to find the matching UserName.

eg Concat(Distinct UserName, '  ')

View solution in original post

steeefan
Luminary
Luminary

This should work for you, given that your field names are the same:

'UserName: ' & If(GetSelectedCount(userid) > 0, CONCAT(DISTINCT username, ', '), 'none selected')

View solution in original post

8 Replies
Lisa_P
Employee
Employee

Not sure what you are expecting. Take a look at this ..

Lisa_P_0-1705960023328.png

Once you make selections it will look like this ..

Lisa_P_1-1705960078496.png

 

A_PR
Contributor III
Contributor III
Author

preeti1_0-1705961142223.png

@Lisa_P  - Thank you for your response. This is exactly what I'm looking for. PFA, I have selected some userid and I want username to be displayed. Formula in text box: 'UserName: '& GetFieldSelections(username)

A_PR
Contributor III
Contributor III
Author

Is there any step that I'm missing here? getfieldselections is not returning any result.

Lisa_P
Employee
Employee

GetFieldSelections will only work on the field being selected (Green selection state). You can use the Concat function to find the matching UserName.

eg Concat(Distinct UserName, '  ')

A_PR
Contributor III
Contributor III
Author

@Lisa_P Sorry I did not understand. Where should I write this formula?

Lisa_P
Employee
Employee

In the text object.

It may be simpler to show in a table. You could have a conditional function to only show the UserName column if there is selections in the userid field.

Qlik is case sensitive as well, so field names must match exactly in your expressions

A_PR
Contributor III
Contributor III
Author

@Lisa_P 

Got it. Thank you. Sorry I'm new to Qlik, can you help me with the formula to for this - if there is selections in the userid field.

steeefan
Luminary
Luminary

This should work for you, given that your field names are the same:

'UserName: ' & If(GetSelectedCount(userid) > 0, CONCAT(DISTINCT username, ', '), 'none selected')