# GetSharedValueIndexCountBySourceIndex(int)

> Number of occurrences of a shared (unique) value shared by a given a source index. For example, given source array: [A,A,A,B,B,C,C,A,B] shared values are: [A,B,C] Shared value counts: [4,3,2] (number of occurrences of a shared value) Given the index 2 into the source array (A), the return value would be 4 (for 4 occurrences of A in the source buffer).

## Definition

* **Type:** Method
* **Namespace:** [Unity.Entities](/engine/7000.0/script-reference/unity/entities.md)
* **Assembly:** UnityEngine.EntitiesModule

```csharp
public int GetSharedValueIndexCountBySourceIndex(int indexIntoSourceBuffer)
```

### Parameters

**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): Index of source value.

### Returns

| Type                                                       | Description                                                                                   |
| ---------------------------------------------------------- | --------------------------------------------------------------------------------------------- |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) | Count of total occurrences of the shared value at a source buffer index in the source buffer. |
