Date Transform: AGE(A)
Age in years at the time the field was built
Number of whole years between Date(Time) field A and today, where today is the date on which the field was built.
Purpose
Use this function to:
- Calculate age of customers at the time of Data Load
 - Calculate transaction age in years
 
Return Value
| Property | Value | 
|---|---|
| FieldType | Integer | 
| FieldSize | Low / Med | 
| DataType | Discrete | 
| DataSize | Short | 
Example Return Value: 0....N  where N is maximum number of years between today and Field(A)
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”: “AGE(A)” | AGE(A) | 
| A | “p2”: “DateFieldName” | Required. Date Field, or fixed value using #YYYY-MM-DD notation. If FIXED_VALUE is used, every row will have the difference in years between TODAY and FIXED_VALUE.  | 
JSON Sample
Usage Notes
The values returned by AGE(A) will depend on the value of TODAY when the field is calculated, and so will change each time a load script is executed.
Example
| Example | Details | 
|---|---|
| Description | Calculate Transaction Age in Years | 
| Input | 
  | 
| Sample |