---
schema_version: "1"
id: 92c98c058d1be5430f0fe13c3a69de877a0626f1c26a7c70125826c1373cb4b0
title: "Calculated Insight: Vehicle Sales Detail"
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/ind/264-0-0/auto_cicalculated_insight_vehicle_sales_detail.md
canonical_url: https://help.salesforce.com/s/articleView?id=ind.auto_cicalculated_insight_vehicle_sales_detail.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 60d7437b9b46710a9b79fa7eef223e2930e1cd59e8fbf5919542b861d0c1bf0a
description: The Vehicle Sales Detail calculated insight aggregates the direct revenue, dealer revenue, parts revenue, and service revenue for each customer and vehicle combination. This calculated insight aggregates information from the Vehicle Revenue from Dealer Sales, Vehicle Revenue from Direct Sales, Vehicle Sales from Parts Sales, and Vehicle Sales from Repair Order insights. The result is grouped by customer and vehicle.
products:
  - Automotive
release: "264"
---
# Calculated Insight: Vehicle Sales Detail

The Vehicle Sales Detail calculated insight aggregates the direct revenue, dealer revenue, parts revenue, and service revenue for each customer and vehicle combination. This calculated insight aggregates information from the Vehicle Revenue from Dealer Sales, Vehicle Revenue from Direct Sales, Vehicle Sales from Parts Sales, and Vehicle Sales from Repair Order insights. The result is grouped by customer and vehicle.

### Required Editions

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small edition"><colgroup><col></colgroup><tbody><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: <strong>Enterprise</strong>, <strong>Unlimited</strong>, and <strong>Developer</strong> Editions</td></tr></tbody></table>

Her

 
| Expression | Description |
| --- | --- |
| `SELECT ssot__Vehicle__dlm.ssot__VehicleIdentificationNumber__c as VIN__c , ssot__Vehicle__dlm.ssot__CurrentOwnerId__c as CustomerId__c` | Extracts the Vehicle Identification Number from the Vehicle object and assigns it an alias `VIN__c`. Extracts the Current Owner ID from the Vehicle object and assigns it an alias `CustomerId__c`. |
| `SUM( CASE when isnull(Vehicle_Revenue_From_Dealer_Sales__cio.DealerAmount__c) then 0 else Vehicle_Revenue_From_Dealer_Sales__cio.DealerAmount__c end ) as DealerSalesAmount__c` | Calculates the total dealer sales amount by summing up the DealerAmount\_\_c value from the Vehicle Revenue From Dealer Sales calculated insight and assigns the value zero if the result is null. |
| `SUM( CASE when isnull(Vehicle_Revenue_From_Direct_Sales__cio.DirectAmount__c) then 0 else Vehicle_Revenue_From_Direct_Sales__cio.DirectAmount__c end ) as DirectSalesAmount__c` | Calculates the total direct sales amount by summing up the DirectAmount\_\_c value from the Vehicle Revenue From Direct Sales calculated insight and assigns the value zero if the result is null. |
| `SUM( CASE when isnull( Vehicle_Revenue_From_Parts_Sales__cio.PartsAmt__c) then 0 else Vehicle_Revenue_From_Parts_Sales__cio.PartsAmt__c end ) as PartsTxnAmount__c` | Calculates the total parts sales amount by summing up the PartsAmount\_\_c value from the Vehicle Revenue From Parts Sales calculated insight and assigns the value zero if the result is null. |
| `SUM( CASE when isnull(Vehicle_Revenue_from_Repair_Orders__cio.RepairAmount__c) then 0 else Vehicle_Revenue_from_Repair_Orders__cio.RepairAmount__c end ) as RepairOrderAmount__c` | Calculates the total dealer sales amount by summing up the RepairAmount\_\_c value from the Vehicle Revenue From Repair Orders calculated insight and assigns the value zero if the result is null. |
| `FROM ssot__Vehicle__dlm LEFT JOIN Vehicle_Revenue_From_Dealer_Sales__cio ON (ssot__Vehicle__dlm.ssot__VehicleIdentificationNumber__c = Vehicle_Revenue_From_Dealer_Sales__cio.VIN__c) LEFT JOIN Vehicle_Revenue_From_Direct_Sales__cio ON (ssot__Vehicle__dlm.ssot__VehicleIdentificationNumber__c = Vehicle_Revenue_From_Direct_Sales__cio.VIN__c) LEFT JOIN Vehicle_Revenue_From_Parts_Sales__cio ON (ssot__Vehicle__dlm.ssot__VehicleIdentificationNumber__c = Vehicle_Revenue_From_Parts_Sales__cio.VIN__c) LEFT JOIN Vehicle_Revenue_from_Repair_Orders__cio ON (ssot__Vehicle__dlm.ssot__VehicleIdentificationNumber__c = Vehicle_Revenue_from_Repair_Orders__cio.VIN__c)` | Joins the Vehicle object to the child calculated insights by matching the vehicle identification number. |
| `GROUP BY VIN__c, CustomerId__c` | Groups the results by `VIN__c`, and `CustomerId__c` aggregating the total sales by each unique vehicle and customer. |