Skip to main content

 

ThoughtSpot

Calculate the moving average

Overview

Explains what the feature is or what its benefits are to the user or customer.

Feature

You can use the moving formulas to compute a measure within a moving window of your data, usually defined by time.

This example will demonstrate using the moving_average formula. To use the moving function in a search:
  1. Start a new search.
    File:01_The_Basics/end_user_guide_bookmap/030/040/030/010/aggregation_answer.png

    Aggregation Answer example

  2. In the upper right hand side of the table, click Actions and select Add formula.
    File:01_The_Basics/end_user_guide_bookmap/030/040/030/010/create_formula_in_answer.png

    Create a new formula in an answer

  3. Enter the moving_average formula, providing a measure, a window, and one or more attributes. The example will return the average of revenue, within the commit date window size of 3. The window includes the previous, current, and next rows.
    The attributes are the ordering columns used to compute the moving average. The window is (current - Num1...Current + Num2) with both end points being included in the window. For example, "1,1" will have a window size of 3. To see periods in the past, use a negative number for the second endpoint, as in the example "moving_average(sales, 1, -1, date)".
    File:01_The_Basics/end_user_guide_bookmap/030/040/030/010/moving_average_formula.png

    Moving Average Formula

  4. Name the formula by clicking on its title and typing the new name. Click Save.
  5. The formula will appear in the search bar and in the table as its own column.
    File:01_The_Basics/end_user_guide_bookmap/030/040/030/010/moving_average_table.png

    Moving Average Table

    A box displaying the moving average within the entire table will appear at the bottom. You can click on it to toggle between aggregation types.

 

Moving window formulas video

  • Was this article helpful?