You are viewing the RapidMiner Studio documentation for version 9.6 - Check here for latest version
Adjust Date (RapidMiner Studio Core)
SynopsisThis operator adjusts the date in the specified attribute by adding or subtracting the specified amount of time.
The Adjust Date operator adjusts the values of the specified date attribute by adding or subtracting constant values. Year, month, day, hour, minute, second and millisecond adjustments are allowed. Multiple adjustments can be made to a single attribute. For example, you can add a month and subtract 2 hours from an attribute. If the keep old attribute parameter is set to true, the old attribute will be kept along with the adjusted attribute. Otherwise, the adjusted attribute will replace the previous attribute.
- example set input (IOObject)
This input port expects an ExampleSet. It is the output of the Subprocess operator in the attached Example Process. The output of other operators can also be used as input. The ExampleSet should have at least one date/time attribute because if there is no such attribute, the use of this operator does not make sense.
- example set output (IOObject)
The values of the selected date attribute are adjusted and the resultant ExampleSet is delivered through this port.
- original (IOObject)
The ExampleSet that was given as input is passed without changing to the output through this port. This is usually used to reuse the same ExampleSet in further operators or to view the ExampleSet in the Results Workspace.
- attribute_nameThis parameter specifies the name of the date attribute which should be adjusted. Range: string
- adjustmentsThis parameter defines the list of all date adjustments. Multiple adjustments can be made to a single attribute. For example, you can add a month and subtract 2 hours from the selected attribute. Range: list
- keep_old_attributeThis parameter indicates if the original date attribute should be kept. If this parameter is set to true, the old attribute will be kept along with the adjusted attribute. Otherwise, the adjusted attribute will replace the previous attribute. Range: boolean
Making multiple adjustments in a date attribute
This Example Process starts with the Subprocess operator. The operator chain inside the Subprocess operator generates an ExampleSet for this process. The explanation of this inner chain of operators is not relevant here. A breakpoint is inserted here so that you can have a look at the ExampleSet. You can see that this ExampleSet has a date attribute named 'deadline_date'. The Adjust Date operator is applied on this ExampleSet to adjust this date attribute. Two adjustments are made to this attribute. 1) 5 days are added 2) 2 months are subtracted. Run the process and compare the resultant ExampleSet with the original ExampleSet. You can clearly see that the date values have been adjusted. For example, the date value 20-August has been changed to 25-June after addition of 5 days and subtraction of two months.