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

Count distinct on a few subsets of data in expression

Hi,

I need to write an expression that counts distinct Order IDs but the expression contains a few data subsets, something like:

=Count({<some set analysis>}distinct Order ID)

+

Count({<some set analysis>}distinct Order ID)

+

Count({<some set analysis>}distinct Order ID)


Lets say the first expression returns 20 orders, the second one returns 10 orders and the third one returns 5 orders.

8 orders from the second expression are the same as in first one, so I need to count these 8 orders only once and not twice so at the end the result is supposed to be not 35 but 27.

1 Solution

Accepted Solutions
swuehl
MVP
MVP

Maybe create a union of your sets:

=Count({<some set analysis>+<your second set>+<your third set>} distinct Order ID)

View solution in original post

2 Replies
swuehl
MVP
MVP

Maybe create a union of your sets:

=Count({<some set analysis>+<your second set>+<your third set>} distinct Order ID)

linoyel
Specialist
Specialist
Author

Hi Stefan, thanks, interesting, I'll try that!