ARRAY_CUM_SUM

Learn how to use the ARRAY_CUM_SUM array function in PlaidCloud Lakehouse. Returns the cumulative sum of elements in an array - with syntax and examples.

Returns the cumulative sum of elements in an array.

Analyze Syntax

func.array_cum_sum([1, 2, 3, 4])

Analyze Examples

func.array_cum_sum([1, 2, 3, 4])

┌────────────┐
 [1,3,6,10] 
└────────────┘

SQL Syntax

ARRAY_CUM_SUM([1, 2, 3, 4])

SQL Examples

SELECT ARRAY_CUM_SUM([1, 2, 3, 4]);

┌────────────┐
 [1,3,6,10] 
└────────────┘