The Vehicle Revenue From Direct Sales calculated insight aggregates the lifetime revenue
generated for a specific vehicle by the original equipment manufacturer. The vehicle revenue
from direct sales considers the sales orders for a specific vehicle.
Required Editions
| Available in: Enterprise, Unlimited, and Developer
Editions |
Here’s a breakdown of the logic.
| Expression |
Description |
SELECT SUM(ssot__RebateClaim__dlm.ssot__ClaimAmount__c) AS
DealerAmount__c, ssot__Vehicle__dlm.ssot__VehicleIdentificationNumber__c AS
VIN__c
|
Applies the SUM aggregation function to the Claim Amount field in the Rebate Claim
object and assigns it an alias DealerAmount__c.
Extracts the Vehicle Identification Number field from the Vehicle object and assigns
it an alias VIN__c. |
FROM ssot__RebateClaim__dlm JOIN ssot__Vehicle__dlm ON
(ssot__RebateClaim__dlm.ssot__VehicleId__c =
ssot__Vehicle__dlm.ssot__Id__c)
|
Joins the data in the Rebate Claim and Vehicle objects by matching the Vehicle ID field
on the Rebate Claim object to the ID field on the Vehicle object. |
GROUP BY VIN__c
|
Groups the results by VIN__c, aggregating the
dealer sales for each unique vehicle. |