Skip to main content

Time series analysis

You can compare data across different time periods easily, even without creating a custom formula.

Written by Connor Stallings
Updated this week

A time series is a collection of data points arranged sequentially by time. This is useful for understanding when events happened in relation to each other, like knowing a gift in January 2020 occurred before a gift in February 2020. Trends AI includes a time series analysis feature that helps you quickly find Charts related to this type of data.

You might use this feature to compare a specific time period with others, such as looking at donations for each month across several years. You can also calculate metrics like the growth rate over the same period across different years. Additionally, it allows for relative analysis, like reviewing donations for the last three months of each year over a multi-year period.

You can use one or more of the following period keywords to create this type of analysis.

Period Keywords

  • day

  • day of month

  • day of quarter

  • day of week

  • day of year

  • hour

  • hour of day

  • month of quarter

  • month of year

  • quarter

  • quarter of year

  • week of month

  • week of quarter

  • week of year

Day

  • Example

    Gifts by day

Day of month

  • Example

    Gifts by day of month by month

Day of quarter

  • Example

    Gifts by day of quarter by year

Day of week

  • Example

    Givers by week day of week

Day of year

  • Example

    Givers by day of year by year

Hour

  • Example

    Givers by hour weekly

Hour of day

  • Example

    Givers by hour of day

Month of quarter

  • Example

    Gifts by month of quarter by year

Quarter

  • Example

    Gifts by quarter

Quarter of year

  • Example

    Gifts quarter of year last 4 years yearly

Week of month

  • Example

    Gifts vy week of month yearly

Week of quarter

  • Example

    revenue week of quarter

Week of year

  • Example

    new products week of year last 3 years yearly

Trends AI uses the ISO week format for the week of [month | quarter | year] keywords. This means the last few days of a quarter may sometimes appear as the first few days of the next quarter, based on the ISO week date system.

All of these keywords sort the data using date and time semantics, arranging it chronologically in a time sequence. When you enter one of these keywords in the Chart Builder, Trends AI will prompt you to select the data source to apply it to. By default, the Chart Builder suggests these keywords less frequently than others.

You can also use these keywords along with the following existing data keywords:

  • Detailed

  • Hourly

  • Daily

  • Weekly

  • Monthly

  • Quarterly

  • Yearly

Examples of Time Series Analysis

When searching for Charts related to series data, the resulting visualizations are typically line charts. These often, but not always, include a stack to represent a specific period. For example, here is a sample line chart for the total amount given by a monthly recurring schedule:

When you search for a particular aspect of time series data, the typical output is a line chart showing how that aspect changes over time. You can also add a relative date filter to your search. For example:

total amount by yearly transaction date >= 01/01/2022 month before 01/01/2025

The child date time attribute is placed on the x-axis, and the parent is shown in the legend. For instance, if you search for revenue month yearly, the child, monthly, appears on the x-axis, and the parent, yearly, appears in the legend.

Granularity for Date Filters

You can refine simple date filters by adding a hierarchical date filter to your query. Examples of this capability include specifying two bucket granularities, such as "hour of day" or "week of year." The syntax for this type of query is:

small_bucket of big_bucket [INTEGER_CONDITION]

The INTEGER_CONDITION is optional, but it must be an integer. For example, this query is valid:

Gifts by day of week <= 2

This query, however, is invalid:

revenue by day of week = Tuesday

You can specify one or more granular filters.

The following tips and considerations apply to time granularity:

  • The system's defined fiscal rules are applied. For example, if the fiscal year begins in February, then month of year = 2 dates will match in March.

  • Fiscal shorthands like Q1, Q2, etc., are not supported, so day of week = d1 is not valid.

  • INTEGER_CONDITION used with = or != accepts a list of filter values, making day of week = 1 2 3 valid.

  • INTEGER_CONDITION used with = or != requires legal values. For instance, day of week > accepts any integer on the right side, while day of week = requires a value within the legal 1-7 range.

  • While simple date filters allow you to edit the filter directly through the Chart to refine your search, adding a hierarchical date filter in the Chart Builder disables this ability.

Create a max(date) field and use it to filter

If your data set includes a date field and you want to display only the most recent data based on a specific date, follow these steps:

  1. Create a formula called Max Date.

    For example:

     date = group_max ( date_to_filter_by )

  2. In the Chart Builder, filter your dates using this formula.

    For example:

     max date = true

    This will only display the fields that pass the filter.

Did this answer your question?