> ## 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

```
URL: http://<db.host>:<db.port>/aggregate/histogram
```

Performs a histogram calculation given a table, a column, and an interval
function. The input parameter *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*.

## Input Parameter Description

<ParamField body="table_name" type="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](../../concepts/tables/#table-name-resolution).
</ParamField>

<ParamField body="column_name" type="string">
  Name of a column or an expression of one or more column names over which the histogram will be calculated.
</ParamField>

<ParamField body="start" type="double">
  Lower end value of the histogram interval, inclusive.
</ParamField>

<ParamField body="end" type="double">
  Upper end value of the histogram interval, inclusive.
</ParamField>

<ParamField body="interval" type="double">
  The size of each bin within the start and end parameters.
</ParamField>

<ParamField body="options" type="map of string to strings">
  Optional parameters.

  The default value is an empty map ( \{} ).

  <Expandable title="options">
    <ParamField body="value_column">
      The name of the column to use when calculating the bin values (values are summed).  The column must be a numerical type (int, double, long, float).
    </ParamField>

    <ParamField body="start">
      The start parameter for char types.
    </ParamField>

    <ParamField body="end">
      The end parameter for char types.
    </ParamField>

    <ParamField body="interval">
      The interval parameter for char types.
    </ParamField>
  </Expandable>
</ParamField>

## Output Parameter Description

The Kinetica server embeds the endpoint response inside a standard response structure which contains status information and the actual response to the query.  Here is a description of the various fields of the wrapper:

<ResponseField name="status" type="String">
  'OK' or 'ERROR'
</ResponseField>

<ResponseField name="message" type="String">
  Empty if success or an error message
</ResponseField>

<ResponseField name="data_type" type="String">
  'aggregate\_histogram\_response' or 'none' in case of an error
</ResponseField>

<ResponseField name="data" type="String">
  Empty string
</ResponseField>

<ResponseField name="data_str" type="JSON or String">
  This embedded JSON represents the result of the /aggregate/histogram endpoint:

  <Expandable title="data_str">
    <ResponseField name="counts" type="array of doubles">
      The array of calculated values that represents the histogram data points.
    </ResponseField>

    <ResponseField name="start" type="double">
      Value of input parameter *start*.
    </ResponseField>

    <ResponseField name="end" type="double">
      Value of input parameter *end*.
    </ResponseField>

    <ResponseField name="info" type="map of string to strings">
      Additional information.
    </ResponseField>
  </Expandable>

  Empty string in case of an error.
</ResponseField>
