Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
pascos88
Creator II
Creator II

Count distinct in set analysis

Good morning,

I need a select distinct in the set analysis.

my formula is

count({<lgn_username ={"=count distinct (lgn_username)>2"}>} CompanyName) but the result is zero.

if I do

count({<lgn_username ={"=count (lgn_username)>2"}>} CompanyName) without the distinct, give me a number... looks that the distinct insiede doesn't work..

Any Idee or someone can see the error in the expression ?

Thanks for any helps

1 Solution

Accepted Solutions
agigliotti
MVP
MVP

maybe this:

sum( aggr( if( count(distinct lgn_username ) > 2, 1, 0 ), CompanyName ) )

Hope it helps.

The Power of shining a light on the dark side of your data.
Follow me on my LinkedIn | Know Gamma Informatica at gammainformatica.it

View solution in original post

3 Replies
agigliotti
MVP
MVP

maybe this:

sum( aggr( if( count(distinct lgn_username ) > 2, 1, 0 ), CompanyName ) )

Hope it helps.

The Power of shining a light on the dark side of your data.
Follow me on my LinkedIn | Know Gamma Informatica at gammainformatica.it
petter
Partner - Champion III
Partner - Champion III

the keyword DISTINCT has to be put inside the aggregation function like this:

Count( { < lgn_username = { "=Count( DISTINCT lgn_username)>2"}>} CompanyName )


pascos88
Creator II
Creator II
Author

for some reason  doesn't work.

The result is 0.. btw thanks for your answer