Let's Reconnect, thank you for making 2022 our best year yet.

Look Back
Can you use wildcards in a CASE statement? — Cloud Customer Connect
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

Can you use wildcards in a CASE statement?

Accepted answer
34
Views
6
Comments

Summary:

I have an analysis where if the Job Name is like 'abc%', '%hpr%', then I want to display certain text. Note that there are multiple wildcards, some only before, some only after and some both before and after the text. Is it possible to use wildcards in a CASE statement? The below example returns a general syntax error. I would appreciate your recommendations.

CASE WHEN "Workforce Management - Worker Assignment Real Time"."Job"."Job Name" IN ('DIRECTOR%', 'CORPORATE DIRECTOR%') THEN 'Director'       

 WHEN "Workforce Management - Worker Assignment Real Time"."Job"."Job Name" IN ('CHIEF%', '%VICE%', '%VP%' ) THEN 'Executive'       

Howdy, Stranger!

Log In

To view full details, sign in.

Register

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