Home Data Prep Q&A


Big News: we’ve moved to the DataRobot Community! Please keep your eye out for an email invitation to join us there. Refer to the We've Moved FAQ for a guide on how to use your existing Paxata Community account to login to our new home.

Visit the official Paxata Documentation portal for all of your doc needs.

Dateformat

nealneal Posts: 2
edited June 4, 2020 8:07PM in Data Prep Q&A
I have a date column that I would like to change into a abbreviated month. I have the date as 05-05-2020, which is formatted into date. The formula I am using for my new column is  DATEFORMAT(@[email protected] , "MMM") and I am receiving the error "Expected (Date, String) got (String, String). Is this an issue with the data format or is the formula incorrect?

Answers

  • sayyarsayyar Posts: 25 admin
    @neal The error tells me that the column, POSTED_DATE, on which you're performing the DateFormat operation is a String. Please use the "Convert to date" option on the column to convert the String column to a Date and subsequently perform the DateFormat operation. 

    Alternatively, you can modify the computed column expression/formula to the below to perform the date conversion and month extraction in one step.

    DATEFORMAT(DATEVALUE(@[email protected], "MM-dd-yyyy"), "MMM")

    Please let me know if this helps. 

    Regards,
    Shyam Ayyar
    Product Manager
Sign In or Register to comment.