Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
QlikWorld, June 24-25, 2020. Free virtual event for DI and DA gurus. Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
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
Highlighted
Creator II
Creator II

Re: Counting columns with 2 conditions

Try this

 

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

 

 

Highlighted
Contributor II
Contributor II

Re: Counting columns with 2 conditions

Nope, Doesn't work 😕

Highlighted
Creator II
Creator II

Re: Counting columns with 2 conditions

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 )

 

 

Highlighted
Contributor II
Contributor II

Re: Counting columns with 2 conditions

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

Highlighted
Creator II
Creator II

Re: Counting columns with 2 conditions

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?