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

# aggregate_histogram

### aggregate\_histogram

<ul>
  <li>
    aggregate\_histogram(\
    &#x20;table\_name: string,\
    &#x20;column\_name: string,\
    &#x20;start: number,\
    &#x20;end: number,\
    &#x20;interval: number,\
    &#x20;options?: Record\<string, string>,\
    &#x20;callback?: [GPUdbCallback](https://docs.kinetica.com/content/api/javascript/types/GPUdbCallback.md),\
    ): Promise\<[AggregateHistogramResponse](https://docs.kinetica.com/content/api/javascript/interfaces/AggregateHistogramResponse.md)>

    Performs a histogram calculation given a table, a column, and an interval function. The `interval` is used to produce bins of that size and the result, computed over the records falling within each bin, is returned. For each bin, the start value is inclusive, but the end value is exclusive--except for the very last bin for which the end value is also inclusive. The value returned for each bin is the number of records in it, except when a column name is provided as a value\_column. In this latter case the sum of the values corresponding to the value\_column is used as the result instead. The total number of bins requested cannot exceed 10,000.NOTE: The Kinetica instance being accessed must be running a CUDA (GPU-based) build to service a request that specifies a value\_column.

    #### Parameters

    <ul>
      <li>
        table\_name: string

        Name of the table on which the operation will be performed. Must be an existing table, in \[schema\_name.]table\_name format, using standard name resolution rules.
      </li>

      <li>
        column\_name: string

        Name of a column or an expression of one or more column names over which the histogram will be calculated.
      </li>

      <li>
        start: number

        Lower end value of the histogram interval, inclusive.
      </li>

      <li>
        end: number

        Upper end value of the histogram interval, inclusive.
      </li>

      <li>
        interval: number

        The size of each bin within the start and end parameters.
      </li>

      <li>
        `Optional`options: Record\<string, string>

        Optional parameters.
      </li>

      <li>
        `Optional`callback: [GPUdbCallback](https://docs.kinetica.com/content/api/javascript/types/GPUdbCallback.md)

        Optional callback function
      </li>
    </ul>

    #### Returns Promise\<[AggregateHistogramResponse](https://docs.kinetica.com/content/api/javascript/interfaces/AggregateHistogramResponse.md)>

    Promise\<Types.AggregateHistogramResponse> - Promise resolving to the response

    <ul>
      <li>Defined in [src/GPUdb.ts:3345](https://github.com/kineticadb/kinetica-api-typescript/blob/master/src/GPUdb.ts#L3345)</li>
    </ul>
  </li>
</ul>

### aggregate\_histogram\_request

<ul>
  <li>
    aggregate\_histogram\_request(\
    &#x20;request: [AggregateHistogramRequest](https://docs.kinetica.com/content/api/javascript/interfaces/AggregateHistogramRequest.md),\
    &#x20;callback?: [GPUdbCallback](https://docs.kinetica.com/content/api/javascript/types/GPUdbCallback.md),\
    ): Promise\<[AggregateHistogramResponse](https://docs.kinetica.com/content/api/javascript/interfaces/AggregateHistogramResponse.md)>

    Performs a histogram calculation given a table, a column, and an interval function. The `interval` is used to produce bins of that size and the result, computed over the records falling within each bin, is returned. For each bin, the start value is inclusive, but the end value is exclusive--except for the very last bin for which the end value is also inclusive. The value returned for each bin is the number of records in it, except when a column name is provided as a value\_column. In this latter case the sum of the values corresponding to the value\_column is used as the result instead. The total number of bins requested cannot exceed 10,000.NOTE: The Kinetica instance being accessed must be running a CUDA (GPU-based) build to service a request that specifies a value\_column.

    #### Parameters

    <ul>
      <li>
        request: [AggregateHistogramRequest](https://docs.kinetica.com/content/api/javascript/interfaces/AggregateHistogramRequest.md)

        Request object containing the parameters for the operation
      </li>

      <li>
        `Optional`callback: [GPUdbCallback](https://docs.kinetica.com/content/api/javascript/types/GPUdbCallback.md)

        Optional callback function
      </li>
    </ul>

    #### Returns Promise\<[AggregateHistogramResponse](https://docs.kinetica.com/content/api/javascript/interfaces/AggregateHistogramResponse.md)>

    Promise\<Types.AggregateHistogramResponse> - Promise resolving to the response

    <ul>
      <li>Defined in [src/GPUdb.ts:3302](https://github.com/kineticadb/kinetica-api-typescript/blob/master/src/GPUdb.ts#L3302)</li>
    </ul>
  </li>
</ul>


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