The Altair Community is migrating to a new platform to provide a better experience for you. In preparation for the migration, the Altair Community is on read-only mode from October 28 - November 6, 2024. Technical support via cases will continue to work as is. For any urgent requests from Students/Faculty members, please submit the form linked here
correct use of the date_get in the expression buillder
Hi, having looked at previous forum post on the topic i may have missed something.
I am trying to extract from a date-tim4 field(yyyy,MM,DD) , 3 new columns - Year, Month as a number , week number.
Previous posts show for instance the method as - date_get(Date, DATE_UNIT_YEAR,"Year") - I assume where Date is the column header. and "Year is the new Column holding the year data".
If someone could point me at the correct syntax I would appreciate it
Thanks
I am trying to extract from a date-tim4 field(yyyy,MM,DD) , 3 new columns - Year, Month as a number , week number.
Previous posts show for instance the method as - date_get(Date, DATE_UNIT_YEAR,"Year") - I assume where Date is the column header. and "Year is the new Column holding the year data".
If someone could point me at the correct syntax I would appreciate it
Thanks
0
Best Answer
-
MartinLiebig Administrator, Moderator, Employee-RapidMiner, RapidMiner Certified Analyst, RapidMiner Certified Expert, University Professor Posts: 3,533 RM Data ScientistHi,its just convention that the year starts at the 0th month in date_get. You can just add 1?Best,Martin- Sr. Director Data Solutions, Altair RapidMiner -
Dortmund, Germany0
Answers
Dortmund, Germany
The date format is yyyy-mm-dd no time. for instance, date is 2002-04-08, using expression builder adding:
Year date_get(Date,DATE_UNIT_Year,"CET")
Month date_get(Date,DATE_UNIT_MONTH,"CET")
Week date_get(Date,DATE_UNIT_WEEK,"CET")
The out put is Year = 2002, Month = 3 Week = 14
As we can see April should have returned as 4 and the week number should I believe have returned as 15.
In addition I have calendar month 0 for January which i dont think i have ever seen before, is this because RapidMiner is using a different base calendar format ?
Again any suggestions are welcome
Mark
Dortmund, Germany
Its hard to describe to a user that their financial spreadsheet data could end up being incorrect because the system uses a different time stamp to the CV data.
Dortmund, Germany
This represents concept of the count of weeks within the period of a year where the weeks are aligned to the start of the year. This field is typically used with ALIGNED_DAY_OF_WEEK_IN_YEAR.
For example, in a calendar systems with a seven day week, the first aligned-week-of-year starts on day-of-year 1, the second aligned-week starts on day-of-year 8, and so on. Thus, day-of-year values 1 to 7 are in aligned-week 1, while day-of-year values 8 to 14 are in aligned-week 2, and so on.
Calendar systems that do not have a seven day week should typically implement this field in the same way, but using the alternate week length.
Dortmund, Germany
What I meant is that using the get_date expression as the means to split a Date into its respective elements would leave a Month that is 1 behind ie January = 0. This has the potential to cause errors for users who are not Unix/Data Science professionals, especially where there are a number of team members supporting one workflow that might have multiple CSV inputs such as Finance/Procurement teams. Perhaps you can recommend a different workflow node that would negate this?
Regards
Mark