Date Transform: YEARWOY(A)
Returns the year and week of year from Date A in the format YYYYWW
Purpose
Use this function to:
- Segment data into yearly weeks
Return Value
| Property | Value |
|---|---|
| FieldType | Integer |
| FieldSize | Med |
| DataType | Discrete |
| DataSize | Short |
Example Return Value: YYYYWW,
where
YYYY = 0000....9999
WW = 01...52
e.g. 201901, 202046
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. |
| Date Function | “p1”: “YEARWOY(A)” | YEARWOY(A) |
| A | “p2”: “DateTimeFieldName” “p2”: “DateFieldName” “p2”: “#YYYY-MM-DD HH:MM:SS” “p2”: “#YYYY-MM-DD” | Required. The date from which to extract the year and the week Supports:
|
JSON Sample
Usage Notes
See also:
- YEARMONTH(A) - year and month in format YYYYMM
- YEARQTR(A) - year and quarter in format YYYYQ
- YEAR(A) - year in format YYYY
Example
| Example | Details |
|---|---|
| Description | Segment transactions into yearly weeks |
| Input |
|
| Sample |