4 Replies Latest reply: May 24, 2013 10:06 AM by Steve Zagzebski

# 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] ))

• ###### Re: Set Analysis - Wildmatch within Count Distinct

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

i think it look something like this

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

• ###### Re: Set Analysis - Wildmatch within Count Distinct

Try

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

• ###### Re: Set Analysis - Wildmatch within Count Distinct

This is returning what I expected. Thanks.

• ###### Re: Set Analysis - Wildmatch within Count Distinct

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] ))