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
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
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'
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)

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
Check out these great solution videos! The new iSolveditWithDomoboard is live, share yours and earn higher rankings in Dojo click here!