---
schema_version: "1"
id: 1db2d3a1792557d6300da8f8147bf54858f860cdc381c6602f88e4a64c94ec8a
title: delta Transformation
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/analytics/264-0-0/bi_integrate_delta_transformation.md
canonical_url: https://help.salesforce.com/s/articleView?id=analytics.bi_integrate_delta_transformation.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 56c28ebdddc57437700b203f2b0db5d018cbd70aa70dc83b013d3698b4cdf8b0
description: The delta transformation calculates changes in the value of a measure (number) column in a dataset over time. The delta transformation generates an output column in the dataset to store the delta for each record. Create deltas to make it easier for business analysts to include them in queries.
products:
  - CRM Analytics
  - Cross Cloud
release: "264"
---
# delta Transformation

The delta transformation calculates changes in the value of a measure (number) column in a dataset over time. The delta transformation generates an output column in the dataset to store the delta for each record. Create deltas to make it easier for business analysts to include them in queries.

![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-analytics-bi-264-0-0-production-enus/ec791473-f5b4-4f64-a656-9104f455d966/images/icon_note.png)

Note The `delta` transformation isn’t supported when null measure handling is enabled and dataflows containing delta transformations fail. Use `computeRelative` and `computeExpression` transformations instead in your dataflows, to calculate changes in measure (number) values over time. For an example, see [Enable Null Measure Handling in Orgs Created Before Spring ’17](https://help.salesforce.com/s/articleView?id=analytics.bi_integrate_enable_null_measures.htm&type=5&language=en_US).

The delta transformation calculates each delta value by comparing the value in each record with the value in the previous record. Because records aren’t always sorted, the delta transformation orders the records before computing the delta values. To do this action, the transformation sorts the data by the specified dimension (text column), and then by the specified epoch date column.

![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-analytics-bi-264-0-0-production-enus/ec791473-f5b4-4f64-a656-9104f455d966/images/icon_note.png)

Note When CRM Analytics processes dates, it creates the following epoch date columns for each date processed:

 
| Epoch Time Column | Description |
| --- | --- |
| <date\_column\_name>\_sec\_epoch | For example, if the date column is CloseDate, the generated epoch second column is CloseDate\_sec\_epoch. This column provides the number of seconds that have elapsed since January 1, 1970 (midnight UTC/GMT). |
| <date\_column\_name>\_day\_epoch | For example, if the date column is CloseDate, the generated epoch day column is CloseDate\_day\_epoch. This column provides the number of days that have elapsed since January 1, 1970 (midnight UTC/GMT). |

![Example](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-analytics-bi-264-0-0-production-enus/ec791473-f5b4-4f64-a656-9104f455d966/images/icon_example.png)

Example

Let’s look at an example. You want to create an OppHistoryDelta dataset that contains opportunity history from the OpportunityHistory object and also calculates the deltas for opportunity amounts.

The OpportunityHistory object contains the following data.

   
| OpportunityId | CloseDate | StageName | Amount |
| --- | --- | --- | --- |
| 1 | 1/1/2014 | New | 100 |
| 2 | 1/1/2014 | New | 100 |
| 2 | 2/1/2014 | ClosedWon | 200 |
| 1 | 3/1/2014 | ClosedWon | 100 |

You create the following dataflow definition.

```
{
   "Extract_Opportunities": {
      "action": "sfdcDigest",
      "parameters": {
         "object": "OpportunityHistory",
         "fields": [
            { "name": "OpportunityId" },
            { "name": "CloseDate" },
            { "name": "StageName" },
            { "name": "Amount" }
         ]
      }
   },
   "Calculate_Delta": {
      "action": "delta",
      "parameters": {
         "dimension": "OpportunityId",
         "epoch": "CloseDate_day_epoch",
         "inputMeasure": "Amount",
         "outputMeasure": "DeltaAmount",
         "source": "Extract_Opportunities"
      }
   },
   "Register_Dataset": {
      "action": "sfdcRegister",
      "parameters": {
         "alias": "OppHistoryDelta",
         "name": "OppHistoryDelta",
         "source": "Calculate_Delta"
      }
   }
}
```

To calculate the delta values for each opportunity amount, the delta transformation sorts the records by the dimension (text column) (OpportunityId) first, and then by time (CloseDate\_day\_epoch) as shown here.

   
| OpportunityID | CloseDate | StageName | Amount |
| --- | --- | --- | --- |
| 1 | 1/1/2014 | New | 100 |
| 1 | 3/1/2014 | ClosedWon | 100 |
| 2 | 1/1/2014 | New | 100 |
| 2 | 2/1/2014 | ClosedWon | 200 |

After the records are sorted, for each dimension (text column) (OpportunityId), the transformation compares the previous value to the next value to determine the delta for each record. The transformation creates the following dataset.

    
| OpportunityId | CloseDate | StageName | Amount | DeltaAmount |
| --- | --- | --- | --- | --- |
| 1 | 1/1/2014 | New | 100 | 0 |
| 1 | 3/1/2014 | ClosedWon | 100 | 0 |
| 2 | 1/1/2014 | New | 100 | 0 |
| 2 | 2/1/2014 | ClosedWon | 200 | 100 |

For the first record of each dimension (text column), the transformation inserts ‘0’ for the delta value.

![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-analytics-bi-264-0-0-production-enus/ec791473-f5b4-4f64-a656-9104f455d966/images/icon_note.png)

Note If an opportunity contains multiple changes on the same day, you must sort the records on a shorter time interval. In this case, sort on CloseDate\_sec\_epoch column. Otherwise, records aren’t sorted correctly, which means delta values are incorrect.

- **[delta Parameters](https://help.salesforce.com/s/articleView?id=analytics.bi_integrate_delta_transformation_operation.htm&release=264.0.0&type=5)**  
    When you define a delta transformation, you set the action attribute to `delta` and specify the parameters.