A time series is a set of data points ordered by time. For example, within the same week a sale on Tuesday comes before a sale on Wednesday in such a data set. You can use ThoughtSpot’s time series analysis feature to search for answers about series data.
You might use this feature to compare a time period across other time periods. For examples sales for each month across several years. You may also want to calculate an aspect such as growth over the same time period across other periods. You can also do relative analysis such as sales for the last 3 months of each year across years.
You can use one or more of the following period keywords to create this type of analysis:
|quarter of year (date)||
|month of quarter (date)||
|week of year (date)||
|week of quarter (date)||
|week of month (date)||
|day of year (date)||
|day of quarter (date)||
|day of month (date)||
|day of week (date)||
All of these keywords sort the data using datetime semantics, that is chronologically in a time sequence. By default, the Search bar suggests these keywords less frequently than others.
You can use these new keywords in combination with the existing data keywords which are:
Examples of time series analysis
Typically, when you search for answers about series data, the visualizations that answer your questions are line charts. These charts frequently but not always include a stack to indicate a period.
When you search for an aspect of data of time series, a typical response is a line chart showing the aspect as it rises and falls over time.
You can also add a relative date filter for example,
total revenue quarterly yearly by year month(commit date) >= 01/01/1995 month(commit date) before 01/01/1998
This type of query also yields a stacked line chart:
The child date time attribute is on the X-axis and the parent in the legend. For
example, if you search
revenue month yearly the child,
monthly, appears on
the x-axis and the parent,
yearly, in the legend.
Granularity for date filters
You can refine a simple date filters by adding hierarchical date filter to your query. The ability to specify two bucket granularities such as “hour of day” or “week of year” are two examples. The syntax of this type of query is
small_bucket of big_bucket [INTEGER_CONDITION]
INTEGER_CONDITION is optional but it must be an integer. For example, this
query is valid:
revenue by day of week <= 2
This query is invalid:
revenue by day of week = Tuesday
You can specify one or more granular filters.
These tips and gotchas apply to time granularity:
- The system-defined fiscal rules are respected. This
means, for example, if the fiscal year begins in February,
month of year = 2matches dates in March.
- Fiscal shorthands such as
Q2and so on are not supported, so
day of week = d1is not valid.
!=accept a list of filter values, so,
day of week = 1 2 3is valid.
!=require legal values, so
day of week >accepts any integer on the right hand side while
day of week =requires a value in the legal
- Simple date filters allow you to use edit the filter through the answer to refine your search, adding a a hierarchical date filter in the search bar disables this ability.
Create a max(date) field and use it to filter
If you have a date field in your data set and want to return the most recent set of data based on a specific date, do the following:
Create a formula called
date = group_max ( date_to_filter_by )
In the search bar, filter your dates by this formula.
max date = true
This returns only those fields that pass the filter.