AND in case statement

Reply
Highlighted
Yellow Belt

AND in case statement

Can I create a Case statement that includes a two-factor condition? Ex: Case when `City`='Springfield' AND `State`='Illinois' then [etc.]


Accepted Solutions
Highlighted
Major Brown Belt

Re: AND in case statement

if you're 'GL Amount' column is a numeric field, it may not like the ELSE statement of ''. you might have to replace it with a number or a null. You can also not declare an Else value by just removing the  Else '' part.

 

 

(CASE when `G/L Description`='Marketing Projects' AND `PROJECT Description` LIKE 'Whirl%'
then `GL Amount`
end)

Domo Arigato!

**Say 'Thanks' by clicking the thumbs up in the post that helped you.
**Please mark the post that solves your problem as 'Accepted Solution'

View solution in original post


All Replies
Highlighted
Major Brown Belt

Re: AND in case statement

Yes in beast mode and your syntax up to 'Then' looks right

Domo Arigato!

**Say 'Thanks' by clicking the thumbs up in the post that helped you.
**Please mark the post that solves your problem as 'Accepted Solution'
Highlighted
Yellow Belt

Re: AND in case statement

So it could be a trip-up with my LIKE portion. Here's the actual Beast Mode that isn't validating: (CASE when `G/L Description`='Marketing Projects' AND `PROJECT Description` LIKE 'Whirl%'
then `GL Amount`
else ''
end)

Highlighted
Major Brown Belt

Re: AND in case statement

if you're 'GL Amount' column is a numeric field, it may not like the ELSE statement of ''. you might have to replace it with a number or a null. You can also not declare an Else value by just removing the  Else '' part.

 

 

(CASE when `G/L Description`='Marketing Projects' AND `PROJECT Description` LIKE 'Whirl%'
then `GL Amount`
end)

Domo Arigato!

**Say 'Thanks' by clicking the thumbs up in the post that helped you.
**Please mark the post that solves your problem as 'Accepted Solution'

View solution in original post

Announcements
Coming Soon: Weekly Virtual User Meet-ups to answer all your questions! Stay tuned for more details to come this week.