Forum Discussion

CiceroBC's avatar
CiceroBC
Advocate II
7 years ago
Solved

Number.FromText decimal issue

I'm having some difficulty with a custom column related to weather data.  I've successfully extracted values for precipitation to segregate actual numbers from an annoying "T" for "trace amount", but...
  • CiceroBC's avatar
    CiceroBC
    7 years ago

    Hi Yuliana,
    I'm happy to report that I've resolved my issue. The root problem was an incorrect field reference where
    #"Added Custom1" = Table.AddColumn(#"Changed Type3", "SNOW Number", each try Number.FromText([DEPTH])) 
    should have been

    #"Added Custom1" = Table.AddColumn(#"Changed Type3", "SNOW Number", each try Number.FromText([SNOW])) 

    Even though my issue is fixed, here are answers to your questions. This may be something other users would find valuable.

    • What does "T" refer to and what does "M" refer to in actual data values? "T" = "trace amount", "M" = "missing data"
    • What is your Data Source? Weather Data pulled from https://w2.weather.gov/climate/index.php (sample data below)
    • How did you connect to data source? Custom web scrape/ETL process for interpreting data from weather site. FYI - values "T" and "M" are part of the source data, not an artifact of ETL.
    • What is the data type of the weather data [PRECIPITATION] and [DEPTH]? Open text (txt/csv) from web scraper.  No data type designated.

    Sample Data:

    DATA_SOURCEDATEMAX_TEMPMIN_TEMPAVERAGE_TEMP PRECIPITATIONSNOWDEPTH
    NOAA CF6 Weather Data11/16/20136241520.87    M    M
    NOAA CF6 Weather Data11/17/20135938490.59    M    M
    NOAA CF6 Weather Data11/18/2013483140000
    NOAA CF6 Weather Data11/19/2013563345000
    NOAA CF6 Weather Data11/20/20134837430.0800
    NOAA CF6 Weather Data11/21/20134027340.10.60
    NOAA CF6 Weather Data11/22/20132717220.020.41
    NOAA CF6 Weather Data11/23/20132071400    T
    NOAA CF6 Weather Data11/24/201328517    T    T    T
    NOAA CF6 Weather Data11/25/2013392633    T    T    T
    NOAA CF6 Weather Data11/26/201331182500    T
    NOAA CF6 Weather Data11/27/2013236150    M    M
    NOAA CF6 Weather Data11/28/20133214230    M    M
    NOAA CF6 Weather Data11/29/2013359220    M    M
    NOAA CF6 Weather Data11/30/20134827380    M    M