Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Clean data to only Integers

Hello all

 

I have a data set that contains a mixture of integers and strings, all attempting to indicate a value (e.g 1, one, 01).

 

There are also some erroneous inputs, like e3.

 

What's the best practice for cleaning this data?

 

The data set is constantly updated, so I can't simply filter. I'm happy to mark the inavlid inputs as N/A but I need the data cleansed to only the Integers so I can run formulae. 

9 Replies

    • Anonymous's avatar
      Anonymous
      Not applicable

      Greg_Deckler

      Ideally I would like to convert the numbers as strings (written words) to integers without writing some huge IF statement that accounts for every number.

       

      If that's not possble though, then yes, I would simply remove all the errors.

      • Chihiro's avatar
        Chihiro
        Solution Sage

        May be something like...

        = try Number.From([Column]) otherwise 0
  • Anonymous's avatar
    Anonymous
    Not applicable

    In the query edior I duplicated the column, then changed the data type to Decimal Number, then used the "Replace Errors" function to make all the strings 0.

     

    It's a bit wanton so would like to hear any other approaches.