Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
sbeaty
Contributor II
Contributor II

multiple ORs in an expression

Hello. I'm having an issue with my expression. I'm trying to count any time that the status changes and the status type is either one of these status types. I don't know what I'm doing wrong here, says I'm missing a ) somewhere? Thanks for the help.

 

COUNT(DISTINCT if(StatusChanges > 0 AND (SP_StatusType = 'ONSITE' , OR SP_StatusType = 'TRIAGE', OR SP_StatusType = 'REPAIR IN PROGRESS', OR SP_StatusType ='LEAVING SITE',
OR SP_StatusType = 'PRODUCT SHIPPED'),SP_RFACallNumber))

/

Count(DISTINCT SP_RFACallNumber)

Labels (3)
1 Solution

Accepted Solutions
MayilVahanan

HI 

Try like below

COUNT(DISTINCT {< StatusChanges = {">0"}, SP_StatusType = {'ONSITE', 'TRIAGE', 'REPAIR IN PROGRESS', 'LEAVING SITE',  'PRODUCT SHIPPED'} >} SP_RFACallNumber)

Count(DISTINCT SP_RFACallNumber)

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.

View solution in original post

4 Replies
AshutoshBhumkar
Partner - Specialist
Partner - Specialist

Hi,

Commas between OR are the issue. I would suggest using wildmatch() function to compare strings if possible in your in expression.

 

Thanks,

Ashutosh

stevejoyce
Specialist II
Specialist II

Is StatusChanges a field in your data model, if not can you add it?  This is better done in set analysis:

 

COUNT(DISTINCT {< StatusChanges = {">0"}, SP_StatusType = {'ONSITE', 'TRIAGE', 'REPAIR IN PROGRESS', 'LEAVING SITE', 'PRODUCT SHIPPED'} >} SP_RFACallNumber)

/

Count(DISTINCT SP_RFACallNumber)

MayilVahanan

HI 

Try like below

COUNT(DISTINCT {< StatusChanges = {">0"}, SP_StatusType = {'ONSITE', 'TRIAGE', 'REPAIR IN PROGRESS', 'LEAVING SITE',  'PRODUCT SHIPPED'} >} SP_RFACallNumber)

Count(DISTINCT SP_RFACallNumber)

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
sbeaty
Contributor II
Contributor II
Author

Thank you 😊