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: 
50ShadesOfSalty
Partner - Contributor III
Partner - Contributor III

OR between two expressions

Good morning everyone,

 

I have two expressions (from different data sources):

  • One counts the number of Sessions
    • Sum([Sessions Counter])
  • Other onecounts the number of Interactions
    • Sum([Interactions Counter])

 

A session is linked to a client (consider, Client ID), as well as a Interaction.

This is where both expressions share the same attribute, Client. 

 

I want to retrieve the unique number of Clients (Client ID) that had either a Session done OR a Interaction done.

 

Can someone help me?

 

Thank you!

 

1 Solution

Accepted Solutions
jwjackso
Specialist III
Specialist III

Try checking if the client has non-null counters

Count({<[Client ID]=P({<[Sessions Counter]={"*"}>}[Client ID])+P({<[Interactions Counter]={"*"}>}[Client ID])>}Distinct [Client ID])

View solution in original post

3 Replies
GaryGiles
Specialist
Specialist

We can union 2 sets in set analsysi by using < >+< >.  One set will contain rows where [Sessions Count] is not missing -={} and the other where [Interactions Counter] is not missing:

count($<[Sessions Count]-={}>+<[Interactions Counter]-={}>} Distinct [Client ID])

jwjackso
Specialist III
Specialist III

Try checking if the client has non-null counters

Count({<[Client ID]=P({<[Sessions Counter]={"*"}>}[Client ID])+P({<[Interactions Counter]={"*"}>}[Client ID])>}Distinct [Client ID])

50ShadesOfSalty
Partner - Contributor III
Partner - Contributor III
Author

Thank everyone for the answers, i really apreciate it!

 

For me, the answer from Jwjackso did the trick! Completely forgot about the possibility of p() in here!

 

Thank you!