Get startedGet started for free

Starting to explore time series data

1. Starting to explore time series data

Welcome to the course! My name is Jacob and I'll be you instructor. In this course we will be exploring the relationships between time and other variables. This type of analysis is typically referred to as "time series analytics" because of the focus on how the value of a variable changes over time.

2. What is a "time series"?

The formal definition of a "time series" is a series of data points graphed in chronological order. These data points are commonly taken at equally spaced points in time, such as "months", "days", "hours", or "minutes".

3. Use cases for time series analysis

Time series analysis is the act of extracting meaningful statistics and insights from such data. Generally, the use cases for this are to better understand underlying patterns - for example cyclical - seasonal trends, systemic challenges, uncovering relationships between time and a target outcome, and informing a forecasting model. Some specific examples include deciphering weather patterns, monitoring heart rate, evaluating quarterly sales or interest rates.

4. Analyzing at different date grains

One of the fantastic things about time-based variables is how easy they can be transformed. It is a muse for creative analytics as time can be mutated into different grains and perspectives. For example, with the time variable "subscription_start_date", it can be analyzed by it's year, month, or day.

5. Analyzing at different date grains

Likewise, the specific hour of the day, minutes, and seconds can be parsed out and analyzed.

6. Mutating into different time variables

The creativity doesn't stop there. The date can be further decomposed into the day of the year, week of the year, day of the week, and so on.

7. Mutating into different time variables

Along with decomposing the date into individual parts, it can be compared to other dates to extract further information for analysis. For example, the subscription_start_date variable can be compared to the current date, 2021-12-22 in this case, to obtain the "age" of the subscription. Likewise, the age can be used to categorize an observation such as "new" vs. "old" subscriptions.

8. Measuring the change over a period of time

Another important type of a time series metric within business is the change over a determined period of time. Commonly, the period time will be a year, quarter, or month. It is referred to as a period-over-period change. It is calculated by subtracting the previous period value from the current period value and dividing by the previous period value. The result is the percentage change from the previous period. This type of metric can help dampen seasonal trends and discern long-term trends.

9. Measuring the change over a period of time

Here is an example of the month-over-month change for the price of a stock. We can see a general increase in stock price even though February is a decrease. January 2018 doesn't have a percentage change in this table because it is the first instance.

10. DAX functions for dates

The following exercises will leverage a couple of DAX date functions. Before jumping in, I'll introduce them here. First, the DATE function constructs a date value from parts (that is, year, month, and day). LEFT is a function which extracts a given number of characters from a set of characters, starting from the left side. RIGHT is the opposite function which extracts a given number of characters from a set of characters, starting from the right side. The MID function extracts a given number of characters from a set of characters, starting from a defined place in the set. Finally, WEEKDAY returns the day of the week as a number. Note: the default is to use the number 1 for Sunday, but this can be modified for example to use the number 1 for Monday.

11. Let's practice!

Now it's your turn to derive time-based variables and analyze trends.