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

# aggregate_table

> **Aggregate table**

Compute measures over a table or worksheet, optionally grouped; pivot_table lays measures out as a cross-tab of row and column dimensions with totals, and read_table returns individual rows. Array columns group on the whole array value unless expanded with `arrayExpansions`. singleSelect and bucketed values are option ids that `columns[].options` maps to labels. `pagination.truncated` means more groups exist than were returned.



## OpenAPI

````yaml /api-reference/tools-openapi.json post /v1/aggregate_table
openapi: 3.1.0
info:
  title: Rippit API
  version: 1.0.0
  description: Every operation is also an MCP tool with the same name and parameters.
servers:
  - url: https://api.rippit.com
security:
  - bearer: []
paths:
  /v1/aggregate_table:
    post:
      summary: aggregate_table
      description: >-
        **Aggregate table**


        Compute measures over a table or worksheet, optionally grouped;
        pivot_table lays measures out as a cross-tab of row and column
        dimensions with totals, and read_table returns individual rows. Array
        columns group on the whole array value unless expanded with
        `arrayExpansions`. singleSelect and bucketed values are option ids that
        `columns[].options` maps to labels. `pagination.truncated` means more
        groups exist than were returned.
      operationId: aggregate_table
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                tableId:
                  type: string
                  minLength: 1
                  pattern: ^[A-Za-z0-9_-]+$
                  description: Data table or worksheet id.
                select:
                  minItems: 1
                  maxItems: 20
                  type: array
                  items:
                    type: object
                    properties:
                      columnId:
                        type: string
                        minLength: 1
                        description: Column id, not its label.
                      agg:
                        type: string
                        enum:
                          - count
                          - count_distinct
                          - sum
                          - avg
                          - min
                          - max
                          - stddev_pop
                          - stddev_samp
                      alias:
                        description: >-
                          Result key for the measure; defaults to
                          `<columnId>_<agg>`.
                        type: string
                        minLength: 1
                    required:
                      - columnId
                      - agg
                    additionalProperties: false
                  description: >-
                    Measures to compute; grouped columns appear in results
                    without an entry here.
                groupBy:
                  description: Omit for one scalar row over the whole table.
                  maxItems: 10
                  type: array
                  items:
                    type: object
                    properties:
                      columnId:
                        type: string
                        minLength: 1
                        description: Column id, not its label.
                      dateTrunc:
                        description: >-
                          Date grain; the result key becomes
                          `<columnId>_<dateTrunc>`. `option` is a synonym.
                        type: string
                        enum:
                          - minute
                          - hour
                          - day
                          - week
                          - month
                          - year
                    required:
                      - columnId
                    additionalProperties: false
                where:
                  description: Filters rows before aggregation.
                  maxItems: 20
                  type: array
                  items:
                    $ref: '#/components/schemas/aggregate_table____schema0'
                arrayExpansions:
                  description: >-
                    Explode array columns into one row per element, referenced
                    by alias; empty arrays yield no rows, and counts describe
                    elements, not records.
                  maxItems: 3
                  type: array
                  items:
                    type: object
                    properties:
                      columnId:
                        type: string
                        minLength: 1
                        description: Array column id.
                      alias:
                        type: string
                        pattern: ^[A-Za-z][A-Za-z0-9_]*$
                        description: Unused column id for the elements.
                    required:
                      - columnId
                      - alias
                    additionalProperties: false
                having:
                  description: >-
                    AND-combined filters on measure values, applied after
                    aggregation and before sorting and paging.
                  maxItems: 20
                  type: array
                  items:
                    type: object
                    properties:
                      alias:
                        type: string
                        minLength: 1
                        description: A selected measure alias.
                      operator:
                        type: string
                        enum:
                          - '='
                          - '!='
                          - '>'
                          - <
                          - '>='
                          - <=
                          - IS
                          - IS NOT
                        description: IS and IS NOT compare with null.
                      value:
                        description: Literal threshold; dates as ISO 8601 strings.
                        type:
                          - string
                          - number
                          - boolean
                          - 'null'
                    required:
                      - alias
                      - operator
                      - value
                    additionalProperties: false
                orderBy:
                  description: >-
                    Sort keys in priority order; defaults to the first groupBy
                    column, ascending.
                  maxItems: 10
                  type: array
                  items:
                    type: object
                    properties:
                      alias:
                        type: string
                        minLength: 1
                        description: >-
                          Result key: a measure alias, a groupBy column id or
                          `<columnId>_<dateTrunc>`.
                      direction:
                        description: Defaults to ascending.
                        type: string
                        enum:
                          - asc
                          - desc
                    required:
                      - alias
                    additionalProperties: false
                limit:
                  description: Defaults to 100.
                  type: integer
                  minimum: 1
                  maximum: 10000
                offset:
                  description: Zero-based offset over groups.
                  type: integer
                  minimum: 0
                  maximum: 9007199254740991
              required:
                - tableId
                - select
              additionalProperties: false
      responses:
        '200':
          description: Tool result.
components:
  schemas:
    aggregate_table____schema0:
      anyOf:
        - type: object
          properties:
            columnId:
              type: string
              minLength: 1
              description: Column id, not its label.
            operator:
              type: string
              enum:
                - '='
                - '!='
                - '>'
                - <
                - '>='
                - <=
                - IN
                - NOT IN
                - LIKE
                - CONTAINS_ALL
                - ANY
                - ALL
                - NONE
                - NOT_EMPTY
                - EMPTY
                - IS
                - IS NOT
              description: >-
                IN/NOT IN match exact values or array elements; CONTAINS_ALL
                needs all. ANY/ALL/NONE: case-insensitive substring matches,
                never for id columns (they over-match).
            value:
              description: >-
                Array for multi-value operators (ANY/ALL/NONE: at most 250
                strings). singleSelect and bucketed columns store option ids
                (opt_*): filter by id; a label matches no rows. describe_column
                with `search` resolves a label to its id.
              anyOf:
                - type:
                    - string
                    - number
                    - boolean
                    - 'null'
                - type: array
                  items:
                    type:
                      - string
                      - number
                      - boolean
                      - 'null'
          required:
            - columnId
            - operator
          additionalProperties: false
        - type: object
          properties:
            columnId:
              type: string
              minLength: 1
              description: Column id, not its label.
            operator:
              type: string
              const: BETWEEN
            date_from:
              type: string
              description: >-
                Inclusive. Plain dates cover whole days, and times without an
                offset are clock times, in the reported timezone or UTC.
            date_to:
              type: string
              description: Inclusive; a plain date covers that whole day.
          required:
            - columnId
            - operator
            - date_from
            - date_to
          additionalProperties: false
        - type: object
          properties:
            columnId:
              type: string
              minLength: 1
              description: Column id, not its label.
            period:
              type: object
              properties:
                'n':
                  type: integer
                  minimum: -9007199254740991
                  maximum: 9007199254740991
                  description: Signed units; negative values reach into the past.
                unit:
                  type: string
                  enum:
                    - hours
                    - days
                    - weeks
                    - months
                    - years
              required:
                - 'n'
                - unit
              additionalProperties: false
              description: >-
                Whole days in the read timezone, including today: { n: -7, unit:
                "days" } keeps today and the six prior days. Months/years follow
                the calendar; hours are exact. Reads re-resolve; worksheets keep
                a snapshot.
            offset:
              description: >-
                Shifts the anchor before period applies; { n: -1, unit: "weeks"
                } moves it one week into the past.
              type: object
              properties:
                'n':
                  type: integer
                  minimum: -9007199254740991
                  maximum: 9007199254740991
                  description: Signed units; negative values reach into the past.
                unit:
                  type: string
                  enum:
                    - hours
                    - days
                    - weeks
                    - months
                    - years
              required:
                - 'n'
                - unit
              additionalProperties: false
          required:
            - columnId
            - period
          additionalProperties: false
        - type: object
          properties:
            or_filters:
              minItems: 1
              type: array
              items:
                minItems: 1
                type: array
                items:
                  $ref: '#/components/schemas/aggregate_table____schema0'
              description: ORs branches of ANDed items.
          required:
            - or_filters
          additionalProperties: false
  securitySchemes:
    bearer:
      type: http
      scheme: bearer

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.