Note: This release is in preview. Features described here don’t become generally available until the latest general availability date that Salesforce announces for this release. Before then, and where features are noted as beta, pilot, or developer preview, we can’t guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features.

Create a Derived Measure

Perform calculations on existing measures and use the result to create a new, or derived, measure.
CRM Analytics calculates the value of derived measures at run time using the values from other fields.

You can also create a derived measure in a dataflow rather than at runtime using SAQL. Measures created during a dataflow are calculated when the data is imported and may result in better performance.

Note

Example - Calculate the Time to Win

Suppose that you have an Opportunities dataset with the Close Date and Open Date fields. You want to see the number of days it took to win the opportunity. Use CloseDate_day_epoch and CreatedDate_day_epoch to create a derived measure called Time to Win: ('CloseDate_day_epoch'- 'CreatedDate_day_epoch') as 'Time to Win'.

The field Time to Win is calculated at run time:

1q = load "Opportunities";
2q = foreach q generate 'CloseDate_day_epoch' as 'CloseDate_day_epoch', 'CreatedDate_day_epoch' as 'CreatedDate_day_epoch', 'Opportunity_Name' as 'Opportunity_Name', ('CloseDate_day_epoch'- 'CreatedDate_day_epoch') as 'Time to Win';

The resulting table contains the number of days to win each opportunity:

Derived dimension shows time to win