Error when converting a String Column to Floating Decimal

I am trying to convert a string column to floating decimal, but I get the below error. How can I fix?

Best Answer

  • GrantSmith
    GrantSmith Coach
    Answer ✓

    You need to remove all non-numerical characters first.

    In a formula tile you can do something like this:

    REGEXP_REPLACE(`field`, '[^0-9.]', '')
    

    Then feed that into the Alter Columns tile

    **Was this post helpful? Click Agree or Like below**
    **Did this solve your problem? Accept it as a solution!**

Answers

  • GrantSmith
    GrantSmith Coach
    Answer ✓

    You need to remove all non-numerical characters first.

    In a formula tile you can do something like this:

    REGEXP_REPLACE(`field`, '[^0-9.]', '')
    

    Then feed that into the Alter Columns tile

    **Was this post helpful? Click Agree or Like below**
    **Did this solve your problem? Accept it as a solution!**
  • thank you!