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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
abhi1693r
Contributor II
Contributor II

Counting columns with 2 conditions

I am trying something like 

=(Count( DISTINCT {<A={"SD"}>}{<B={"TD"}>} A&'|'&B))

A and B are in different tables joined by LEFT JOIN

And I noticed that only A=SD condition is applying but B=TD is NOT.

Is there a way to implement both conditions together with 'OR' logical operator??

5 Replies
Ezirraffner
Creator II
Creator II

Try this

 

=Count(  {<A={"SD"}>+<B={"TD"}>}  DISTINCT A&'|'&B )

 

 

abhi1693r
Contributor II
Contributor II
Author

Nope, Doesn't work 😕

Ezirraffner
Creator II
Creator II

Represent the current selection:

 

=Count(  {<A={"SD"}>+<B={"TD"}>}  DISTINCT A&'|'&B )

 

 

Represent the full set of data associated :

 

 

=Count(  {1<A={"SD"}>+1<B={"TD"}>}  DISTINCT A&'|'&B )

 

 

abhi1693r
Contributor II
Contributor II
Author

Can I use it like this,

 

=concat({<A={"SD"}>+<B={"TD"}>}  DISTINCT A) &'|'& concat(B)

and now count it somehow.

 

I am not familiar with how to count concatenated string.

But this should work right?

PS: Please correct the syntax if req

Ezirraffner
Creator II
Creator II

Concat function returns the aggregated string concatenation of all values of the expression iterated over a number of records as defined by a group by clause.

Could you upload a sample that expected result?