parse error when changing attribute type from polynomial to date_time [SOLVED]

Sabrine
Sabrine New Altair Community Member
edited November 2024 in Community Q&A
hello everyone,
while importing a CSV file, RM did automatically set the type of a date-time attribute as a polynomial. The attribute has the following format: JJJJ.mm.dd hh:mmm:ss which is different from the date format of the data we used during RM training "Month day, year time". Changing the attribute type manually does not work and an error message " parsing error" is displayed for all examples of this attribute. Anyone can help?

Tagged:

Answers

  • Marco_Boeck
    Marco_Boeck New Altair Community Member
    Hi,

    what version of Studio are you using? 7.0 and later have the Date format in the top left corner during the "Format your columns" step while adding data. You can freely change the date format there to whatever you need.

    image

    Regards,
    Marco
  • Sabrine
    Sabrine New Altair Community Member
    Marco Boeck wrote:

    Hi,

    what version of Studio are you using? 7.0 and later have the Date format in the top left corner during the "Format your columns" step while adding data. You can freely change the date format there to whatever you need.

    image

    Regards,
    Marco
    Hi Marco,
    Thank you for your answer, I am using the 7.0 version and already tried all possible data formats in RM but none worked for this type JJJJ.mm.dd hh:mm:ss. What I did now is setting a costum date format in excel for the original data that is compatible with one of the formats in RM ( in this case JJJJ-MM-DD HH:MM:SS which was recognized by RM). It is not that much fun however to do it for 20 columns (especially if I find out during importing data that I have overseen a date column and then have to go back to the original excel data file and change the format there!). Is there a way to fix this directly in RM?
    Regards,
    Sabrine
  • Marco_Boeck
    Marco_Boeck New Altair Community Member
    Hi,

    yea changing the source data is definetly not the way you want to go ;D

    This works for me:

    1. Change the Data Format to "yyyy.MM.dd hh:mm:ss"
    2. Change the colum type to "date_time"

    image

    The test data I used can be found here: https://www.dropbox.com/s/ivrn8o70iie9f71/test.csv?dl=0

    Regards,
    Marco
  • MartinLiebig
    MartinLiebig
    Altair Employee
    By the way,

    you might also simply read it in as nominal and use Nominal To Date afterwards.

    ~Martin
  • Sabrine
    Sabrine New Altair Community Member
    Martin Schmitz wrote:

    By the way,

    you might also simply read it in as nominal and use Nominal To Date afterwards.

    ~Martin
    Martin Schmitz wrote:

    By the way,

    you might also simply read it in as nominal and use Nominal To Date afterwards.

    ~Martin
    Marco Boeck wrote:

    Hi,

    yea changing the source data is definetly not the way you want to go ;D

    This works for me:

    1. Change the Data Format to "yyyy.MM.dd hh:mm:ss"
    2. Change the colum type to "date_time"

    image

    The test data I used can be found here: https://www.dropbox.com/s/ivrn8o70iie9f71/test.csv?dl=0

    Regards,
    Marco
    Thank you marco this works! sorry that I didnt notice that a custom data format can be typed directly there ( thought I can only select from the list below!). By the way I just tried doing the same thing using the operator "nominal to date"  (same idea as Martin) and it works too, the only inconvenience is that no attribute subset selection is possible.
    Many thanks,
    sabrine
  • sofian_mesbahi
    sofian_mesbahi New Altair Community Member

    Trying to input this date_time: July 13, 2016 05:43 AM

    with this date format u provided here: yyyy.MM.dd hh:mm:ss

    And I still get parsing errors?

     

  • Thomas_Ott
    Thomas_Ott New Altair Community Member

    I'm an old school RM user, I don't use the "Add Data" button that much and go straight for the Read CSV or Read Excel operator and use that wizard.

     

    I find it much easier to do as @mschmitz notes, let the date values come in as a polynominals and then convert them with a Nominal to Date operator.

  • sofian_mesbahi
    sofian_mesbahi New Altair Community Member

    Alright thanks will do that! :smileyvery-happy: