Checking if first character is a *-Beast mode

ozarkram
ozarkram Member
edited May 2022 in Magic ETL

Hi All,

I am trying to flag the rows that have the first character starting with a *...For ex: *SLD 05/11/2022 - I need to flag this 1 ..*SOLD 05/15/2022 -I need to flag this 1 ,1277489 STK#39298.32831 * -I need to flag this 0..can you please let me know how to do this..


Thanks,

Arun

Best Answer

  • MarkSnodgrass
    Answer ✓

    If you are only looking at the first character in a string you can use the LEFT function, like this:

     CASE WHEN LEFT(`orderstatus`,1) = '*' THEN 1 ELSE 0 END
    


    **Check out my Domo Tips & Tricks Videos

    **Make sure to <3 any users posts that helped you.
    **Please mark as accepted the ones who solved your issue.

Answers

  • MarkSnodgrass
    Answer ✓

    If you are only looking at the first character in a string you can use the LEFT function, like this:

     CASE WHEN LEFT(`orderstatus`,1) = '*' THEN 1 ELSE 0 END
    


    **Check out my Domo Tips & Tricks Videos

    **Make sure to <3 any users posts that helped you.
    **Please mark as accepted the ones who solved your issue.
  • Thanks @MarkSnodgrass !...Really appreciate your help!