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

Count, Distinct - need help

Hello,

I'm very new to Qlikview.  Can someone please explain what this mean in an expression used in one of

Pivot Chart that I'm trying to troubleshoot?

=Count( {$<Col1Flag={1}, Col2Flag={0}>}DISTINCT (Col3) )

Thank you

5 Replies
MK_QSL
MVP
MVP

=Count( {$<Col1Flag={1}, Col2Flag={0}>}DISTINCT (Col3) )


Count of Distinct Col3 with condition Col1Flag = 1 and Col2Flag = 0

Anonymous
Not applicable
Author

Hi Manish,

Got it.  Thanks for the help!

krishna_2644
Specialist III
Specialist III

this expression counts the number of distinct values in col3 where the its associated Col1Flag=1 and Col2Flag=0

eg:

col1flag, col2flag, col3

1,        1,        A

1,        0,        A

0,        1,        A

1,        0,        A

1,        1,        B

1,        0,        B

0,        1,        B

1,        0,        B

=Count( {$<Col1Flag={1}, Col2Flag={0}>}DISTINCT (Col3) ) expression gives a count value of 2


col1flag, col2flag, col3

1,        0,        A

1,        0,        B

if theres no disti9nct keyword i.e

=Count( {$<Col1Flag={1}, Col2Flag={0}>}(Col3) ) expression gives a count value of 4


col1flag, col2flag, col3

1,        0,        A

1,        0,        A

1,        0,        B

1,        0,        B


hope this helps.

Anonymous
Not applicable
Author

Great, thanks you!   Your sample really helps.

krishna_2644
Specialist III
Specialist III

Awesome. do you please mind closing the thread as answered if you got what you looking for.

Krishna