Date Transform: DAYSBEFOREMAX(A)
Returns the difference in days between A and Max(A)
Purpose
Use this function to calculate:
- The number of days that elapsed between an event and the latest occurrence of that event
- The number of days a transaction occurred before the latest transaction
Return Value
| Property | Value |
|---|---|
| FieldType | Integer |
| FieldSize | Med |
| DataType | Discrete |
| DataSize | Short |
Example Return Value: 0....N
where
N is the maximum number of days between the earliest and latest date in the dataset
Parameters
| Parameter | JSON | Description |
|---|---|---|
| Table | “targetTable”: “MyTableName” | The target table on which the new field will be created |
| Filter | “dataset”: {DataSet_JSON} | Optional. If a filter is applied, records not in the filter Recordset will be returned as null. |
| DateTimeFunction | “p1”: “DAYSBEFOREMAX(A)” | DAYSBEFOREMAX(A) |
| A | “p2”: “DateFieldName” | Required. The date field from which to take the minimum value and the comparator values. Supports:
|
JSON Sample
Usage Notes
See also DAYSAFTERMIN(A)
Example
| Example | Details |
|---|---|
| Description | Calculate age of a transaction in days |
| Input |
|
| Sample |