Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
Announcing the newest addition to the Qlik Community, Qlik Gallery! Learn More
Highlighted
rahulgaadhe
New 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

Re: Get Name of Selected Field

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')))

MVP & Luminary
MVP & Luminary

Re: Get Name of Selected Field

Have you tried the GetCurrentSelections() function?

-Rob

rahulgaadhe
New Contributor III

Re: Get Name of Selected Field

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
New Contributor III

Re: Get Name of Selected Field

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

Re: Get Name of Selected Field

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

Partner
Partner

Re: Get Name of Selected Field

Hi Rahul,

What about trying this;

Only(yourfieldname)

Wynand