---
schema_version: "1"
id: c120fe0a197e6e0c74fcfa7da05fc70cb781ebf80e4d57ba7769082ade79fc38
title: "Calculated Insight: Customer Lifetime Value"
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/ind/264-0-0/auto_cicalculated_insight_customer_lifetime_value.md
canonical_url: https://help.salesforce.com/s/articleView?id=ind.auto_cicalculated_insight_customer_lifetime_value.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 854f3c50bec8c654a7f952ea52859e0300ee1f86c7fde1a46bf3666464348cb9
description: The Customer Lifetime Value calculated insight aggregates the lifetime revenue generated from the sale of vehicles, services, parts, and accessories for a specific customer. The lifetime value of a customer includes the purchase of vehicles, parts, subscriptions, and accessories from the original equipment manufacturer and from dealerships. The insight also considers the order value from repair and maintenance of vehicles and parts.
products:
  - Automotive
release: "264"
---
# Calculated Insight: Customer Lifetime Value

The Customer Lifetime Value calculated insight aggregates the lifetime revenue generated from the sale of vehicles, services, parts, and accessories for a specific customer. The lifetime value of a customer includes the purchase of vehicles, parts, subscriptions, and accessories from the original equipment manufacturer and from dealerships. The insight also considers the order value from repair and maintenance of vehicles and parts.

### 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>

Here’s a breakdown of the logic.

 
| Expression | Definition |
| --- | --- |
| `SELECT ssot__Account__dlm.ssot__Name__c AS CustomerName__c` | Extracts a customer's name from the Account object and assigns the name an alias `CustomerName__c`. |
| `Vehicle_Sales_Detail__cio.CustomerId__c AS CustomerId__c` | Extracts the customer's unique ID from the Vehicle Sales Detail calculated insight and assigns it an alias `CustomerId__c`. |
| `SUM(Vehicle_Sales_Detail__cio.DealerSalesAmount__c + Vehicle_Sales_Detail__cio.DirectSalesAmount__c + Vehicle_Sales_Detail__cio.PartsTxnAmount__c + Vehicle_Sales_Detail__cio.RepairOrderAmount__c) as TotalAmount__c` | Calculates the total revenue generated for each customer from various sales activities such as dealer sales of vehicles, direct sales of vehicles, parts sales, and repair orders from the Vehicle Sales Detail calculated insight. The value is assigned an alias `TotalAmount__c`. |
| FROM Vehicle\_Sales\_Detail\_\_cio | Specifies the Vehicle Sales Detail calculated insight that the total amount is derived from. |
| JOIN ssot\_\_Account\_\_dlm ON (Vehicle\_Sales\_Detail\_\_cio.CustomerId\_\_c = ssot\_\_Account\_\_dlm.ssot\_\_Id\_\_c ) | Joins the data in the Vehicle Sales Detail calculated insight and Account object by matching the Customer ID field on Vehicle Sales Detail to the ID field on Account. |
| `GROUP BY CustomerName__c, CustomerId__c` | Groups the results based on the customer's name and ID, and applies the SUM aggregation function to calculate the total revenue for each customer. |