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

YMDH(A)

  • Dark
    Light
  • PDF

Article summary

DateTime Transform: YMDH(A)

Returns Year Month Day Hour of DateTime A in the format YYYYMMDDHH

Purpose

Use this function to:
  • Create a discrete DataType from a continuous DateTime field ready for use in further engineering and analytical operations.

Return Value

PropertyValue
FieldTypeInteger
FieldSizeLow / Med / High 
DataTypeDiscrete
DataSizeShort / Integer


Example Return Value: YYYYMMDDH:   2020010101....2020010119....

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.
DateTime Function“p1”: “”
A“p2”: “DateTimeFieldName”
“p2”: “#YYYY-MM-DD HH:MM:SS”

Required. DateTime string from which to extract Year Month Day Hour
Supports:  
  • DataType: Discrete / Continuous
  • Field Type:  DateTime
  • Fixed Value:  #YYYY-MM-DD HH:MM:SS,    e.g. #2021-04-05 11:01:08

JSON Sample

Usage Notes

To create discrete DataTypes that retain minute and second granularity, considering creating an ElapsedMins or ElapsedSecs field using MINSDIFF(A,B) or SECSDIFF(A,B), where A = DateTime Field and B = Min(A)

 

Example

ExampleDetails
DescriptionCreate Year Month Day Hour
Input
  • Table: = [transactions]
  • Function: = DateTimeTransform
  • DateTimeFunction: = 
  • A:= [transactions].[dtPurchase]
  • Name: =YMDH_A
Sample



Was this article helpful?