Skip to main content

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
Qlik Cloud Maintenance is scheduled between March 27-30. Visit Qlik Cloud Status page for more details.
cancel
Showing results for 
Search instead for 
Did you mean: 
rahulgaadhe
Contributor III
Contributor III

Get Name of Selected Field

Dear Experts,

How do we get name of fields selected. For example there are three fields in application. Field1, Field2, Field3. Now I want to display in a text box what field is selected that is if Field2 is selected (any values in that field) then text box should show "Field2".

Any help in this regard is highly appreciated.

Regards,

RG

6 Replies
sunny_talwar

Will you only select in one of the three fields?

May be use like this

If(GetSelectedCount(Field1) > 0, 'Field1',

If(GetSelectedCount(Field1) > 0, 'Field2',

If(GetSelectedCount(Field1) > 0, 'Field3')))

rwunderlich

Have you tried the GetCurrentSelections() function?

-Rob

rahulgaadhe
Contributor III
Contributor III
Author

Hi Sunny,

Thanks for taking time to look into this question.

I can select n number of fields, so I cannot use GetSelectedCount function as the number of Fields selected is dynamic.

Please let me know your thoughts.

Regards,

RG

rahulgaadhe
Contributor III
Contributor III
Author

Hi Rob,

Thanks for taking time to look into this question.

If the number of fields to be selected is known than I can make use of GetCurrentSelection() function and try to get the field name using other functions like subfield, etc.. but the number of fields can be selected is dynamic i.e I can select n number of fields.

Please let me know your thoughts.

Your guidance is highly appreciated.

Regards,

RG

CELAMBARASAN
Partner - Champion
Partner - Champion

Hi Rahul

Using GetCurrentSelections, you can get the fields selected, but you have to write an expression get fields from that list.

check the below expression, it might works the way you expect

=Concat(SubField(ValueList($(=Chr(39)&GetCurrentSelections(chr(39)&','&chr(39),'=',',',0)&chr(39))), '=',1), ', ')

Celambarasan

wcilliers
Partner - Creator
Partner - Creator

Hi Rahul,

What about trying this;

Only(yourfieldname)

Wynand