Year-over-Year Comparisons
The previous year usually provides the best comparison for what is happening the following year. This section talks about such comparisons, with particular emphasis on one of the big challenges. This year’s data is usually not complete, so how can we make a valid comparison?
Comparisons by Day
The place to start is with day-by-day comparisons from one year to the next. Here is a method where much of the work is done in Excel:
- Query the database and aggregate by date.
- Load the data into Excel, with all the dates in one column.
- Pivot the data into 366 rows (for each day in the year) and a separate column for each year.
This is actually more work than necessary. An easier way is to use the MONTH(), DAY(), and YEAR() functions in SQL to create the resulting table directly, as in the following example using starts from Subscribers:
SELECT MONTH(StartDate) as mon, DAY(StartDate) as dom, SUM(CASE WHEN YEAR(StartDate) = 2004 THEN 1 ELSE 0 END) as n2004...