---
schema_version: "1"
id: 5632e5ced831c08b50edf27a9f5a4408e2150e3fa75aef0bedcbb463f74369e0
title: "Calculated Insight: Count Of Total Cases By Vehicle"
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/ind/264-0-0/auto_cicalculated_insight_count_of_total_cases_by_vehicle.md
canonical_url: https://help.salesforce.com/s/articleView?id=ind.auto_cicalculated_insight_count_of_total_cases_by_vehicle.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 53ed504fedacb39d70f5bd305f76e6a5e5d4c8e59d918015c0f01331c3997a9a
description: The Count Of Total Cases By Vehicle calculated insight aggregates the number of customer cases for a specific vehicle, and groups the cases by year, quarter, and month. The insight considers cases in all statuses and provides an overall understanding of customer satisfaction.
products:
  - Automotive
release: "264"
---
# Calculated Insight: Count Of Total Cases By Vehicle

The Count Of Total Cases By Vehicle calculated insight aggregates the number of customer cases for a specific vehicle, and groups the cases by year, quarter, and month. The insight considers cases in all statuses and provides an overall understanding of customer satisfaction.

### 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 | Description |
| --- | --- |
| `SELECT COUNT(ssot__Case__dlm.ssot__Id__c) AS TotalCases__c` | Extracts the IDs of all cases, calculates the total count, and assigns it an alias TotalCases\_\_c. |
| `ssot__Vehicle__dlm.ssot__VehicleIdentificationNumber__c AS VIN__c` | Extracts the vehicle identification number from the Vehicle object and assigns it an alias VIN\_\_c. |
| `quarter(ssot__Case__dlm.ssot__CreatedDate__c) as Quarter__c` | Extracts the quarter information from the Created Date of the case records and assigns it an alias as Quarter\_\_c. |
| `year(ssot__Case__dlm.ssot__CreatedDate__c) as Year__c` | Extracts the year information from the Created Date of the case records and assigns it an alias as Year\_\_c. |
| `month(ssot__Case__dlm.ssot__CreatedDate__c) as Month__c` | Extracts the month information from the Created Date of the case records and assigns it an alias as Month\_\_c. |
| `FROM ssot__Case__dlm JOIN ssot__Vehicle__dlm ON (ssot__Case__dlm.ssot__AccountId__c = ssot__Vehicle__dlm.ssot__CurrentOwnerId__c)` | Joins the Vehicle and Case objects by matching the Account ID field on a case record to the Current Owner ID field on a vehicle record. |
| `GROUP BY VIN__c, Quarter__c, Year__c, Month__c` | Groups the results by the vehicle identification number, month, quarter, and year. |