Jump to content
  • 0

Contains instead of Equal in Case Statement


shaferam

Question

How would I edit this case in a calculated field to CONTAIN the word Ambulatory instead of EQUAL it?  Thanks!

CASE
WHEN [@field:RequirementType] = "Ambulatory" and [@field:Number_Of_Weeks] = 4 THEN 4
WHEN [@field:RequirementType] = "Ambulatory" and [@field:Number_Of_Weeks] = 2 THEN 2
END

 

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

Use LIKE

CASE
WHEN [@field:RequirementType] LIKE '%Ambulatory%' and [@field:Number_Of_Weeks] = 4 THEN 4
WHEN [@field:RequirementType] LIKE '%Ambulatory%' and [@field:Number_Of_Weeks] = 2 THEN 2
END

The % is wildcard that defines the position of the string  that you are looking for. Example : 'Ambulatory%' searches for values that starts with Ambulatory. '%Ambulatory' searches for values that ends with it. Adding it on both sides checks for the value in any position.

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...