Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
user467341
Creator II
Creator II

Get all the values from the first filter pane and pass it as a variable in set expression

Hi Qlik Community,

If I have a filter pane below:

 

Department

----------------

Supermarket

Bank

Restaurant

 

And I have a set expression below:

Aggr(Only({$<[Centre_Dept]={XXXXX}>} EmployeeID), EmployeeID)

I will need to replace the XXXXX with the values from the above filter pane (with no selection from user so GetFieldSelections is an option).

Is this possible?

The end result, if I hard code will be this 

Aggr(Only({$<[Centre_Dept]={'Supermarket','Bank','Restaurant'}>} EmployeeID), EmployeeID)

I am looking for something that is dynamic without the need of hard coding.

Thanks 🙂

Labels (5)
1 Reply
SerhanKaraer
Creator III
Creator III

Hi,

 

Yes, it is possible.

Either you can set possible values explicitly stated in set expression values as: Aggr(Only({$<[Centre_Dept]={$(=Concat(DISTINCT chr(39) & Department & chr(39), ','))}>} EmployeeID), EmployeeID)

.. or you can set possible values implicitly with P function as: Aggr(Only({$<[Centre_Dept]=P(Department)>} EmployeeID), EmployeeID)

 

I hope it helps.