YEARWOY(A)
  • 1 Minute to read
  • Dark
    Light
  • PDF

YEARWOY(A)

  • Dark
    Light
  • PDF

Article summary

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

PropertyValue
FieldTypeInteger
FieldSizeMed
DataTypeDiscrete
DataSizeShort


Example Return Value:  YYYYWW, 
where 
YYYY = 0000....9999
WW = 01...52
e.g.  201901,   202046

Parameters

ParameterJSONDescription
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:  
  • 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

Usage Notes

See also:

Example

ExampleDetails
DescriptionSegment transactions into yearly weeks
Input
  • Table: = [transactions]
  • Function: = DateTransform
  • DateTimeFunction: = YEARWOY(A)
  • A:= [transactions].[date]
  • Name: = YearWeekOfYear
Sample



Was this article helpful?

What's Next