An exclusive raffle opportunity for active members like you! Complete your profile, answer questions and get your first accepted badge to enter the raffle.
date_get([created_at],DATE_UNIT_WEEK, "de", "Europe/Berlin")
Hi,
I've a similar problem and tried to remedy it with the suggestion above, but it doesn't seem to work. I generated a variabel 'date' that is just a calander for the year 2010, and a variable week which has to indicate the week of the year. However, the first week starts at 26/12/2010 and not at 01/01/2010. I suppose this is because rapidminer starts weeks at sunday and 01/01/2010 is a friday, so week 2 starts at sunday 03/01/2010 and so on. Any idea how I can change so that the weeks start to count at 01/01/2010?
This is the XML:
<?xml version="1.0" encoding="UTF-8"?><process version="7.5.003"> <context> <input/> <output/> <macros/> </context> <operator activated="true" class="process" compatibility="7.5.003" expanded="true" name="Process"> <process expanded="true"> <operator activated="true" class="operator_toolbox:generate_univariate_series" compatibility="0.7.000" expanded="true" height="68" name="Generate Univariate Series" width="90" x="112" y="34"> <parameter key="data_type" value="DATE_TIME"/> <parameter key="attribute_name" value="date"/> <parameter key="startdate" value="2010-01-01 01:00:00"/> <parameter key="enddate" value="2010-12-31 01:00:00"/> <parameter key="intervaltype" value="DAY"/> </operator> <operator activated="true" class="generate_attributes" compatibility="7.5.003" expanded="true" height="82" name="Generate Attributes" width="90" x="246" y="34"> <list key="function_descriptions"> <parameter key="week" value="date_get(date, DATE_UNIT_WEEK, "be", "Europe/Brussels")"/> </list> </operator> <connect from_op="Generate Univariate Series" from_port="output" to_op="Generate Attributes" to_port="example set input"/> <connect from_op="Generate Attributes" from_port="example set output" to_port="result 1"/> <portSpacing port="source_input 1" spacing="0"/> <portSpacing port="sink_result 1" spacing="0"/> <portSpacing port="sink_result 2" spacing="0"/> </process> </operator></process>
hello @lghansse - ah yes, the old "week of the year" question. I was working on this last month. It's actually not an innocent question and has to do with when the 1st week of the year is defined. It's a LONG story but in short, you're going to have to do some manipulation to get the "week" attribute the way you want it. Here's some light reading on the topic:
https://en.wikipedia.org/wiki/ISO_week_date
http://www.staff.science.uu.nl/~gent0113/calendar/isocalendar.htm
Scott
Wow, never heard of it before, but thanks!