Swarnil Singhai
Snippet

TIL: SAQL windowing for running totals

A running total in SAQL is just a windowing function over an ordered grouping:

q = load "opportunities";
q = group q by 'CloseMonth';
q = foreach q generate 'CloseMonth' as 'Month',
      sum('Amount') as 'Amount',
      sum(sum('Amount')) over ([..0] partition by all order by 'CloseMonth') as 'Running';

The [..0] frame means “from the start of the partition up to the current row” — that’s what produces the cumulative sum. Swap partition by all for a real field to reset the total per segment.

Swarnil Singhai

Alembic is a starting point for Jekyll projects. Rather than starting from scratch, this boilerplate is designed to get the ball rolling immediately