How to get particulars from date?

pantangi_shekarpantangi_shekar Member Posts: 9 Contributor I
edited December 2018 in Help

Hello all,

 

How can I extract details from the date format?

 

For example,

If I have the date as JAN 1 2017

 

I would like to generate 3 attributes like this

month    Date     Year

Jan         1           2017

 

Thanks in advance.

 

Best,

Raj.

Best Answer

  • Edin_KlapicEdin_Klapic Moderator, Employee, RMResearcher, Member Posts: 299 RM Data Scientist
    Solution Accepted

    Hi,

     

    RapidMiner has multiple ways to get your solution.

    I suggest using Generate Attributes but instead of date_get you could use date_str_custom which converts your date to a string.

    I would recommend this solution because it allows you to format the desired output in the way you want (e.g. language / abbreviations [Mon vs. Monday] / ...). This way you are also able to extract the weekday of this day!

    A help on the parameters / variables representing which portion of the date can be found in the Help of the Operator "Nominal to Date".

     

    Best,

    Edin

Answers

  • Thomas_OttThomas_Ott RapidMiner Certified Analyst, RapidMiner Certified Expert, Member Posts: 1,761 Unicorn

    I would convert those to Nominal values first and then use the Split operator. 

  • MartinLiebigMartinLiebig Administrator, Moderator, Employee, RapidMiner Certified Analyst, RapidMiner Certified Expert, University Professor Posts: 3,503 RM Data Scientist

    I would go for date_get in GenerateAttributes.

     

    Best,

    Martin

    - Sr. Director Data Solutions, Altair RapidMiner -
    Dortmund, Germany
  • Telcontar120Telcontar120 Moderator, RapidMiner Certified Analyst, RapidMiner Certified Expert, Member Posts: 1,635 Unicorn

    Another option would be to use Date to Numerical, which allows you to extract any portion of the date relative to most other portions (e.g., day of the week, day of the month, month of the year, etc.) but the resulting data is numerical rather than nominal in format.  But you could then use Map to convert to whatever nominal values you want.

    Brian T.
    Lindon Ventures 
    Data Science Consulting from Certified RapidMiner Experts
Sign In or Register to comment.