Contour Expression to achieve cumulative sum and partitioned sum from same expression

90 views Asked by At

Cumulative sum and partitioned sum from same expression contour ? Can we achieve this ?

Tried to write this :

SUM("mass") OVER (PARTITION BY "class" ORDER BY "year" ASC ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) AS "cumulative_sum", SUM("mass") OVER (PARTITION BY "class" ORDER BY "year" ASC ROWS BETWEEN 2 PRECEDING AND 2 FOLLOWING) AS "partition_sum"

Two new columns one with cumulative sum and another with partitioned sum

0

There are 0 answers