Period-over-period change

Period-over-period change compares a value with that of the previous period, using LAG. The percentage variation is computed as (value - previous) / previous, guarding against a zero or missing previous value. Periods must be continuous for the comparison to make sense.

Example

(ca - LAG(ca) OVER (ORDER BY mois)) / NULLIF(LAG(ca) OVER (ORDER BY mois), 0)

Related concepts

The whole glossary