Calculated Insight: Vehicle Revenue From Dealer Sales
The Vehicle Revenue From Dealer Sales calculated insight aggregates the lifetime revenue
generated for a specific vehicle by all dealerships. The vehicle revenue from dealer sales
considers the approved claim amount for all dealers who sold and resold a specific
vehicle.
Required Editions
Available in: Enterprise, Unlimited, and Developer
Editions
Here’s a breakdown of the logic.
SELECT SUM(ssot__SalesOrderProduct__dlm.ssot__TotalPriceAmount__c) AS DirectAmount__c,
ssot__Vehicle__dlm.ssot__VehicleIdentificationNumber__c AS VIN__c
Applies the SUM aggregation function to the Total Price Amount field on the Sales Order
Product object and assigns it an alias DirectAmount_c. Extracts the Vehicle Identification Number field from the
Vehicle object and assigns it an alias VIN__c.
FROM ssot__SalesOrder__dlm JOIN ssot__SalesOrderProduct__dlm ON
(ssot__SalesOrder__dlm.ssot__Id__c =
ssot__SalesOrderProduct__dlm.ssot__SalesOrderId__c)
Joins the Sales Order and Sales Order Product objects by matching the ID field on Sales
Order to the Sales Order ID field on Sales Order Product.
JOIN ssot__Asset__dlm ON (ssot__SalesOrder__dlm.ssot__BillToAccountId__c =
ssot__Asset__dlm.ssot__AccountContactId__c AND
ssot__SalesOrderProduct__dlm.ssot__ProductId__c =
ssot__Asset__dlm.ssot__ProductId__c)
Joins the Sales Order and Asset objects by matching the Bill To Contact ID field on
Sales Order to the Account Contact ID field on Asset. Joins the Sales Order and Asset objects
by matching the Product ID field on Sales Order to the Product ID field on Asset.
JOIN ssot__Vehicle__dlm ON (ssot__Asset__dlm.ssot__VehicleId__c =
ssot__Vehicle__dlm.ssot__Id__c)
Joins the Asset and Vehicle objects by matching the Vehicle ID field on Asset to the ID
field on Vehicle.
GROUP BY VIN__c
Groups the results by VIN__c, aggregating the
direct sales for each unique vehicle.
Did this article solve your issue?
Let us know so we can improve!
Loading
Salesforce Help | Article
Cookie Consent Manager
General Information
Required Cookies
Functional Cookies
Advertising Cookies
General Information
We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required Cookies
Always Active
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional Cookies
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising Cookies
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.