Qlik Community

Ask a Question

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

cancel
Showing results for 
Search instead for 
Did you mean: 
zhe_heng
Contributor
Contributor

Conditional FIlter

School Name Programme Participated Date 
School A Programme 1 2017
School A Programme 2 2017
School A Programme 32017
School BProgramme 1 2017
School B Programme 2 2017
School CProgramme 1 2017
School CProgramme 3 2017
School DProgramme 1 2017

 

I would like to create a "Programme Filter" that allows me to filter by these conditions : 
a ) atleast participated in one programme
b) atleast participated in two programme 
c) participated in all programme

If i select option C from the filter, i would like it to apply filter on the "count of distinct school" . In this case , it should be only 1. 

If i select option B from the filter, i would like it to apply filter on the "count of distinct school". In this case, it should show  only 3.

Thanks in advance!

 

2 Replies
lironbaram
Partner
Partner

hi 

this should allow you to create the filter 

=aggr(if(count(distinct [Programme Participated])=count({1}total distinct [Programme Participated]) ,'All programs',
if(count(distinct [Programme Participated])>=2 ,'At least 2',
if(count(distinct [Programme Participated])>=1 ,'At least 1'))),[School Name])h

zhe_heng
Contributor
Contributor
Author

Hi Lironbaram,

Thanks for the quick response.

Do i just select the filter pane in edit mode, and key in this expression under data > dimension > Condition > field?
I tried keying in the expression, but i don't see any thing in the filter pane.

Do you mind explaining the expression?
'All Programs' , 'atleast 2' and 'atleast 1' are field that i will see in the drop down selection of the filter?