deltaSum
Sums the arithmetic difference between consecutive rows. If the difference is negative, it is ignored.
The underlying data must be sorted for this function to work properly. If you would like to use this function in a materialized view, you most likely want to use the deltaSumTimestamp method instead.
Syntax
Arguments
Returned value
- A gained arithmetic difference of the
IntegerorFloattype.
Examples
Query:
Result:
Query:
Result:
Query:
Result:
See Also
deltaSum
Introduced in: v21.3
Sums the arithmetic difference between consecutive rows. If the difference is negative, it is ignored.
The underlying data must be sorted for this function to work properly.
If you would like to use this function in a materialized view, you most likely want to use the deltaSumTimestamp function instead.
See also:
Syntax
Arguments
Returned value
Returns a gained arithmetic difference of the input values. (U)Int* or Float*
Examples
Basic usage with positive differences
Mixed values with negative differences ignored
Float values