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: 
Anonymous
Not applicable

Multiple Conditions on 'OR' Set Analysis

Hello All,

TicketIdTypeProductId
1Accepted Lead2
2Accepted Lead3
3Accepted Lead5
4Rejected Lead5
5Instructed Lead2
6Instructed Lead5

I have the following Set Analaysis which is counting where TicketId is Type 'Accepted Lead' OR 'Instructed Lead':

Count({$<Type={'Accepted Lead'}>+<Type={'Instructed Lead'}>}TicketId)

I need to include another condition, something like:

Count({$<Type={'Accepted Lead'}>+<(Type={'Instructed Lead'},ProductId -= {'5'})>}TicketId)

But whatever I try doesnt seem to count anything!

Essentially, I need to count the TicketId's where Type =  'Accepted Lead' OR ( 'Instructed Lead' AND ProductId<> 5)

Any help would be greatly appreciated.

Thanks

Labels (1)
6 Replies
rajni_batra
Specialist
Specialist

i tried expression same as urs n getting output 4, can u plz check is it right or not?

swuehl
Champion III
Champion III

Try removing the paranthesis () in your second set modifier:

=Count({$<Type={'Accepted Lead'}>+<Type={'Instructed Lead'},ProductId -= {'2'}>}TicketId)

Not applicable
Author

The expression below, I would solve like the Qlikview expression further below

Essentially, I need to count the TicketId's where Type =  'Accepted Lead' OR ( 'Instructed Lead' AND ProductId<> 5)

=Count(

{$

<Type={'Accepted Lead'}>

+

<Type={'Instructed Lead'},

ProductId -={5}

>

}TicketId)

(I updated it a bit, since I realised that ProductId should be excluded only when it is an instructed lead).

Anonymous
Not applicable
Author

try something like below..

Count({$<Type={"Accepted Lead","Instructed Lead"},ProductId = ProductId - {"5"})>}TicketId)

hope that helps..

Anonymous
Not applicable
Author

Try this One:

=Count({$<Type={'Accepted Lead'}>+<Type={'Instructed Lead'},ProductId-={'5'}>}TicketId)

shraddhawalekar
Partner - Contributor II
Partner - Contributor II

Use exclude function,it will help

=Count({<Type={'Accepted Lead'}> + <Type={'Instructed Lead'},ProductId =e({<ProductId={5}>})>}TicketId).