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

Set Analysis - Wildmatch within Count Distinct

In my expression below "Set Analysis 1" works fine. I tried to modify slighly to add the wildmatch function to count only the distinct Benefit Package Codes that begin with HMO, Not sure what I am doing wrong but "Set Analysis 2" doesnt work.

Set Analysis 1:

count({$<[Group ID] = {'=COUNT(DISTINCT [Benefit Package Code]) > 1'}>} distinct([Group ID] ))

Set Analysis 2:

count({$<[Group ID] = {'=COUNT(DISTINCT wildmatch([Benefit Package Code],"HMO*")) > 1'}>} distinct([Group ID] ))

1 Solution

Accepted Solutions
Gysbert_Wassenaar

Try

count({$<[Group ID] = {'=COUNT({< [Benefit Package Code]={"HMO*"}>} DISTINCT [Benefit Package Code]) > 1'}>} distinct([Group ID] ))


talk is cheap, supply exceeds demand

View solution in original post

4 Replies
fdelacal
Specialist
Specialist

http://community.qlik.com/message/41176#41176

see this link,

i think it look something like this

count({$<[Group ID] = {'=COUNT(DISTINCT [Benefit Package Code]-={"HMO*"} > 1'}>} distinct([Group ID] ))

Gysbert_Wassenaar

Try

count({$<[Group ID] = {'=COUNT({< [Benefit Package Code]={"HMO*"}>} DISTINCT [Benefit Package Code]) > 1'}>} distinct([Group ID] ))


talk is cheap, supply exceeds demand
zagzebski
Creator
Creator
Author

This is returning what I expected. Thanks.

zagzebski
Creator
Creator
Author

I want to create a variable for the set analysis part of the expression because it is always changing. Would you be able to help with that syntax - what would go between the count and distinct?

count(

{$<[Group ID] = {'=COUNT({< [Benefit Package Code]={"HMO*"}>} DISTINCT [Benefit Package Code]) > 1'}>}

distinct([Group ID] ))