You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register

How to replicate CASE statements

edited Sep 15, 2017 10:36AM in Reporting & Analytics for B2C Service 2 comments

Content

MY Query

select Source.LookupName as Source, Incident.CustomFields.c.telephone_call as Telephone ,COUNT(*) from Incident WHERE Incident.StatusWithType.Status.ID IN (2,103) GROUP BY Source.LookupName, Incident.CustomFields.c.telephone_call =1 order by Incident.CustomFields.c.telephone_call LIMIT 10000

This brings back

Incident Editor        23
Webchat    0    9259
Techmail - Service Mailbox    0    82
Contact Editor    0    123
Site Feedback    0    25
Incident Editor    0    12198
Feedback on Answers    0    166
Raise a Request    0    43981
Incident Editor    1    14774
Webchat    1    2

As you can see, Incident editor is brought back 3 times. Once where telephone = 1, once for telephone = 0 and one for blank

However, I want to combine 0 and null. I'd normally do this with a CASE statement but as they are not allowed, how would one achieve this in ROQL?

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!