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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Count problem

Hi Folks,

I have a question where not sure how to get the result and need your help !

Result should be  3

data :

A    B    C  D                      should be counted

1  1    1    9                            No (A=1)

2  1    1    8                            Yes

2  1    1    7                            No (duplicate from last row,  B=1 C=1 )

2  2    1    6                            Yes

2  1   2    5                            Yes

Criteria

Count only  "once for  B  within  same C" and A =2

Thx in advanced gurus    

1 Solution

Accepted Solutions
sunny_talwar

May be this:

=Count(DISTINCT {<A = {'2'}>} B&C)

View solution in original post

4 Replies
sunny_talwar

May be this:

=Count(DISTINCT {<A = {'2'}>} B&C)

sunny_talwar

Attaching the sample qvw with a screenshot:

Capture.PNG

Not applicable
Author

Hi Sunny,

thx, man.  It works.

Can you share more   on  B&C  . ?  what does it do actually   ?

thx Sunny

sunny_talwar

B&C is just concatenating the values for each row for Column B&C and doing a DISTINCT count of B&C

data :

A    B    C  D    B&C                  should be counted

1  1    1    9       11                     No (A=1)

2  1    1    8       11                    Yes

2  1    1    7       11                     No (duplicate from last row,  B=1 C=1 )

2  2    1    6       21                     Yes

2  1   2    5        12

HTH

Best,

Sunny