Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How do I limit the items displayed in a list box ?


Dear All,

On my dashboard I have a container object comprising two pivot tables: one showing sales information for Manchester, and the other showing sales info for London. I also have a list box called SalesPerson.

When I select the Manchester pivot table I only want to display Manchester salespersons in the list box. Similarly, if I click on the London pivot table object, I want to see ONLY London sales persons in the listbox (not Manchester's).

To help you, each Salesperson has a field called Sales_Location associated with it.

How do I code for this ? And where ?

Thanks

MV

PS This is not a Hide Excluded solution.

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Thinking about this again what you would need to do is have a text object(s) used as a button which hides the pivot table AND the list box.

Firstly set up a variable (go to Settings > Variable Overview > Add the add a new variable called vLocation (for example). You don't need to define it.

You could have two text objects, one with the text 'Manchester' and the other with the text 'London'.  In the Manchester text object properties go to the Actions tab then click Add.  Choose Action Type 'External' and Action 'Set Variable' then click OK.  In the Variable box put vLocation then in the Value box put Manchester.  Do the same thing for the London text object but with London as the variable value.

In the pivot table and list box properties in the Layout tab in the Show section click on conditional and type vLocation='Manchester' (or 'London') for the relevant chart/list box.  When you click on the text object its sets the variable to whichever location and shows the right sheet and hides the other.  You can also change the colour of the text object based on the variable if you want to show which button is clicked or not.

View solution in original post

14 Replies
MK_QSL
MVP
MVP

Use a SalesPerson List box with expression as below

Aggr(SalesPerson,SalesPerson)

Anonymous
Not applicable
Author

Maybe load separate lists for London and Manchester salespersons and put a trigger on the pivot tables to show/hide relevant list boxes

Not applicable
Author

Hi,

This doesn't work. It just creates two columns of identical items of salespersons in the list box.

Not applicable
Author

Yes, that seems a more promising solution. Would you load separate QV tables in the script ? And create two distinct list box objects ?

How could you 'trigger' the show/hide of the listboxes ?

Anonymous
Not applicable
Author

Thinking about this again what you would need to do is have a text object(s) used as a button which hides the pivot table AND the list box.

Firstly set up a variable (go to Settings > Variable Overview > Add the add a new variable called vLocation (for example). You don't need to define it.

You could have two text objects, one with the text 'Manchester' and the other with the text 'London'.  In the Manchester text object properties go to the Actions tab then click Add.  Choose Action Type 'External' and Action 'Set Variable' then click OK.  In the Variable box put vLocation then in the Value box put Manchester.  Do the same thing for the London text object but with London as the variable value.

In the pivot table and list box properties in the Layout tab in the Show section click on conditional and type vLocation='Manchester' (or 'London') for the relevant chart/list box.  When you click on the text object its sets the variable to whichever location and shows the right sheet and hides the other.  You can also change the colour of the text object based on the variable if you want to show which button is clicked or not.

IAMDV
Luminary Alumni
Luminary Alumni

Hi Maureen,

See the attachment and see if this approach helps?

Cheers,

DV

www.QlikShare.com

Not applicable
Author

Oh yes ! That works. Thank you for a good idea and explaining it very clearly.

Regards

MV

Anonymous
Not applicable
Author

You're welcome!

Not applicable
Author

One final thing. How do you change the background colour of the text object depending on the variable ?