Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
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

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
MVP
MVP

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).