Options

Getting parts of a date

SimonW18272SimonW18272 Member Posts: 13 Newbie
Hello together.

I got a question. When I want to create a new attribute I have the following problem.
I have a date which is in forma contaning month, day, year, time.
However I just want to extract the Month and the year so that the format is YYYY:MM

I found in the internet only the 

date_get(Att1,DATE_UNIT_MONTH)

Operator.

However I am now courious if it is easily possible to get also the year within this operator so that I have the YYYY:MM of the att1

My operator should look like
date_get(Att1,DATE_UNIT_YEAR_MONTH)
However it isnot possible this way.

Can someone help me to keep the date format (not nominal/...) and just the year and month in one attribut






Tagged:

Answers

  • Options
    BalazsBaranyBalazsBarany Administrator, Moderator, Employee, RapidMiner Certified Analyst, RapidMiner Certified Expert Posts: 955 Unicorn
    Hi!

    Year and month are two numerical attributes. How would you represent them in one numerical attribute?

    If you need them in one attribute, you need to convert them to a nominal attribute. The formula for that is date_str_custom(Att1, "yyyy:MM").

    Regards,
    Balázs
  • Options
    SimonW18272SimonW18272 Member Posts: 13 Newbie
    Thanks a lot! By adding the sort operator I can finally use this to see a monthly overview of my data :) Thanks a lot!!!
Sign In or Register to comment.