Friday, May 12, 2023

Analytical Calendar - 005 - Date Comparison

Post Index

 Analytical Calendar The Story | The Index Page

2023-05-12

Analytical Calendar

Date Comparison

Date comparison is another typical operation in data analytics. Firstly, a time period is selected and then it is compared with another time period. There are two typical methods to do the comparison: one is to make use of the comparison unit and comparison range. And the other is simply to select the required period of time.



Comparison Unit and Range

Comparison unit and range is to provide a date unit and a number as the range. The comparison unit consists of all the date components including year, quarter, month, week and date. Comparison range is an integer that describes the duration for the comparison unit, i.e. how many comparison unit before. E.g. Comparison Unit = Month and comparison range = 2, it means 2 month before. Comparison starts from one in general.

For example, compare 1 year before has a general term called Year-Over-Year (YOY) comparison where year is the comparison unit and 1 is the range. Another example, compare 1 month before has a general term called Month-Over-Month (MOM) comparison where month is the comparison unit and 1 is the range.


Custom Comparison

Custom comparison is less complicated than the comparison unit and range. It only requires picking a start date and an end date to indicate a period of time. All dates included with the start (inclusive) and end dates (inclusive) will be the dates required for comparison.

The majority of the time, we require custom comparison to accommodate irregular date ranges for specific needs for analysis. For example, Lunar new year has different dates each year and comparison unit and range cannot help in this case. The only option is to directly select the specified range of dates. Other examples like, seasonal periods, non-fixed date holidays, Black Friday, etc. are all required using custom comparison.


 

Previous Section <== 004 - Analytical Calendar - Date Comparison




 

No comments:

Post a Comment