--- title: "DAYSAFTERMIN(A)" slug: "engineeringdatefunction2-8" updated: 2021-10-14T15:12:23Z published: 2021-10-14T15:12:23Z canonical: "docs.datajet.app/engineeringdatefunction2-8" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.datajet.app/llms.txt > Use this file to discover all available pages before exploring further. # DAYSAFTERMIN(A) ## Date Transform: DAYSAFTERMIN(A) ## Returns the difference in days between A and Min(A) ## Purpose Use this function to calculate: - The number of days that have elapsed between an event and the earliest occurrence of that event - The age of a transaction, in days, since the earliest transaction in the dataset ## Return Value | Property | Value | | --- | --- | | **FieldType** | Integer | | **FieldSize** | Med | | **DataType** | Discrete | | **DataSize** | Short | ```shell Example Return Value: 0....N where N is the maximum number of days since the earliest date in the dataset ``` ![](https://cdn.document360.io/73b6469b-c1e4-47e9-aa65-986c8ebd17ca/Images/Documentation/DAYSAFTERMIN_Sample.PNG) ## 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. | | **DateTimeFunction** | “p1”: “DAYSAFTERMIN(A)” | DAYSAFTERMIN(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 ![](https://cdn.document360.io/73b6469b-c1e4-47e9-aa65-986c8ebd17ca/Images/Documentation/DAYSAFTERMIN_JSON.PNG) ## Usage Notes See also [DAYSBEFOREMAX(A)](/v1/docs/engineeringdatefunction2-9) ## Example | Example | Details | | --- | --- | | **Description** | Calculate the number of days a transaction occurred after the first transaction | | **Input** | - Table: = [transactions] - Function: = DateTransform - **DateTimeFunction: = DAYSAFTERMIN(A)** - A:= [transactions].[first_transaction] - Name: = DaysAfterMin | | **Sample** | ![](https://cdn.document360.io/73b6469b-c1e4-47e9-aa65-986c8ebd17ca/Images/Documentation/DAYSAFTERMIN_Example.PNG) |