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

OR Condition in Set expression

Hi All,

I have below sample table, where count column display the count of Project if it is marked yes in MIL_1 or MIL_2 or both. I am using below Set expression for Count column.

(Count(distinct{<MIL_1={'Yes'}>}ProjectID) + Count(distinct{<MIL_2={'Yes'}>}ProjectID))

 

ProjectIDMIL_1MIL_2Count 
21Yes 1 
32Yes 1 
45YesYes21
32 Yes1 
56 Yes1 
67Yes 1 
89YesYes21

 

Above formula works well, if I have 'Yes' in any one of the column but not if 'Yes' present in both the columns.

Could you please tell help me on this.

 

Thanks in advance!

Gayatri

Labels (1)
2 Replies
tresesco
MVP
MVP

Try:

=Count(DISTINCT {<MIL_1={'Yes'}> + <MIL_2={'Yes'}>} ProjectID)

gayatri7
Creator II
Creator II
Author

Cool Thanks!

I just realized the same after posting question. Thanks for you reply!