HOURSBEFOREMAX(A)
- 1 Minute to read
- Print
- DarkLight
- PDF
HOURSBEFOREMAX(A)
- 1 Minute to read
- Print
- DarkLight
- PDF
Article summary
Did you find this summary helpful?
Thank you for your feedback
DateTime Transform: HOURSBEFOREMAX(A)
Returns the number of hours before the maximum value of DateTime A
HOURSBEFOREMAX(A) = HoursDiff(Max(A),A)
where
- Max(A) = Maximum value in Field A
- A = Value of current record
- HoursDiff(Max(A),A) = total number of hours between Max(A) and A
Purpose
Use this function to:
- Calculate hourly difference between an individual transaction and the most recent transaction
- Calculate the age, in hours, of an event
Return Value
Property | Value |
---|---|
FieldType | Integer |
FieldSize | Med / High |
DataType | Discrete / Continuous |
DataSize | Integer |
Example Return Value: -N....N where N = maximum difference in hours between records in Field A
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. |
DateTime Function | “p1”: “HOURSBEFOREMAX(A)” | HOURSBEFOREMAX(A) |
A | “p2”: “DateTimeFieldName” “p2”: “#YYYY-MM-DD HH:MM:SS” | Required. The DateTime field from which to extract the Max Hour and the Hour to compare it with. Must be on the target table. Supports:
|
JSON Sample
Usage Notes
See also:
- HOURSDIFF(A,B) (DateTime)
- Engineering | Expression Field
Example
Example | Details |
---|---|
Description | Calculate number of hours between current row and maximum DateTime for the field |
Input |
|
Sample |
Was this article helpful?