We will focus upon the rolling twelve-month totals problem, but our methods can be applied to any time window (e.g., 3 months) or to averages and other aggregations across those time windows as well.Ī rolling total for a month is the total for that month plus the previous months within the time window, or NULL if you don’t have the values for all the previous months within the time window. Calculating Values within a Rolling Window in Transact SQL - Simple TalkĬalculating Values within a Rolling Window in SQLĪny time that you need to combine values across several rows in SQL, the problem can be challenging, particularly when it comes to performance.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |