--- title: "WOY(A)" slug: "engineeringdatefunction2-20" updated: 2021-10-15T17:24:38Z published: 2021-10-15T17:24:38Z canonical: "docs.datajet.app/engineeringdatefunction2-20" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.datajet.app/llms.txt > Use this file to discover all available pages before exploring further. # WOY(A) ## Date Transform: WOY(A) ## Returns Week of Year for Date A, as an integer between 1 and 52 ## Purpose Use this function to: - Group transactions into week of year segments - Segment events by week - Group multi-year data into consistent weekly segments for year on year comparison ## Return Value | Property | Value | | --- | --- | | **FieldType** | Integer | | **FieldSize** | Low | | **DataType** | Discrete | | **DataSize** | Short | ```shell Example Return Value: 1...52 ``` ![](https://cdn.document360.io/73b6469b-c1e4-47e9-aa65-986c8ebd17ca/Images/Documentation/WOY_Sample.PNG) ## 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”: “WOY(A)” | WOY(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 week of year *Supports:* - **DataType:** Discrete / Continuous - **Field Type:** Date, DateTime - **Fixed Value:** #YYYY-MM-DD, e.g. #2021-04-05 - **Fixed Value:** #YYYY-MM-DD HH:MM:SS, e.g. #2021-04-05 11:01:08 | ## JSON Sample ![](https://cdn.document360.io/73b6469b-c1e4-47e9-aa65-986c8ebd17ca/Images/Documentation/WOY_JSON.PNG) ## Usage Notes See Also: - [DOY(A)](/v1/docs/engineeringdatefunction2-12) - Day of year - [SWEEKDAY(A)](/v1/docs/engineeringdatefunction2-17) - Weekday as string - YEARWOY(A) - Year week of year - [DATEFROM(A,B,C)](/v1/docs/engineeringdatefunction2-6) - Date from integer parts ## Example | Example | Details | | --- | --- | | **Description** | Group transactions into weekly segments | | **Input** | - Table: = [transactions] - Function: = DateTransform - **DateTimeFunction: = WOY(A)** - A:= [transactions].[date] - Name: = WOY_date | | **Sample** | ![](https://cdn.document360.io/73b6469b-c1e4-47e9-aa65-986c8ebd17ca/Images/Documentation/WOY_Example.PNG) |