Filtering Out Letter Values, Leaving Numeric Values

Options

I have a field with letter and numeric values (ex. "John Doe" vs. "12345"). My goal is to filter to leave the numeric values and change the column type to Integer.

Does anyone have any ideas on how to do this in ETL? Trying to think of a Case when statement & filter option.

Best Answer

  • ColemenWilson
    Answer ✓
    Options

    You can use the REGEX_REPLACE() function. REGEXP_REPLACE(yourField, '[^0-9]+','')

    If I solved your problem, please select "yes" above

Answers

  • ColemenWilson
    Answer ✓
    Options

    You can use the REGEX_REPLACE() function. REGEXP_REPLACE(yourField, '[^0-9]+','')

    If I solved your problem, please select "yes" above

  • MarkSnodgrass
    Options

    For those that don't like to use REGEX, you can use this function to quickly remove non-numeric characters:

    STR_DIGITS(STR)Returns a new string consisting of only the digit characters in str in the order they appear.

    **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.