> ## Documentation Index
> Fetch the complete documentation index at: https://docs.maia.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Window Calculation

export const ComponentMetadata = ({warehouses, unsupportedWarehouses = [], componentType, connectionInputs, connectionOutputs}) => {
  const allWarehouses = [...warehouses.map(w => ({
    name: w,
    supported: true
  })), ...unsupportedWarehouses.map(w => ({
    name: w,
    supported: false
  }))];
  return <div style={{
    background: 'var(--colors-background-light, #f9fafb)',
    border: '1px solid var(--colors-border-default, #e5e7eb)',
    borderRadius: '12px',
    padding: '20px 28px',
    marginBottom: '28px',
    boxShadow: '0 1px 4px rgba(0,0,0,0.10)'
  }}>
      <table style={{
    width: '100%',
    borderCollapse: 'collapse'
  }}>
        <tbody>
          <tr>
            <td style={{
    fontWeight: '600',
    paddingRight: '32px',
    paddingBottom: '14px',
    whiteSpace: 'nowrap',
    verticalAlign: 'middle',
    width: '180px'
  }}>Project Availability</td>
            <td style={{
    paddingBottom: '14px',
    verticalAlign: 'middle'
  }}>
              <div style={{
    display: 'flex',
    flexWrap: 'wrap',
    gap: '8px'
  }}>
                {allWarehouses.map((w, i) => <span key={i} style={{
    background: w.supported ? '#dcfce7' : '#fee2e2',
    color: w.supported ? '#15803d' : '#b91c1c',
    border: `1px solid ${w.supported ? '#bbf7d0' : '#fca5a5'}`,
    borderRadius: '9999px',
    padding: '3px 12px',
    fontSize: '0.85rem',
    fontWeight: '500',
    whiteSpace: 'nowrap'
  }}>
                    {w.name} {w.supported ? '✅' : '❌'}
                  </span>)}
              </div>
            </td>
          </tr>
          <tr>
            <td style={{
    fontWeight: '600',
    paddingRight: '32px',
    paddingBottom: '14px',
    whiteSpace: 'nowrap',
    verticalAlign: 'middle'
  }}>Component Type</td>
            <td style={{
    paddingBottom: '14px',
    verticalAlign: 'middle'
  }}>{componentType}</td>
          </tr>
          <tr>
            <td style={{
    fontWeight: '600',
    paddingRight: '32px',
    paddingBottom: '14px',
    whiteSpace: 'nowrap',
    verticalAlign: 'middle'
  }}>Connection Inputs</td>
            <td style={{
    paddingBottom: '14px',
    verticalAlign: 'middle'
  }}>{connectionInputs}</td>
          </tr>
          <tr>
            <td style={{
    fontWeight: '600',
    paddingRight: '32px',
    whiteSpace: 'nowrap',
    verticalAlign: 'middle'
  }}>Connection Outputs</td>
            <td style={{
    verticalAlign: 'middle'
  }}>{connectionOutputs}</td>
          </tr>
        </tbody>
      </table>
    </div>;
};

<ComponentMetadata warehouses={["Snowflake", "Databricks", "Amazon Redshift", "Google BigQuery"]} componentType="Transformation" connectionInputs="One" connectionOutputs="Unlimited" />

The **Window Calculation** transformation component lets you use SQL window functions to analyze a subset of the input datastream. Window functions operate across a "window" of rows relative to the current row, without collapsing them (unlike aggregation).

A window function operates on a group of related rows known as a partition. A partition is usually a logical grouping of rows. You specify how the upper and lower bounds of the partition are determined, expressed as an offset from the current row. Window function results are calculated for each row within each partition, with the calculation taking into account all the rows within the specified offset from the current row.

This is equivalent to an SQL function using the **OVER** and **PARTITION BY** clauses.

The available window functions depend on your cloud data warehouse. For more information, read the following:

* [Snowflake window functions documentation](https://docs.snowflake.com/en/sql-reference/functions-analytic.html)
* [Databricks window functions documentation](https://docs.databricks.com/sql/language-manual/sql-ref-window-functions.html)
* [Amazon Redshift window functions documentation](https://docs.aws.amazon.com/redshift/latest/dg/c_Window_functions.html)
* [Google BigQuery analytic functions documentation](https://docs.cloud.google.com/bigquery/docs/reference/standard-sql/analytic-function-concepts)

The full list of supported functions is given under the **Function** property, below.

<Note>
  Window functions share some similarities with aggregate functions, and for some use cases you may find that the [Aggregate](/docs/components/aggregate) component will serve your needs better. Bear the following in mind when evaluating which component best suits your use case:

  * For an aggregate function, the input is a group of rows from the dataset, and the output is one row (so the aggregated group is collapsed into a single row).
  * For a window function, the input is every row within the dataset, and the output is one row per input row.

  For example, the SUM aggregate function returns a single total for all of the input rows, whereas the SUM window function returns one total for each input row, calculated from all the rows in the partition.
</Note>

### Use case

Window functions enable a range of advanced analytics such as ranking, time-series processing, and data comparison. Some typical uses for window functions include:

* Calculating cumulative totals across a sequence. For example, cumulative sales per customer. This would use the **SUM** window function.
* Calculating a moving average across a set of data. For example, to smooth out fluctuations in time-series data. This would use the **Average** window function.
* Identifying the first or last value in a set of ordered rows. This would use the **First Value** or **Last Value** window function.

***

## Properties

<Tabs>
  <Tab title="Snowflake">
    <ResponseField name="Name" type="string" required>
      A human-readable name for the component.
    </ResponseField>

    {/* <!-- param-start:[includeInputColumns] | warehouses: [snowflake] --> */}

    <ResponseField name="Include input columns" type="boolean" required>
      Defines whether the component passes all input columns into the output. The default is **Yes**.
    </ResponseField>

    {/* <!-- param-start:[partitionData] | warehouses: [snowflake] --> */}

    <ResponseField name="Partition data" type="dual listbox">
      Select the columns that will define how the input data is partitioned. The window calculation will be performed on each partition.
    </ResponseField>

    {/* <!-- param-start:[orderingWithinPartitions] | warehouses: [snowflake] --> */}

    <ResponseField name="Ordering within partitions" type="column editor">
      Select the columns that will be used to sort the partitioned data. For each column, select the sort order:

      * **Ascending**
      * **Descending**
      * **Nulls First** (sort null values first)
      * **Nulls Last** (sort null values last)

      You can select multiple columns to create a complex sort. You can drag the selected columns to reorder the sort level if required.
    </ResponseField>

    {/* <!-- param-start:[functions] | warehouses: [snowflake] --> */}

    <ResponseField name="Functions" type="column editor" required>
      Select a function to be performed on the rows contained in the window. Refer to the [Snowflake Window Function](https://docs.snowflake.com/en/sql-reference/functions-analytic.html) documentation for full details.

      Supported window functions:

      * **Any Value:** Returns some value of the expression from the group. For full details, read the [Snowflake](https://docs.snowflake.com/en/sql-reference/functions/any_value) documentation.
      * **Approximate Count Distinct:** Uses HyperLogLog to return an approximation of the distinct cardinality of the input. For full details, read the [Snowflake](https://docs.snowflake.com/en/sql-reference/functions/approx_count_distinct) documentation.
      * **Array Aggregate Distinct:** Returns the input values, pivoted into an array. For full details, read the [Snowflake](https://docs.snowflake.com/en/sql-reference/functions/array_agg) documentation.
      * **Average:** Returns the average (arithmetic mean) of the input column values in the window. For full details, read the [Snowflake](https://docs.snowflake.com/en/sql-reference/functions/avg) documentation.
      * **Bit AND Aggregate:** Returns the bitwise AND value of all non-Null numeric records in a group. For full details, read the [Snowflake](https://docs.snowflake.com/en/sql-reference/functions/bitand_agg) documentation.
      * **Bit OR Aggregate:** Returns the bitwise OR value of all non-Null numeric records in a group. For full details, read the [Snowflake](https://docs.snowflake.com/en/sql-reference/functions/bitor_agg) documentation.
      * **Bit XOR Aggregate:** Returns the bitwise XOR value of all non-Null numeric records in a group. For full details, read the [Snowflake](https://docs.snowflake.com/en/sql-reference/functions/bitxor_agg) documentation.
      * **Conditional Change Event:** Returns a window event number for each row where the value of an argument is different from the value of the argument in the previous row. For full details, read the [Snowflake](https://docs.snowflake.com/en/sql-reference/functions/conditional_change_event) documentation.
      * **Conditional True Event:** Returns a window event number for each row within a window partition based on the result of a boolean argument. For full details, read the [Snowflake](https://docs.snowflake.com/en/sql-reference/functions/conditional_true_event) documentation.
      * **Count:** Returns a count of the non-Null values for the specified field. For full details, read the [Snowflake](https://docs.snowflake.com/en/sql-reference/functions/count) documentation.
      * **First Value:** Given an ordered set of rows, returns the specified column value with respect to the first row in the window frame. For full details, read the [Snowflake](https://docs.snowflake.com/en/sql-reference/functions/first_value) documentation.
      * **Hash Aggregate:** Returns an aggregate signed 64-bit hash value over the (unordered) set of input rows. For full details, read the [Snowflake](https://docs.snowflake.com/en/sql-reference/functions/hash_agg) documentation.
      * **Kurtosis:** Returns the population excess kurtosis of non-Null records. For full details, read the [Snowflake](https://docs.snowflake.com/en/sql-reference/functions/kurtosis) documentation.
      * **Last Value:** Given an ordered set of rows, returns the specified column value with respect to the last row in the window frame. For full details, read the [Snowflake](https://docs.snowflake.com/en/sql-reference/functions/last_value) documentation.
      * **List Aggregate:** Returns the concatenated input values, separated by a delimiter string. For full details, read the [Snowflake](https://docs.snowflake.com/en/sql-reference/functions/listagg) documentation.
      * **List Aggregate Distinct:** Returns the concatenated input values, separated by a delimiter string. Duplicate values are eliminated before concatenating. For full details, read the [Snowflake](https://docs.snowflake.com/en/sql-reference/functions/listagg) documentation.
      * **Maximum:** Returns the maximum of the input expression values. The MAX function works with numeric values and ignores Null values. For full details, read the [Snowflake](https://docs.snowflake.com/en/sql-reference/functions/max) documentation.
      * **Median:** Calculates the median value for the range of values in a window or partition. Null values in the range are ignored. For full details, read the [Snowflake](https://docs.snowflake.com/en/sql-reference/functions/median) documentation.
      * **Minimum:** Returns the minimum of the input expression values. The MIN function works with numeric values and ignores Null values. For full details, read the [Snowflake](https://docs.snowflake.com/en/sql-reference/functions/min) documentation.
      * **Population Variance:** Returns the population variance of a set of numeric columns. For full details, read the [Snowflake](https://docs.snowflake.com/en/sql-reference/functions/var_pop) documentation.
      * **Sample Variance:** Returns the sample variance of a set of numeric columns. For full details, read the [Snowflake](https://docs.snowflake.com/en/sql-reference/functions/var_samp) documentation.
      * **Standard Deviation:** Returns the standard deviation of a set of numeric values. For full details, read the [Snowflake](https://docs.snowflake.com/en/sql-reference/functions/stddev) documentation.
      * **Standard Deviation Population:** Returns the population standard deviation of a set of numeric values. For full details, read the [Snowflake](https://docs.snowflake.com/en/sql-reference/functions/stddev_pop) documentation.
      * **Sum:** Returns the sum of the input column in the window. For full details, read the [Snowflake](https://docs.snowflake.com/en/sql-reference/functions/sum) documentation.

      Multiple functions can be selected. For each function, select the **Input Column** that the function will act on, and the **Output Column** that the result will be written to.
    </ResponseField>

    {/* <!-- param-start:[lowerBound] | warehouses: [snowflake] --> */}

    <ResponseField name="Lower bound" type="drop-down" required>
      This property is visible after **Ordering within partitions** is set. Select which row of the partition the window calculation will start on. Options are:

      * **unbounded preceding:** The window starts at the first row of the partition.
      * **current row:** The window starts at the current row.
      * **offset preceding:** The window starts a number of rows (offset) before the current row. This requires you to set the **Lower bound offset** property.
    </ResponseField>

    {/* <!-- param-start:[upperBound] | warehouses: [snowflake] --> */}

    <ResponseField name="Upper bound" type="drop-down" required>
      This property is visible after **Ordering within partitions** is set. Select which row of the partition the window calculation will end on. Options are:

      * **unbounded following:** The window ends at the last row of the partition.
      * **current row:** The window ends at the current row.
      * **offset following:** The window ends a number of rows (offset) after the current row. This requires you to set the **Upper bound offset** property.
    </ResponseField>

    {/* <!-- param-start:[lowerBoundOffset] | warehouses: [snowflake] --> */}

    <ResponseField name="Lower bound offset" type="integer" required>
      If the **Lower bound** property is set to **offset preceding**, enter the number of rows before the current row that the window will start on.
    </ResponseField>

    {/* <!-- param-start:[upperBoundOffset] | warehouses: [snowflake] --> */}

    <ResponseField name="Upper bound offset" type="integer" required>
      If the **Upper bound** property is set to **offset following**, enter the number of rows after the current row that the window will end on.
    </ResponseField>
  </Tab>

  <Tab title="Databricks">
    <ResponseField name="Name" type="string" required>
      A human-readable name for the component.
    </ResponseField>

    {/* <!-- param-start:[includeInputColumns] | warehouses: [databricks] --> */}

    <ResponseField name="Include input columns" type="boolean" required>
      Defines whether the component passes all input columns into the output. The default is **Yes**.
    </ResponseField>

    {/* <!-- param-start:[partitionData] | warehouses: [databricks] --> */}

    <ResponseField name="Partition data" type="dual listbox">
      Select the columns that will define how the input data is partitioned. The window calculation will be performed on each partition.
    </ResponseField>

    {/* <!-- param-start:[orderingWithinPartitions] | warehouses: [databricks] --> */}

    <ResponseField name="Ordering within partitions" type="column editor">
      Select the columns that will be used to sort the partitioned data. For each column, select the sort order:

      * **Ascending**
      * **Descending**
      * **Nulls First** (sort null values first)
      * **Nulls Last** (sort null values last)
    </ResponseField>

    {/* <!-- param-start:[functions] | warehouses: [databricks] --> */}

    <ResponseField name="Functions" type="column editor" required>
      Select a function to be performed on the rows contained in the window. Refer to the [Databricks window functions documentation](https://docs.databricks.com/sql/language-manual/sql-ref-window-functions.html) for full details.

      Supported window functions:

      * **Average:** Returns the average (arithmetic mean) of the input column values in the window. For full details, read the [Databricks](https://docs.databricks.com/sql/language-manual/functions/avg.html) documentation.
      * **Count:** Returns a count of the non-Null values for the specified field. For full details, read the [Databricks](https://docs.databricks.com/sql/language-manual/functions/count.html) documentation.
      * **First Value:** Given an ordered set of rows, returns the specified column value with respect to the first row in the window frame. For full details, read the [Databricks](https://docs.databricks.com/sql/language-manual/functions/first_value.html) documentation.
      * **Last Value:** Given an ordered set of rows, returns the specified column value with respect to the last row in the window frame. For full details, read the [Databricks](https://docs.databricks.com/sql/language-manual/functions/last.html) documentation.
      * **Maximum:** Returns the maximum of the input expression values. The MAX function works with numeric values and ignores Null values. For full details, read the [Databricks](https://docs.databricks.com/sql/language-manual/functions/max.html) documentation.
      * **Minimum:** Returns the minimum of the input expression values. The MIN function works with numeric values and ignores Null values. For full details, read the [Databricks](https://docs.databricks.com/sql/language-manual/functions/min.html) documentation.
      * **Population Variance:** Returns the population variance of a set of numeric columns. For full details, read the [Databricks](https://docs.databricks.com/sql/language-manual/functions/var_pop.html) documentation.
      * **Sample Variance:** Returns the sample variance of a set of numeric columns. For full details, read the [Databricks](https://docs.databricks.com/sql/language-manual/functions/var_samp.html) documentation.
      * **Standard Deviation:** Returns the standard deviation of a set of numeric values. For full details, read the [Databricks](https://docs.databricks.com/sql/language-manual/functions/stddev_pop.html) documentation.
      * **Standard Deviation Population:** Returns the population standard deviation of a set of numeric values. For full details, read the [Databricks](https://docs.databricks.com/sql/language-manual/functions/stddev_pop.html) documentation.
      * **Sum:** Returns the sum of the input column in the window. For full details, read the [Databricks](https://docs.databricks.com/sql/language-manual/functions/sum.html) documentation.

      Multiple functions can be selected. For each function, select the **Input Column** that the function will act on, and the **Output Column** that the result will be written to.
    </ResponseField>

    {/* <!-- param-start:[lowerBound] | warehouses: [databricks] --> */}

    <ResponseField name="Lower bound" type="drop-down" required>
      This property is visible after **Ordering within partitions** is set. Select which row of the partition the window calculation will start on. Options are:

      * **unbounded preceding:** The window starts at the first row of the partition.
      * **current row:** The window starts at the current row.
      * **offset preceding:** The window starts a number of rows (offset) before the current row. This requires you to set the **Lower bound offset** property.
    </ResponseField>

    {/* <!-- param-start:[upperBound] | warehouses: [databricks] --> */}

    <ResponseField name="Upper bound" type="drop-down" required>
      This property is visible after **Ordering within partitions** is set. Select which row of the partition the window calculation will end on. Options are:

      * **unbounded following:** The window ends at the last row of the partition.
      * **current row:** The window ends at the current row.
      * **offset following:** The window ends a number of rows (offset) after the current row. This requires you to set the **Upper bound offset** property.
    </ResponseField>

    {/* <!-- param-start:[lowerBoundOffset] | warehouses: [databricks] --> */}

    <ResponseField name="Lower bound offset" type="integer" required>
      If the **Lower bound** property is set to **offset preceding**, enter the number of rows before the current row that the window will start on.
    </ResponseField>

    {/* <!-- param-start:[upperBoundOffset] | warehouses: [databricks] --> */}

    <ResponseField name="Upper bound offset" type="integer" required>
      If the **Upper bound** property is set to **offset following**, enter the number of rows after the current row that the window will end on.
    </ResponseField>
  </Tab>

  <Tab title="Amazon Redshift">
    <ResponseField name="Name" type="string" required>
      A human-readable name for the component.
    </ResponseField>

    {/* <!-- param-start:[includeInputColumns] | warehouses: [redshift] --> */}

    <ResponseField name="Include input columns" type="boolean" required>
      Defines whether the component passes all input columns into the output. The default is **Yes**.
    </ResponseField>

    {/* <!-- param-start:[partitionData] | warehouses: [redshift] --> */}

    <ResponseField name="Partition data" type="dual listbox">
      Select the columns that will define how the input data is partitioned. The window calculation will be performed on each partition.
    </ResponseField>

    {/* <!-- param-start:[orderingWithinPartitions] | warehouses: [redshift] --> */}

    <ResponseField name="Ordering within partitions" type="column editor">
      Select the columns that will be used to sort the partitioned data. For each column, select the sort order:

      * **Ascending**
      * **Descending**
      * **Nulls First** (sort null values first)
      * **Nulls Last** (sort null values last)
    </ResponseField>

    {/* <!-- param-start:[functions] | warehouses: [redshift] --> */}

    <ResponseField name="Functions" type="column editor" required>
      Select a function to be performed on the rows contained in the window. Refer to the [Amazon Redshift Window Function](https://docs.aws.amazon.com/redshift/latest/dg/c_Window_functions.html) documentation for full details.

      Supported window functions:

      * **Average:** Returns the average (arithmetic mean) of the input column values in the window. For full details, read the [Amazon Redshift](https://docs.aws.amazon.com/redshift/latest/dg/r_WF_AVG.html) documentation.
      * **Count:** Returns a count of the non-Null values for the specified field. For full details, read the [Amazon Redshift](https://docs.aws.amazon.com/redshift/latest/dg/r_WF_COUNT.html) documentation.
      * **First Value:** Given an ordered set of rows, returns the specified column value with respect to the first row in the window frame. For full details, read the [Amazon Redshift](https://docs.aws.amazon.com/clean-rooms/latest/sql-reference/r_WF_first_value.html) documentation.
      * **Last Value:** Given an ordered set of rows, returns the specified column value with respect to the last row in the window frame. For full details, read the [Amazon Redshift](https://docs.aws.amazon.com/clean-rooms/latest/sql-reference/r_WF_last_value.html) documentation.
      * **List Aggregate:** Returns the concatenated input values, separated by a delimiter string. Redshift doesn't support ordering within partitions for this function, so that option won't be applied to the results if selected. For full details, read the [Amazon Redshift](https://docs.aws.amazon.com/redshift/latest/dg/r_WF_LISTAGG.html) documentation.
      * **Maximum:** Returns the maximum of the input expression values. The MAX function works with numeric values and ignores Null values. For full details, read the [Amazon Redshift](https://docs.aws.amazon.com/clean-rooms/latest/sql-reference/r_WF_MAX.html) documentation.
      * **Median:** Calculates the median value for the range of values in a window or partition. Null values in the range are ignored. Redshift doesn't support ordering within partitions for this function, so that option won't be applied to the results if selected. For full details, read the [Amazon Redshift](https://docs.aws.amazon.com/clean-rooms/latest/sql-reference/r_WF_MEDIAN.html) documentation.
      * **Minimum:** Returns the minimum of the input expression values. The MIN function works with numeric values and ignores Null values. For full details, read the [Amazon Redshift](https://docs.aws.amazon.com/redshift/latest/dg/r_WF_MIN.html) documentation.
      * **Population Variance:** Returns the population variance of a set of numeric columns. For full details, read the [Amazon Redshift](https://docs.aws.amazon.com/redshift/latest/dg/r_WF_VARIANCE.html) documentation.
      * **Sample Variance:** Returns the sample variance of a set of numeric columns. For full details, read the [Amazon Redshift](https://docs.aws.amazon.com/redshift/latest/dg/r_WF_VARIANCE.html) documentation.
      * **Standard Deviation:** Returns the standard deviation of a set of numeric values. For full details, read the [Amazon Redshift](https://docs.aws.amazon.com/redshift/latest/dg/r_WF_STDDEV.html) documentation.
      * **Standard Deviation Population:** Returns the population standard deviation of a set of numeric values. For full details, read the [Amazon Redshift](https://docs.aws.amazon.com/redshift/latest/dg/r_WF_STDDEV.html) documentation.
      * **Sum:** Returns the sum of the input column in the window. For full details, read the [Amazon Redshift](https://docs.aws.amazon.com/redshift/latest/dg/r_WF_SUM.html) documentation.

      Multiple functions can be selected. For each function, select the **Input Column** that the function will act on, and the **Output Column** that the result will be written to.
    </ResponseField>

    {/* <!-- param-start:[lowerBound] | warehouses: [redshift] --> */}

    <ResponseField name="Lower bound" type="drop-down" required>
      This property is visible after **Ordering within partitions** is set. Select which row of the partition the window calculation will start on. Options are:

      * **unbounded preceding:** The window starts at the first row of the partition.
      * **current row:** The window starts at the current row.
      * **offset preceding:** The window starts a number of rows (offset) before the current row. This requires you to set the **Lower bound offset** property.
    </ResponseField>

    {/* <!-- param-start:[upperBound] | warehouses: [redshift] --> */}

    <ResponseField name="Upper bound" type="drop-down" required>
      This property is visible after **Ordering within partitions** is set. Select which row of the partition the window calculation will end on. Options are:

      * **unbounded following:** The window ends at the last row of the partition.
      * **current row:** The window ends at the current row.
      * **offset following:** The window ends a number of rows (offset) after the current row. This requires you to set the **Upper bound offset** property.
    </ResponseField>

    {/* <!-- param-start:[lowerBoundOffset] | warehouses: [redshift] --> */}

    <ResponseField name="Lower bound offset" type="integer" required>
      If the **Lower bound** property is set to **offset preceding**, enter the number of rows before the current row that the window will start on.
    </ResponseField>

    {/* <!-- param-start:[upperBoundOffset] | warehouses: [redshift] --> */}

    <ResponseField name="Upper bound offset" type="integer" required>
      If the **Upper bound** property is set to **offset following**, enter the number of rows after the current row that the window will end on.
    </ResponseField>
  </Tab>

  <Tab title="Google BigQuery">
    <ResponseField name="Name" type="string" required>
      A human-readable name for the component.
    </ResponseField>

    {/* <!-- param-start:[includeInputColumns] | warehouses: [bigquery] --> */}

    <ResponseField name="Include input columns" type="boolean" required>
      Defines whether the component passes all input columns into the output. The default is **Yes**.
    </ResponseField>

    {/* <!-- param-start:[partitionData] | warehouses: [bigquery] --> */}

    <ResponseField name="Partition data" type="dual listbox">
      Select the columns that will define how the input data is partitioned. The window calculation will be performed on each partition.
    </ResponseField>

    {/* <!-- param-start:[orderingWithinPartitions] | warehouses: [bigquery] --> */}

    <ResponseField name="Ordering within partitions" type="column editor">
      Select the columns that will be used to sort the partitioned data. For each column, select the sort order:

      * **Ascending**
      * **Descending**
    </ResponseField>

    {/* <!-- param-start:[functions] | warehouses: [bigquery] --> */}

    <ResponseField name="Functions" type="column editor" required>
      Select a function to be performed on the rows contained in the window. Refer to the [Google BigQuery analytic functions documentation](https://docs.cloud.google.com/bigquery/docs/reference/standard-sql/analytic-function-concepts) for full details.

      Supported window functions:

      * **Average:** Returns the average (arithmetic mean) of the input column values in the window. For full details, read the [Google BigQuery](https://docs.cloud.google.com/bigquery/docs/reference/standard-sql/aggregate_analytic_functions#avg) documentation.
      * **Count:** Returns a count of the non-Null values for the specified field. For full details, read the [Google BigQuery](https://docs.cloud.google.com/bigquery/docs/reference/standard-sql/aggregate_analytic_functions#count) documentation.
      * **First Value:** Given an ordered set of rows, returns the specified column value with respect to the first row in the window frame. For full details, read the [Google BigQuery](https://docs.cloud.google.com/bigquery/docs/reference/standard-sql/navigation_functions#first_value) documentation.
      * **Last Value:** Given an ordered set of rows, returns the specified column value with respect to the last row in the window frame. For full details, read the [Google BigQuery](https://docs.cloud.google.com/bigquery/docs/reference/standard-sql/navigation_functions#last_value) documentation.
      * **Maximum:** Returns the maximum of the input expression values. The MAX function works with numeric values and ignores Null values. For full details, read the [Google BigQuery](https://docs.cloud.google.com/bigquery/docs/reference/standard-sql/aggregate_analytic_functions#max) documentation.
      * **Minimum:** Returns the minimum of the input expression values. The MIN function works with numeric values and ignores Null values. For full details, read the [Google BigQuery](https://docs.cloud.google.com/bigquery/docs/reference/standard-sql/aggregate_analytic_functions#min) documentation.
      * **Population Variance:** Returns the population variance of a set of numeric columns. For full details, read the [Google BigQuery](https://docs.cloud.google.com/bigquery/docs/reference/standard-sql/aggregate_analytic_functions#var_pop) documentation.
      * **Sample Variance:** Returns the sample variance of a set of numeric columns. For full details, read the [Google BigQuery](https://docs.cloud.google.com/bigquery/docs/reference/standard-sql/aggregate_analytic_functions#var_samp) documentation.
      * **Standard Deviation:** Returns the standard deviation of a set of numeric values. For full details, read the [Google BigQuery](https://docs.cloud.google.com/bigquery/docs/reference/standard-sql/aggregate_analytic_functions#stddev) documentation.
      * **Standard Deviation Population:** Returns the population standard deviation of a set of numeric values. For full details, read the [Google BigQuery](https://docs.cloud.google.com/bigquery/docs/reference/standard-sql/aggregate_analytic_functions#stddev_pop) documentation.
      * **Sum:** Returns the sum of the input column in the window. For full details, read the [Google BigQuery](https://docs.cloud.google.com/bigquery/docs/reference/standard-sql/aggregate_analytic_functions#sum) documentation.

      Multiple functions can be selected. For each function, select the **Input Column** that the function will act on, and the **Output Column** that the result will be written to.
    </ResponseField>

    {/* <!-- param-start:[lowerBound] | warehouses: [bigquery] --> */}

    <ResponseField name="Lower bound" type="drop-down" required>
      This property is visible after **Ordering within partitions** is set. Select which row of the partition the window calculation will start on. Options are:

      * **unbounded preceding:** The window starts at the first row of the partition.
      * **current row:** The window starts at the current row.
      * **offset preceding:** The window starts a number of rows (offset) before the current row. This requires you to set the **Lower bound offset** property.
    </ResponseField>

    {/* <!-- param-start:[upperBound] | warehouses: [bigquery] --> */}

    <ResponseField name="Upper bound" type="drop-down" required>
      This property is visible after **Ordering within partitions** is set. Select which row of the partition the window calculation will end on. Options are:

      * **unbounded following:** The window ends at the last row of the partition.
      * **current row:** The window ends at the current row.
      * **offset following:** The window ends a number of rows (offset) after the current row. This requires you to set the **Upper bound offset** property.
    </ResponseField>

    {/* <!-- param-start:[lowerBoundOffset] | warehouses: [bigquery] --> */}

    <ResponseField name="Lower bound offset" type="integer" required>
      If the **Lower bound** property is set to **offset preceding**, enter the number of rows before the current row that the window will start on.
    </ResponseField>

    {/* <!-- param-start:[upperBoundOffset] | warehouses: [bigquery] --> */}

    <ResponseField name="Upper bound offset" type="integer" required>
      If the **Upper bound** property is set to **offset following**, enter the number of rows after the current row that the window will end on.
    </ResponseField>
  </Tab>
</Tabs>
