Rolling window - Difference in sales of current with previous month
The Teradata Database channel includes discussions around advanced Teradata features such as high-performance parallel database technology, the optimizer, mixed workload management solutions, and other related technologies.
Re: Rolling window - Difference in sales of current with previous month
SyntaxEditor Code Snippet
(Sales-PreviousValue) DAY(4) TOMINUTEfrom(selectpkey,
min(Sales) over (partitionbypkey,year ,qtr/*ORDER BY RULE_TYPE_NUMBER */ROWSBETWEEN1PRECEDINGand1PRECEDING) asPreviousValuefromtable ) it looks like your table doesnot have good primary key