...
Excerpt |
---|
Returns the serial date number for the last day of the month before or after a specified number of months from a starting serial date number. |
D lang syntax |
---|
RawWrangle | true |
---|
Type | ref |
---|
showNote | true |
---|
WrangleText | derive type:single value:eomonth(myDate, 3) |
---|
|
eomonth(myDate, 3) |
Output: Returns the values for the last date of the month that is three months after the serial date number value in the myDate
column.
D lang syntax |
---|
RawWrangle | true |
---|
Type | syntax |
---|
showNote | true |
---|
WrangleText | derive type:single value:eomonth(start_date_int,delta_months) |
---|
|
eomonth(start_date_int,delta_months) |
Argument | Required? | Data Type | Description |
---|
start_date |
_intInteger to compare as a serial date value. |
delta_months | Y | integer | Number of months before or after the starting date to apply to the date value. |
start_date
Starting date values from which to compute end-of-month values.
...
Required? | Data Type | Example Value |
---|
Yes | Literal |
integer Datetime or column reference | LastContactDate |
delta_months
Number of months to add to the
...
date value to determine the month whose last date is returned.
- Negative integer values are accepted.
Required? | Data Type | Example Value |
---|
Yes | Integer | -3 |
Example - EOMONTH Function
Source:
In the following table, you can see how the the end-of-month values are calculated from a baseline
...
date
...
of June 15, 2020.
eventSerialDate439974399743997 | 43997 | 43997 | 4399743997 | 43997 | 4399743997 | 43997 | 43997439974399743997 Transformation:
D trans |
---|
RawWrangle | true |
---|
p03Value | 'deltaMonthSerialDate' |
---|
Type | step |
---|
WrangleText | derive type:single value:eomonth( |
---|
|
...
eventDate,deltaMonth) as:'deltaMonthSerialDate' | p01Name | Formula type |
---|
p01Value | Single row formula |
---|
p02Name | Formula |
---|
p02Value | eomonth( |
---|
|
...
eventDate,deltaMonth) | p03Name | New column name |
---|
SearchTerm | New formula |
---|
|
Results:
eventSerialDate | deltaMonth | deltaMonthSerialDate |
---|
1 | 06/15/2020 |
4399743997439974399743997 | 43997 | 4399743997439974399743997 | 43997 | 43997 | 4399743997