IF statement

I have several parts that I need to track. And I’m trying to sort it by material. So, I figured I can use and IF statement to see if a certain word is listed in the part description; especially since I only have four key words.

Trying to say, IF(PartDescription Match White,‘White Matte’,
IF(PartDescription Match Yellow, ‘Yellow Matte’
etc…

IS this construction accurate for Epicor or am I missing something?

You would use a Case statement:

case
    when this1 then that1
    when this2 then that2
    when this3 then that3
    else that4
end

How does that work with having to look at the description for a key word? Example: Description may be something like Special XXXXX-White Matte Fun Things. Would I use the match function to search in the description for what Ia m looking for?

when Part.PartDescription like '%White%' then 'White Matte'

1 Like

You might try something like this in your case statement:

case

when CHARINDEX(‘word1’, Column1) > 0 then …
when CHARINDEX(‘word2’, Column1) > 0 then …
else …

end

Disclaimer: I haven’t tried this in a BAQ.

Joe