Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

mattb79
New Contributor

Filter list box values based on current selection

In this scenario lets say I have a source table with company and employee names...

 

CompanyEmployee
Company ASteve 
Company ADave
Company AAngela
Company BJennifer
Company BMichael
Company BCarl

 

I am implementing a filter for both Company and Employee. I want the user to only be able to select one company at a time,  but they can select any number of employees for that given company. I've already used the following to limit the user to one selection for company (although admittedly I simply found this solution online and don't fully understand the logic):

=Aggr(if(GetSelectedCount([Company])=0,[Company],Aggr([Company],[Company])),[Company])

This leads to the intended behavior of limiting the user to a single selection and the Employee list is properly filtered with the names of employees not associated with the selected company being grayed out. However, this assumes that the user will first select a company and then an employee.

I want to give the user the option to by-pass the company filter and select employees directly. So if the user were to select 'Jennifer' without having first selected a Company, the Employee list would still filter based on the current  Employee selection so that only other Company B employees can be selected, with Company A employees now grayed out. Is there a way to achieve this behavior? 

Labels (2)