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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

OR operator in set analysis

I have created  the following set analysis to try and count the number of qualified leads based on three fields:

- Lead Score

- Pardot Score

- Lead Stage

count({< [Lead Stage] = {'MQL'}>}distinct([Lead ID])) + count({< [Lead Score] = {">=100"}>}distinct([Lead ID])) + count({< [Pardot Score] = {">=100"}>}distinct([Lead ID]))

Not all of the fields are in sync, so I want to count all of the qualified leads WITHOUT double counting (i.e a lead has a score > 100 and a lead stage = MQL). In SQL it would be something like, WHERE [Lead Stage] = 'MQL' OR [Lead Score] >= 100 OR [Pardot Score] >= 100 ... But the union in set analysis is definitely double counting records.

Any help is appreciated.

Thank you,

- dave

1 Solution

Accepted Solutions
sunny_talwar

Or just this:

Count({<[Lead ID] = {"=[Lead Stage] = 'MQL'  or [Lead Score] >=100 or [Pardot Score] >=100"}>} DISTINCT [Lead ID])

View solution in original post

4 Replies
vinieme12
Champion III
Champion III

try

count({< [Lead Stage] = {'MQL'}>+ <[Lead Score] = {">=100"}> + < [Pardot Score] = {">=100"}>}distinct([Lead ID]))

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
krishnacbe
Partner - Specialist III
Partner - Specialist III

Hi,

You can use below expression.

count({< [Lead Stage] = {'MQL'}>} + [Lead Score] = {">=100 + [Pardot Score] = {">=100"}>}distinct [Lead ID])

sunny_talwar

Or just this:

Count({<[Lead ID] = {"=[Lead Stage] = 'MQL'  or [Lead Score] >=100 or [Pardot Score] >=100"}>} DISTINCT [Lead ID])

Anonymous
Not applicable
Author

You did it again Sunny. Many thanks as always