Beast Mode to remove text after space

ozarkram
ozarkram Member
edited July 2022 in Magic ETL

Hi All,

I am trying to remove the text after space from the below example ..Can you please let me know how to do the same..

R17245 20 should return just R17245

FG789 32 should return just FG789...


Can you please let me know how to achieve this in beast mode..

Comments

  • @ozarkram I know you can use split_part or squash_whitespace in the formula tile of an ETL

    **If this answer solved your problem be sure to like it and accept it as a solution!

  • mhouston
    mhouston Contributor

    @ozarkram you can do this using the instr() and left() functions. You use instr() to find the first space, and then use left to take everything to the left of that index.

    The formula looks like this:

    left(fieldname,INSTR(fieldname,' ')-1)

  • Thank you so much @mhouston!..Really appreciate your help!