- 1 Minute to read
- Print
- DarkLight
- PDF
FLOORMIN(A,B)
- 1 Minute to read
- Print
- DarkLight
- PDF
Engineering Functions: [FLOORMIN(A,B)]
Rounds a DateTime field down to a given interval, i.e., down to the nearest hour, 15 mins…
FLOORMIN = Date &" " & Hour &":" & INT(Mins/Interval) * Interval &":00"
Where
Date = The DATE portion of Field A
Hour = The HOUR portion of Field A
Mins = The MINUTE portion of Field A
Interval = The INTERVAL, in minutes, denoted by B
Purpose
Use this function to:
- segment data into time intervals
Return Value
FieldType | DateTime |
FieldSize | Continuous |
DataType | Continuous |
DataSize | LongInteger |
2020-11-06 14:45:00
Parameters
Component | 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”: “FLOORMIN(A,B)” | FLOORMIN(A,B) |
A | “p2”: “TimeStampFieldName” | The DateTime field to segment |
B | “p3”: “#INTERVAL” | FLOORMIN is used with an explicit interval value. e.g. #15 - allocates to previous 00, 15, 30, 40 minute interval. #20 - allocates to previous 00, 20, 40 minute interval #27 - allocates to previous 00, 27, 54 minute interval |
JSON sample
{
"method": "BuildBakedField",
"project": "Election8",
"targetTable": "PA_All",
"overwrite": true,
"name": "ts_15",
"function": "datetimetransform",
"p1": "FLOORMIN(A,B)",
"p2": "TimeStamp",
"p3": "#15"
}
Usage Notes
Example
Segment timestamp data into 15 minute segments | |
|