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

How Do I Limit What is Displayed in a List Box?

Hi,

I have a table that contains user IDs and list names like:

User IDList Name
bob1list_one
sarah2list_two
gene3list_three

I have created button that selects the User ID of the person using the app and brings up a "List Name" list box, which I want to display only the lists for the selected user ID. I'm guessing this needs to be done via an expression on the list box itself, but I don't know how to write this. So, let's say my user ID is "bob1." Right now, when I click the button, the "List Name" list box comes up, the user ID "bob1" is selected, but the list box lists ALL list names instead of just "list_one." Can anyone tell me how to do that? Thanks so much!

-Kenny

1 Solution

Accepted Solutions
sunny_talwar

May be this as your list box expression

=Aggr(Only([List Name]), [List Name])


Capture.PNG

View solution in original post

6 Replies
sunny_talwar

May be this as your list box expression

=Aggr(Only([List Name]), [List Name])


Capture.PNG

Not applicable
Author

Hey Sunny, I think this will work...how would I rewrite it so that if "bob1" is deselected, then no list names show up. Would I just add some sort of null function somewhere? Thanks!

sunny_talwar

May be this:

=If(GetSelectedCount([User ID]) > 0, Aggr(Only([List Name]), [List Name]))

Capture.PNG

Mark_Little
Luminary
Luminary

Or change the the list box for UserID to always have one value selected?

Mark

Josh_Good
Employee
Employee

Hi Kenny,

The way I would do it is put all the names in to one field an then only show the listbox once a username is selected. This is done on the layout tab of the listbox properties.  Set the connditional show to:

GetSelectedCount([User ID]) = 1

I would also set that listbox to "Hide Excluded" on the General tab of the listbox properties.

See the attached QVW.

-Josh

Qlik

Not applicable
Author

Thanks for everyone's input. I actually used bits and pieces from multiple responses to come up with the best solution for my situation, so thanks to all!