Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
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?