Page tree

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

   

Contents:


 

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.

Wrangle vs. SQL: This function is part of Wrangle , a proprietary data transformation language. Wrangle is not SQL. For more information, see Wrangle Language.

Basic Usage

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. 

Syntax and Arguments

eomonth(start_date_int,delta_months)


ArgumentRequired?Data TypeDescription
start_date_intYIntegerStarting date to compare as a serial date value.
delta_monthsYintegerNumber of months before or after the starting date to apply to the date value.

For more information on syntax standards, see Language Documentation Syntax Notes.

start_date

Starting date values from which to compute end-of-month values. It must be a serial date value.

Usage Notes:

 

Required?Data TypeExample Value
YesLiteral integer or column referenceLastContactDate

delta_months

Number of months to add to the serial date value to determine the month whose last date is returned.

  • Negative integer values are accepted.

Usage Notes:

Required?Data TypeExample Value
YesInteger-3


Examples

Tip: For additional examples, see Common Tasks.

Example - EOMONTH Function

Source:

In the following table, you can see how the the end-of-month values are calculated from a baseline serial date number, which corresponds to June 15, 2020.

eventIdeventDateeventSerialDatedeltaMonth
106/15/202043997-24
206/15/202043997-18
306/15/202043997-12
406/15/202043997-6
506/15/202043997-3
606/15/202043997-2
706/15/202043997-1
806/15/2020439970
906/15/2020439971
1006/15/2020439972
1106/15/2020439973
1206/15/2020439976
1306/15/20204399712
1406/15/20204399718
1506/15/20204399724

Transformation:

Transformation Name New formula
Parameter: Formula type Single row formula
Parameter: Formula eomonth(eventSerialDate,deltaMonth)
Parameter: New column name 'deltaMonthSerialDate'

Results:

eventIdeventDateeventSerialDatedeltaMonth

deltaMonthSerialDate

106/15/202043997-2443281
206/15/202043997-1843465
306/15/202043997-1243646
406/15/202043997-643830
506/15/202043997-343921
606/15/202043997-243951
706/15/202043997-143982
806/15/202043997044012
906/15/202043997144043
1006/15/202043997244074
1106/15/202043997344104
1206/15/202043997644196
1306/15/2020439971244377
1406/15/2020439971844561
1506/15/2020439972444742



  • No labels

This page has no comments.