Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

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
Partner Ambassador/MVP
Partner Ambassador/MVP

Have you tried the GetCurrentSelections() function?

-Rob

Anonymous
Not applicable
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

Anonymous
Not applicable
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 Ambassador
Partner Ambassador

Hi Rahul,

What about trying this;

Only(yourfieldname)

Wynand