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

# aggregateHistogram

<div className="kinetica-doxygen">
  <div id="a44f85f0ed810158552eade4159d161ac" />

  <h2 className="memtitle"><span className="permalink"><a href="#a44f85f0ed810158552eade4159d161ac">◆ </a></span>aggregateHistogram() <span className="overload">\[1/4]</span></h2>

  <div className="memitem">
    <div className="memproto">
      <table className="memname">
        <tr>
          <td className="memname"><a className="el" href="/content/api/cpp/structgpudb_1_1AggregateHistogramResponse">AggregateHistogramResponse</a> gpudb::GPUdb::aggregateHistogram </td>
          <td>(</td>
          <td className="paramtype">const <a className="el" href="/content/api/cpp/structgpudb_1_1AggregateHistogramRequest">AggregateHistogramRequest</a> &</td>
          <td className="paramname"><span className="paramname"><span className="em">request\_</span></span></td>
          <td>)</td>
          <td> const</td>
        </tr>
      </table>
    </div>

    <div className="memdoc">
      <p>Performs a histogram calculation given a table, a column, and an interval function. </p>
      <p>The <a className="el" href="/content/api/cpp/structgpudb_1_1AggregateHistogramRequest#abdd548aff47a9cb171d656db838b004d">interval</a> 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 <a className="el" href="/content/api/cpp/namespacegpudb#a1a869e8637f82e48e93e1c57d7be8170">value\_column</a>. In this latter case the sum of the values corresponding to the <a className="el" href="/content/api/cpp/namespacegpudb#a1a869e8637f82e48e93e1c57d7be8170">value\_column</a> is used as the result instead. The total number of bins requested cannot exceed 10,000.</p>
      <p>NOTE: The Kinetica instance being accessed must be running a CUDA (GPU-based) build to service a request that specifies a <a className="el" href="/content/api/cpp/namespacegpudb#a1a869e8637f82e48e93e1c57d7be8170">value\_column</a>.</p>

      <div className="dl params">
        <div className="dt">Parameters</div>

        <div className="dd">
          <table className="params">
            <tr>
              <td className="paramdir">\[in]</td>
              <td className="paramname">request\_</td>
              <td><a className="el" href="/content/api/cpp/structgpudb_1_1AggregateHistogramRequest">Request</a> object containing the parameters for the operation.</td>
            </tr>
          </table>
        </div>
      </div>

      <div className="dl section return">
        <div className="dt">Returns</div>
        <div className="dd"><a className="el" href="/content/api/cpp/structgpudb_1_1AggregateHistogramResponse">Response</a> object containing the result of the operation. </div>
      </div>
    </div>
  </div>

  <div id="a55de0ae15f0c2d85a0a5b785db143275" />

  <h2 className="memtitle"><span className="permalink"><a href="#a55de0ae15f0c2d85a0a5b785db143275">◆ </a></span>aggregateHistogram() <span className="overload">\[2/4]</span></h2>

  <div className="memitem">
    <div className="memproto">
      <table className="memname">
        <tr>
          <td className="memname"><a className="el" href="/content/api/cpp/structgpudb_1_1AggregateHistogramResponse">AggregateHistogramResponse</a> & gpudb::GPUdb::aggregateHistogram </td>
          <td>(</td>
          <td className="paramtype">const <a className="el" href="/content/api/cpp/structgpudb_1_1AggregateHistogramRequest">AggregateHistogramRequest</a> &</td>
          <td className="paramname"><span className="paramname"><span className="em">request\_</span></span>, </td>
        </tr>

        <tr>
          <td className="paramkey" />

          <td />

          <td className="paramtype"><a className="el" href="/content/api/cpp/structgpudb_1_1AggregateHistogramResponse">AggregateHistogramResponse</a> &</td>
          <td className="paramname"><span className="paramname"><span className="em">response\_</span></span> ) const</td>
        </tr>
      </table>
    </div>

    <div className="memdoc">
      <p>Performs a histogram calculation given a table, a column, and an interval function. </p>
      <p>The <a className="el" href="/content/api/cpp/structgpudb_1_1AggregateHistogramRequest#abdd548aff47a9cb171d656db838b004d">interval</a> 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 <a className="el" href="/content/api/cpp/namespacegpudb#a1a869e8637f82e48e93e1c57d7be8170">value\_column</a>. In this latter case the sum of the values corresponding to the <a className="el" href="/content/api/cpp/namespacegpudb#a1a869e8637f82e48e93e1c57d7be8170">value\_column</a> is used as the result instead. The total number of bins requested cannot exceed 10,000.</p>
      <p>NOTE: The Kinetica instance being accessed must be running a CUDA (GPU-based) build to service a request that specifies a <a className="el" href="/content/api/cpp/namespacegpudb#a1a869e8637f82e48e93e1c57d7be8170">value\_column</a>.</p>

      <div className="dl params">
        <div className="dt">Parameters</div>

        <div className="dd">
          <table className="params">
            <tr>
              <td className="paramdir">\[in]</td>
              <td className="paramname">request\_</td>
              <td><a className="el" href="/content/api/cpp/structgpudb_1_1AggregateHistogramRequest">Request</a> object containing the parameters for the operation. </td>
            </tr>

            <tr>
              <td className="paramdir">\[out]</td>
              <td className="paramname">response\_</td>
              <td><a className="el" href="/content/api/cpp/structgpudb_1_1AggregateHistogramResponse">Response</a> object containing the results of the operation.</td>
            </tr>
          </table>
        </div>
      </div>

      <div className="dl section return">
        <div className="dt">Returns</div>
        <div className="dd"><a className="el" href="/content/api/cpp/structgpudb_1_1AggregateHistogramResponse">Response</a> object containing the result of the operation (initially passed in by reference). </div>
      </div>
    </div>
  </div>

  <div id="a81f941c05e1304c4709f95346eaae747" />

  <h2 className="memtitle"><span className="permalink"><a href="#a81f941c05e1304c4709f95346eaae747">◆ </a></span>aggregateHistogram() <span className="overload">\[3/4]</span></h2>

  <div className="memitem">
    <div className="memproto">
      <table className="memname">
        <tr>
          <td className="memname"><a className="el" href="/content/api/cpp/structgpudb_1_1AggregateHistogramResponse">AggregateHistogramResponse</a> gpudb::GPUdb::aggregateHistogram </td>
          <td>(</td>
          <td className="paramtype">const std::string &</td>
          <td className="paramname"><span className="paramname"><span className="em">tableName</span></span>, </td>
        </tr>

        <tr>
          <td className="paramkey" />

          <td />

          <td className="paramtype">const std::string &</td>
          <td className="paramname"><span className="paramname"><span className="em">columnName</span></span>, </td>
        </tr>

        <tr>
          <td className="paramkey" />

          <td />

          <td className="paramtype">const double</td>
          <td className="paramname"><span className="paramname"><span className="em">start</span></span>, </td>
        </tr>

        <tr>
          <td className="paramkey" />

          <td />

          <td className="paramtype">const double</td>
          <td className="paramname"><span className="paramname"><span className="em">end</span></span>, </td>
        </tr>

        <tr>
          <td className="paramkey" />

          <td />

          <td className="paramtype">const double</td>
          <td className="paramname"><span className="paramname"><span className="em">interval</span></span>, </td>
        </tr>

        <tr>
          <td className="paramkey" />

          <td />

          <td className="paramtype">const std::map\< std::string, std::string > &</td>
          <td className="paramname"><span className="paramname"><span className="em">options</span></span> ) const</td>
        </tr>
      </table>
    </div>

    <div className="memdoc">
      <p>Performs a histogram calculation given a table, a column, and an interval function. </p>
      <p>The <span className="em arg">interval</span> 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 <a className="el" href="/content/api/cpp/namespacegpudb#a1a869e8637f82e48e93e1c57d7be8170">value\_column</a>. In this latter case the sum of the values corresponding to the <a className="el" href="/content/api/cpp/namespacegpudb#a1a869e8637f82e48e93e1c57d7be8170">value\_column</a> is used as the result instead. The total number of bins requested cannot exceed 10,000.</p>
      <p>NOTE: The Kinetica instance being accessed must be running a CUDA (GPU-based) build to service a request that specifies a <a className="el" href="/content/api/cpp/namespacegpudb#a1a869e8637f82e48e93e1c57d7be8170">value\_column</a>.</p>

      <div className="dl params">
        <div className="dt">Parameters</div>

        <div className="dd">
          <table className="params">
            <tr>
              <td className="paramdir">\[in]</td>
              <td className="paramname">tableName</td>
              <td>Name of the table on which the operation will be performed. Must be an existing table, in \[schema\_name.]table\_name format, using standard <a href="/content/concepts/tables/#table-name-resolution" target="_top">name resolution rules</a>. </td>
            </tr>

            <tr>
              <td className="paramdir">\[in]</td>
              <td className="paramname">columnName</td>
              <td>Name of a column or an expression of one or more column names over which the histogram will be calculated. </td>
            </tr>

            <tr>
              <td className="paramdir">\[in]</td>
              <td className="paramname">start</td>
              <td>Lower end value of the histogram interval, inclusive. </td>
            </tr>

            <tr>
              <td className="paramdir">\[in]</td>
              <td className="paramname">end</td>
              <td>Upper end value of the histogram interval, inclusive. </td>
            </tr>

            <tr>
              <td className="paramdir">\[in]</td>
              <td className="paramname">interval</td>
              <td>The size of each bin within the start and end parameters. </td>
            </tr>

            <tr>
              <td className="paramdir">\[in]</td>
              <td className="paramname">options</td>

              <td>
                Optional parameters.

                <ul>
                  <li> <a className="el" href="/content/api/cpp/namespacegpudb#a1a869e8637f82e48e93e1c57d7be8170">aggregate\_histogram\_value\_column</a>: 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). </li>
                  <li> <a className="el" href="/content/api/cpp/namespacegpudb#ab782971147a6d658b91d87eb8c5d9cec">aggregate\_histogram\_start</a>: The start parameter for char types. </li>
                  <li> <a className="el" href="/content/api/cpp/namespacegpudb#abc6eb3aa953301a4cc0772837694139a">aggregate\_histogram\_end</a>: The end parameter for char types. </li>
                  <li> <a className="el" href="/content/api/cpp/namespacegpudb#ad71784c6b9ebc622c7e45f341fdb9e72">aggregate\_histogram\_interval</a>: The interval parameter for char types. </li>
                </ul>

                The default value is an empty map.
              </td>
            </tr>
          </table>
        </div>
      </div>

      <div className="dl section return">
        <div className="dt">Returns</div>
        <div className="dd"><a className="el" href="/content/api/cpp/structgpudb_1_1AggregateHistogramResponse">Response</a> object containing the result of the operation. </div>
      </div>
    </div>
  </div>

  <div id="af0eea9fee904ec49d2ba8ee73df3b90c" />

  <h2 className="memtitle"><span className="permalink"><a href="#af0eea9fee904ec49d2ba8ee73df3b90c">◆ </a></span>aggregateHistogram() <span className="overload">\[4/4]</span></h2>

  <div className="memitem">
    <div className="memproto">
      <table className="memname">
        <tr>
          <td className="memname"><a className="el" href="/content/api/cpp/structgpudb_1_1AggregateHistogramResponse">AggregateHistogramResponse</a> & gpudb::GPUdb::aggregateHistogram </td>
          <td>(</td>
          <td className="paramtype">const std::string &</td>
          <td className="paramname"><span className="paramname"><span className="em">tableName</span></span>, </td>
        </tr>

        <tr>
          <td className="paramkey" />

          <td />

          <td className="paramtype">const std::string &</td>
          <td className="paramname"><span className="paramname"><span className="em">columnName</span></span>, </td>
        </tr>

        <tr>
          <td className="paramkey" />

          <td />

          <td className="paramtype">const double</td>
          <td className="paramname"><span className="paramname"><span className="em">start</span></span>, </td>
        </tr>

        <tr>
          <td className="paramkey" />

          <td />

          <td className="paramtype">const double</td>
          <td className="paramname"><span className="paramname"><span className="em">end</span></span>, </td>
        </tr>

        <tr>
          <td className="paramkey" />

          <td />

          <td className="paramtype">const double</td>
          <td className="paramname"><span className="paramname"><span className="em">interval</span></span>, </td>
        </tr>

        <tr>
          <td className="paramkey" />

          <td />

          <td className="paramtype">const std::map\< std::string, std::string > &</td>
          <td className="paramname"><span className="paramname"><span className="em">options</span></span>, </td>
        </tr>

        <tr>
          <td className="paramkey" />

          <td />

          <td className="paramtype"><a className="el" href="/content/api/cpp/structgpudb_1_1AggregateHistogramResponse">AggregateHistogramResponse</a> &</td>
          <td className="paramname"><span className="paramname"><span className="em">response\_</span></span> ) const</td>
        </tr>
      </table>
    </div>

    <div className="memdoc">
      <p>Performs a histogram calculation given a table, a column, and an interval function. </p>
      <p>The <span className="em arg">interval</span> 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 <a className="el" href="/content/api/cpp/namespacegpudb#a1a869e8637f82e48e93e1c57d7be8170">value\_column</a>. In this latter case the sum of the values corresponding to the <a className="el" href="/content/api/cpp/namespacegpudb#a1a869e8637f82e48e93e1c57d7be8170">value\_column</a> is used as the result instead. The total number of bins requested cannot exceed 10,000.</p>
      <p>NOTE: The Kinetica instance being accessed must be running a CUDA (GPU-based) build to service a request that specifies a <a className="el" href="/content/api/cpp/namespacegpudb#a1a869e8637f82e48e93e1c57d7be8170">value\_column</a>.</p>

      <div className="dl params">
        <div className="dt">Parameters</div>

        <div className="dd">
          <table className="params">
            <tr>
              <td className="paramdir">\[in]</td>
              <td className="paramname">tableName</td>
              <td>Name of the table on which the operation will be performed. Must be an existing table, in \[schema\_name.]table\_name format, using standard <a href="/content/concepts/tables/#table-name-resolution" target="_top">name resolution rules</a>. </td>
            </tr>

            <tr>
              <td className="paramdir">\[in]</td>
              <td className="paramname">columnName</td>
              <td>Name of a column or an expression of one or more column names over which the histogram will be calculated. </td>
            </tr>

            <tr>
              <td className="paramdir">\[in]</td>
              <td className="paramname">start</td>
              <td>Lower end value of the histogram interval, inclusive. </td>
            </tr>

            <tr>
              <td className="paramdir">\[in]</td>
              <td className="paramname">end</td>
              <td>Upper end value of the histogram interval, inclusive. </td>
            </tr>

            <tr>
              <td className="paramdir">\[in]</td>
              <td className="paramname">interval</td>
              <td>The size of each bin within the start and end parameters. </td>
            </tr>

            <tr>
              <td className="paramdir">\[in]</td>
              <td className="paramname">options</td>

              <td>
                Optional parameters.

                <ul>
                  <li> <a className="el" href="/content/api/cpp/namespacegpudb#a1a869e8637f82e48e93e1c57d7be8170">aggregate\_histogram\_value\_column</a>: 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). </li>
                  <li> <a className="el" href="/content/api/cpp/namespacegpudb#ab782971147a6d658b91d87eb8c5d9cec">aggregate\_histogram\_start</a>: The start parameter for char types. </li>
                  <li> <a className="el" href="/content/api/cpp/namespacegpudb#abc6eb3aa953301a4cc0772837694139a">aggregate\_histogram\_end</a>: The end parameter for char types. </li>
                  <li> <a className="el" href="/content/api/cpp/namespacegpudb#ad71784c6b9ebc622c7e45f341fdb9e72">aggregate\_histogram\_interval</a>: The interval parameter for char types. </li>
                </ul>

                The default value is an empty map.
              </td>
            </tr>

            <tr>
              <td className="paramdir">\[out]</td>
              <td className="paramname">response\_</td>
              <td><a className="el" href="/content/api/cpp/structgpudb_1_1AggregateHistogramResponse">Response</a> object containing the results of the operation.</td>
            </tr>
          </table>
        </div>
      </div>

      <div className="dl section return">
        <div className="dt">Returns</div>
        <div className="dd"><a className="el" href="/content/api/cpp/structgpudb_1_1AggregateHistogramResponse">Response</a> object containing the result of the operation (initially passed in by reference). </div>
      </div>
    </div>
  </div>
</div>
