addMonth function
The addMonth function adds a given number of months to a date attribute.
Parameters
addMonth(date, nmonth)
Parameter | Description |
---|---|
date | The date attribute we want to add months to. The date parameter is mandatory. |
nmonth | The number of months to add to the chosen date attribute. The nmonth parameter is mandatory. |
Date type valid formats (if the values aren’t this format, the function will return an error).
2019/10/12;
12/10/2019;
2019-10-12;
12-10-2019;
2019/Oct/12;
12/Oct/2019;
2019-Oct-12;
12-Oct-2019.
Example
The following example uses the Bike sales dataset.
Description | Screenshot |
---|---|
In this example, we want to add 2 months to the reported date, which is the attribute Date. We type the following formula in the addmonth attribute:
and the attribute will be filled with the Date attribute’s values postponed by two months. The results are:
|