Newer Version Available
Create a Derived Measure
Perform calculations on existing measures and use the result to create a new, or
derived, measure.
Tableau CRM calculates the value of derived measures at run time using the values from
other fields.
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 Close_Date_day_epoch and Created_Date_day_epoch to create a derived measure called Time to Win: ('Close_Date_day_epoch'- 'Created_Date_day_epoch') as 'Time to Win'.
The field Time to Win is calculated at run time:
1q = load "Opportunities";
2q = foreach q generate 'Close_Date_day_epoch' as 'Close_Date_day_epoch', 'Created_Date_day_epoch' as 'Created_Date_day_epoch', 'Opportunity_Name' as 'Opportunity_Name', ('Close_Date_day_epoch'- 'Created_Date_day_epoch') as 'Time to Win';The resulting table contains the number of days to win each opportunity:
