Qlik Community

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
Customer & Partners, DEC. 9, 11 AM ET: Qlik Product & Strategy Roadmap Session: Data Analytics REGISTER 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

View solution in original post

4 Replies
AshutoshBhumkar
Partner
Partner

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
Creator III
Creator III

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

View solution in original post

sbeaty
Contributor II
Contributor II
Author

Thank you 😊