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

DAYSBEFOREMAX(A)

  • Dark
    Light
  • PDF

Article summary

Date Transform: DAYSBEFOREMAX(A)

Returns the difference in days between A and Max(A)

Purpose

Use this function to calculate:
  • The number of days that elapsed between an event and the latest occurrence of that event
  • The number of days a transaction occurred before the latest transaction

Return Value

PropertyValue
FieldTypeInteger
FieldSizeMed
DataTypeDiscrete
DataSizeShort


Example Return Value: 0....N   
where 
N is the maximum number of days between the earliest and latest date in the dataset

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.
DateTimeFunction“p1”: “DAYSBEFOREMAX(A)”DAYSBEFOREMAX(A)
A“p2”: “DateFieldName”
Required. The date field from which to take the minimum value and the comparator values.
Supports:  
  • DataType: Discrete
  • Field Type: Date
  • Fixed Value:  #YYYY-MM-DD,    e.g. #2021-04-05

JSON Sample

Usage Notes

See also DAYSAFTERMIN(A)

Example

ExampleDetails
DescriptionCalculate age of a transaction in days
Input
  • Table: = [transactions]
  • Function: = DateTransform
  • DateTimeFunction: = DAYSBEFOREMAX(A)
  • A:= [transactions].[last_response]
  • Name: = DaysBeforeMax
Sample



Was this article helpful?

What's Next