> ## Documentation Index
> Fetch the complete documentation index at: https://private-7c7dfe99-mintlify-8c05c8a2.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

> يجمع الفرق الحسابي بين الصفوف المتتالية.

# deltaSum

<div id="deltaSum">
  ## deltaSum
</div>

أُضيفت في: v21.3.0

تجمع الفرق الحسابي بين الصفوف المتتالية.
إذا كان الفرق سالبًا، فيُتجاهل.

<Tip>
  يجب أن تكون البيانات الأساسية مرتبة لكي تعمل هذه الدالة على نحو صحيح.
  إذا كنت ترغب في استخدام هذه الدالة في [عرض مادي](/ar/reference/statements/create/view#materialized-view)، فغالبًا ما ستحتاج إلى استخدام الدالة [`deltaSumTimestamp`](/ar/reference/functions/aggregate-functions/deltaSumTimestamp) بدلًا منها.
</Tip>

انظر أيضًا:

* [`runningDifference`](/ar/reference/functions/regular-functions/other-functions#runningDifference)

**الصياغة**

```sql theme={null}
deltaSum(x1[, x2, ...])
```

**الوسائط**

* `x1[, x2, ...]` — قيمة إدخال واحدة أو أكثر. [`Integer`](/ar/reference/data-types/int-uint) أو [`Float`](/ar/reference/data-types/float)

**القيمة المُعادة**

يعيد الفرق الحسابي المتراكم لقيم الإدخال. [`(U)Int*`](/ar/reference/data-types/int-uint) أو [`Float*`](/ar/reference/data-types/float)

**أمثلة**

**الاستخدام الأساسي مع الفروق الإيجابية**

```sql title=Query theme={null}
SELECT deltaSum(arrayJoin([1, 2, 3]))
```

```response title=Response theme={null}
┌─deltaSum(arrayJoin([1, 2, 3]))─┐
│                              2 │
└────────────────────────────────┘
```

**قيم مختلطة مع تجاهل الفروق السالبة**

```sql title=Query theme={null}
SELECT deltaSum(arrayJoin([1, 2, 3, 0, 3, 4, 2, 3]))
```

```response title=Response theme={null}
┌─deltaSum(arrayJoin([1, 2, 3, 0, 3, 4, 2, 3]))─┐
│                                             7 │
└───────────────────────────────────────────────┘
```

**القيم ذات الفاصلة العائمة**

```sql title=Query theme={null}
SELECT deltaSum(arrayJoin([2.25, 3, 4.5]))
```

```response title=Response theme={null}
┌─deltaSum(arrayJoin([2.25, 3, 4.5]))─┐
│                                2.25 │
└─────────────────────────────────────┘
```

**انظر أيضًا**

* [`runningDifference`](/ar/reference/functions/regular-functions/other-functions#runningDifference)
