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

DAYSDIFF_MXONB(A)

  • Dark
    Light
  • PDF

Article summary

Date Transform: DAYSDIFF_MXONB(A)

Returns the number of days between Date A and the maximum value of Date B

Purpose

Use this function to calculate:
  • The number of days between a target date and a comparison date
  • The number of days between one event and most recent occurrence of another event
  • The age of a transaction in days relative to the total time covered by the data set

Return Value

PropertyValue
FieldTypeInteger
FieldSizemed
DataTypeDiscrete
DataSizeShort


Example Return Value: -N.....N 
where 
N is the maximum number of days between Date A and the maximum of Date B

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”: “DAYSDIFF_MXONB(A,B)”DAYSDIFF_MXONB(A,B)
A“p2”: “DateTimeFieldName”
“p2”: “DateFieldName”
“p2”: “#YYYY-MM-DD HH:MM:SS”
“p2”: “#YYYY-MM-DD”
Required. Date to subtract from B.
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
B“p3”: “DateTimeFieldName”
“p3”: “DateFieldName”
“p3”: “#YYYY-MM-DD HH:MM:SS”
“p3”: “#YYYY-MM-DD”
Required. Date from which to calculate the maximum
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
DescriptionCalculate days between transaction and most recent response in the system
Input
  • Table: = [transactions]
  • Function: = DateTransform
  • DateTimeFunction: = 
  • A:= [transactions].[date]
  • B: = [transactions].[last_response] 
  • Name: = DaysDiffMaxOnLastResponse
Sample



Was this article helpful?

What's Next