Increment/Decrement Date Values
Use this task to increment or decrement a date or time column by any specified time unit.
Quickstart
Let us start with this data
Student | Registered On |
---|---|
Alice | 23-April-2012 |
Bob | 24-April-2012 |
Mike | 26-April-2012 |
Let us add 2-days to the date column. Complete the following steps:
- Go to Transform > Date Functions.
- Select the Increment/Decrement Date Values function.
- Choose the date type column whose values you want to increment or decrement. It is
Registered On
column in this case. - Choose
Add
option. - You can enter an arbitrary combination of years, months, weeks, days, hours, minutes and seconds. This will increment or decrement the entered number accordingly. To achieve the required results for above goal, enter
2
in the input box labeledDays
. - Provide a new column of type date, or choose an existing column of type date in which you want to see the resultant values. In this example, we want to create a new column. Give it a name ('New Date') in the
New column name
- Click APPLY
After the above steps are completed, the updated data set will look as shown below:
Student | Registered On | New Date |
---|---|---|
Alice | 23-April-2012 | 25-April-2012 |
Bob | 24-April-2012 | 26-April-2012 |
Mike | 26-April-2012 | 27-April-2012 |
Supported Options
This tasks takes the following inputs:
- Date Column: The column which contains date values that are to be added to or subtracted from.
- Add/Subtract: Configure addition/subtraction. The time delta value can be configured.
- Apply result into: This option allows configuration of the destination of the results by this task. See result documentation.