Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
amien
Specialist
Specialist

field from listbox in variable

is it possible to read the field which is used in the listbox into a variable?

Having alot of listboxes in the dashboard.

I created an excel with all the fields and a flag. This flag represents show or do not show.

Now i want to use this flag in the Show Condition feature in the listbox.

Only({<AdvancedField = {FieldName}>}  AdvancedFlag) = 1

I want to replace "FieldName" with the current field in the listbox, in order to have the same line in each listbox.

Is this possible, or does someone have a better solution?

1 Solution

Accepted Solutions
swuehl
MVP
MVP

Try

=Only({<AdvancedField = {'$(=GetObjectField (0))'}>} AdvancedFlag) = 1

View solution in original post

8 Replies
sunny_talwar

May be this:

Only({<AdvancedField = p(ListBoxFieldNameHere)>}  AdvancedFlag) = 1

amien
Specialist
Specialist
Author

"ListBoxFieldNameHere"

QlikView should read this from the current object. I don''t want to fill in the listboxname here manually.

Only({<AdvancedField = {$(vCurrentListBoxField}}>}  AdvancedFlag) = 1

How can i fill vCurrentListBoxField

MayilVahanan

Hi

Are you looking like this

SubField(GetCurrentSelections(),':', 1)

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
sunny_talwar

Well what I am saying is that the fieldname you want to pick from is fixed, right? You just need to add that between p()

Only({<AdvancedField = p(ListBoxFieldNameHere)>}  AdvancedFlag) = 1

swuehl
MVP
MVP

Try

=Only({<AdvancedField = {'$(=GetObjectField (0))'}>} AdvancedFlag) = 1

amien
Specialist
Specialist
Author

For some reason .. when i past this in the title .. it works. It will show a 0 or 1

But when i use this in Show Condition, it does nothing

amien
Specialist
Specialist
Author

My bad .. i needed to add an additional condition. It works

Thanks

swuehl
MVP
MVP

Seems to work for me, using a limited setting (basically just checking if GetObjectField() gets evaluated in the show condition).

Could you upload a small sample QVW with your setting?