© Kathi Kellenberger, Clayton Groom, and Ed Pollack 2019
K. Kellenberger et al.Expert T-SQL Window Functions in SQL Server 2019https://doi.org/10.1007/978-1-4842-5197-3_11

11. Time Trend Calculations

Kathi Kellenberger1 , Clayton Groom2 and Ed Pollack3
(1)
Edwardsville, IL, USA
(2)
Smithton, IL, USA
(3)
Albany, NY, USA
 
In this chapter you will put all the techniques you have learned in the previous chapter to work to create calculations for navigating the timeline to produce the following calculations:
  • Moving total (MT)

  • Moving average (MA)

  • Rate of change (ROC)

  • Putting it all together

  • Pareto Principle

Moving Totals and Moving Averages

So far, the queries have become more and more complex. They are about to become even more so. To help keep them understandable, ...

Get Expert T-SQL Window Functions in SQL Server 2019: The Hidden Secret to Fast Analytic and Reporting Queries now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.