The ability to compare business performance with previous time periods is fundamental to understanding a business. Time comparisons allow businesses to analyze data that spans multiple time periods, providing a context for the data. Time Comparisons provide the ability to compare business performance with prior time periods.
Sales – This Year Sales – Last Year
How do they compare?
A business needs to make these comparisons across multiple time periods. For example, how do current sales compare to sales a year ago, a quarter ago, a month ago, and so on?
As Ralph Kimball states, SQL was not designed to make straightforward comparisons over time. There is no direct way in SQL to make time comparisons:
“The most difficult area of data warehousing is the translation of simple business analyses into SQL. SQL was not designed with business reports in mind. SQL was really an interim language designed to allow relational table semantics to be expressed in a convenient and accessible form, and to enable researchers and early developers to proceed with building the first relational systems in the mid-1970s. How else can you explain the fact that there is no direct way in SQL to compare this year to last year?” – Ralph Kimball
