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

# aggregateStatistics

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

  <h2 className="memtitle"><span className="permalink"><a href="#a8c91e892a238298aff0261a55ce34f7f">◆ </a></span>aggregateStatistics() <span className="overload">\[1/2]</span></h2>

  <div className="memitem">
    <div className="memproto">
      <table className="mlabels">
        <tr>
          <td className="mlabels-left">
            <table className="memname">
              <tr>
                <td className="memname"><a className="el" href="/content/api/cs/classkinetica_1_1AggregateStatisticsResponse">AggregateStatisticsResponse</a> kinetica.Kinetica.aggregateStatistics </td>
                <td>(</td>
                <td className="paramtype"><a className="el" href="/content/api/cs/classkinetica_1_1AggregateStatisticsRequest">AggregateStatisticsRequest</a></td>
                <td className="paramname"><span className="paramname"><span className="em">request\_</span></span></td>
                <td>)</td>

                <td />
              </tr>
            </table>
          </td>

          <td className="mlabels-right"> <span className="mlabels"><span className="mlabel inline">inline</span></span> </td>
        </tr>
      </table>
    </div>

    <div className="memdoc">
      <p>Calculates the requested statistics of the given column(s) in a given table. </p>
      <p>The available statistics are: <a className="el" href="/content/api/cs/structkinetica_1_1AggregateStatisticsRequest_1_1Stats#a1d2d290d476df9298613017ff2a5beba">COUNT</a> (number of total objects), <a className="el" href="/content/api/cs/structkinetica_1_1AggregateStatisticsRequest_1_1Stats#ab5fb571e4e9cd0a868e00ebb02e39ec5">MEAN</a>, <a className="el" href="/content/api/cs/structkinetica_1_1AggregateStatisticsRequest_1_1Stats#a2a7cb3fb00a4a46add353855681c9612">STDV</a> (standard deviation), <a className="el" href="/content/api/cs/structkinetica_1_1AggregateStatisticsRequest_1_1Stats#a4078fbc16884aff4e45915feabec72c2">VARIANCE</a>, <a className="el" href="/content/api/cs/structkinetica_1_1AggregateStatisticsRequest_1_1Stats#aa1104b17e525829865af87cb5483e773">SKEW</a>, <a className="el" href="/content/api/cs/structkinetica_1_1AggregateStatisticsRequest_1_1Stats#aa79a1a1776b7d294fe2210c38881e77c">KURTOSIS</a>, <a className="el" href="/content/api/cs/structkinetica_1_1AggregateStatisticsRequest_1_1Stats#a61af5c5f290f944b3d59bbbe281a36be">SUM</a>, <a className="el" href="/content/api/cs/structkinetica_1_1AggregateStatisticsRequest_1_1Stats#ad6fa1ef1242407b30f12314e18f0bd66">MIN</a>, <a className="el" href="/content/api/cs/structkinetica_1_1AggregateStatisticsRequest_1_1Stats#a59d17724a5382e5dc6ca903cb8f32722">MAX</a>, <a className="el" href="/content/api/cs/structkinetica_1_1AggregateStatisticsRequest_1_1Stats#a70ad37e69b7d6710837e18de9713fc10">WEIGHTED\_AVERAGE</a>, <a className="el" href="/content/api/cs/structkinetica_1_1AggregateStatisticsRequest_1_1Stats#a116f7f0f7f3b46136c3dcb78e5afc963">CARDINALITY</a> (unique count), <a className="el" href="/content/api/cs/structkinetica_1_1AggregateStatisticsRequest_1_1Stats#a20a11628c07613e3ae2ba3583f690a66">ESTIMATED\_CARDINALITY</a>, <a className="el" href="/content/api/cs/structkinetica_1_1AggregateStatisticsRequest_1_1Stats#aacd763b025f8f2595b9703a893d0b3d1">PERCENTILE</a>, and <a className="el" href="/content/api/cs/structkinetica_1_1AggregateStatisticsRequest_1_1Stats#af4bfd852c306355293fe5578b61817de">PERCENTILE\_RANK</a>.</p>
      <p>Estimated cardinality is calculated by using the hyperloglog approximation technique.</p>
      <p>Percentiles and percentile ranks are approximate and are calculated using the t-digest algorithm. They must include the desired <a className="el" href="/content/api/cs/structkinetica_1_1AggregateStatisticsRequest_1_1Stats#aacd763b025f8f2595b9703a893d0b3d1">PERCENTILE</a>/<a className="el" href="/content/api/cs/structkinetica_1_1AggregateStatisticsRequest_1_1Stats#af4bfd852c306355293fe5578b61817de">PERCENTILE\_RANK</a>. To compute multiple percentiles each value must be specified separately (i.e. 'percentile(75.0),percentile(99.0),percentile\_rank(1234.56),percentile\_rank(-5)').</p>
      <p>A second, comma-separated value can be added to the <a className="el" href="/content/api/cs/structkinetica_1_1AggregateStatisticsRequest_1_1Stats#aacd763b025f8f2595b9703a893d0b3d1">PERCENTILE</a> statistic to calculate percentile resolution, e.g., a 50th percentile with 200 resolution would be 'percentile(50,200)'.</p>
      <p>The weighted average statistic requires a weight column to be specified in <a className="el" href="/content/api/cs/structkinetica_1_1AggregateStatisticsRequest_1_1Options#a2d9a1f9e9945044e64dd81527a8d2a47">WEIGHT\_COLUMN\_NAME</a>. The weighted average is then defined as the sum of the products of <a className="el" href="/content/api/cs/classkinetica_1_1AggregateStatisticsRequest#aa789056d7b0c50c9d227b0eb95f79e10">column\_name</a> times the <a className="el" href="/content/api/cs/structkinetica_1_1AggregateStatisticsRequest_1_1Options#a2d9a1f9e9945044e64dd81527a8d2a47">WEIGHT\_COLUMN\_NAME</a> values divided by the sum of the <a className="el" href="/content/api/cs/structkinetica_1_1AggregateStatisticsRequest_1_1Options#a2d9a1f9e9945044e64dd81527a8d2a47">WEIGHT\_COLUMN\_NAME</a> values.</p>
      <p>Additional columns can be used in the calculation of statistics via <a className="el" href="/content/api/cs/structkinetica_1_1AggregateStatisticsRequest_1_1Options#a1e269463a87980a31a2c23040edb1f43">ADDITIONAL\_COLUMN\_NAMES</a>. Values in these columns will be included in the overall aggregate calculation–individual aggregates will not be calculated per additional column. For instance, requesting the <a className="el" href="/content/api/cs/structkinetica_1_1AggregateStatisticsRequest_1_1Stats#a1d2d290d476df9298613017ff2a5beba">COUNT</a> and <a className="el" href="/content/api/cs/structkinetica_1_1AggregateStatisticsRequest_1_1Stats#ab5fb571e4e9cd0a868e00ebb02e39ec5">MEAN</a> of <a className="el" href="/content/api/cs/classkinetica_1_1AggregateStatisticsRequest#aa789056d7b0c50c9d227b0eb95f79e10">column\_name</a> x and <a className="el" href="/content/api/cs/structkinetica_1_1AggregateStatisticsRequest_1_1Options#a1e269463a87980a31a2c23040edb1f43">ADDITIONAL\_COLUMN\_NAMES</a> y and z, where x holds the numbers 1-10, y holds 11-20, and z holds 21-30, would return the total number of x, y, and z values (30), and the single average value across all x, y, and z values (15.5).</p>
      <p>The response includes a list of key/value pairs of each statistic requested and its corresponding value.</p>

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

        <div className="dd">
          <table className="params">
            <tr>
              <td className="paramname">request\_</td>
              <td>Request 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">Response object containing the result of the operation. </div>
      </div>

      <p className="definition">Definition at line <a className="el" href="https://github.com/kineticadb/kinetica-api-cs/blob/master/Kinetica/KineticaFunctions.cs#L5930">5930</a> of file <a className="el" href="https://github.com/kineticadb/kinetica-api-cs/blob/master/Kinetica/KineticaFunctions.cs">KineticaFunctions.cs</a>.</p>
    </div>
  </div>

  <div id="ab5abf6285e16b7421999532bf1d91a15" />

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

  <div className="memitem">
    <div className="memproto">
      <table className="mlabels">
        <tr>
          <td className="mlabels-left">
            <table className="memname">
              <tr>
                <td className="memname"><a className="el" href="/content/api/cs/classkinetica_1_1AggregateStatisticsResponse">AggregateStatisticsResponse</a> kinetica.Kinetica.aggregateStatistics </td>
                <td>(</td>
                <td className="paramtype">string</td>
                <td className="paramname"><span className="paramname"><span className="em">table\_name</span></span>, </td>
              </tr>

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

                <td />

                <td className="paramtype">string</td>
                <td className="paramname"><span className="paramname"><span className="em">column\_name</span></span>, </td>
              </tr>

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

                <td />

                <td className="paramtype">string</td>
                <td className="paramname"><span className="paramname"><span className="em">stats</span></span>, </td>
              </tr>

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

                <td />

                <td className="paramtype">IDictionary\< string, string ></td>
                <td className="paramname"><span className="paramname"><span className="em">options</span></span><span className="paramdefsep"> = </span><span className="paramdefval">null</span> )</td>
              </tr>
            </table>
          </td>

          <td className="mlabels-right"> <span className="mlabels"><span className="mlabel inline">inline</span></span> </td>
        </tr>
      </table>
    </div>

    <div className="memdoc">
      <p>Calculates the requested statistics of the given column(s) in a given table. </p>
      <p>The available statistics are: <a className="el" href="/content/api/cs/structkinetica_1_1AggregateStatisticsRequest_1_1Stats#a1d2d290d476df9298613017ff2a5beba">COUNT</a> (number of total objects), <a className="el" href="/content/api/cs/structkinetica_1_1AggregateStatisticsRequest_1_1Stats#ab5fb571e4e9cd0a868e00ebb02e39ec5">MEAN</a>, <a className="el" href="/content/api/cs/structkinetica_1_1AggregateStatisticsRequest_1_1Stats#a2a7cb3fb00a4a46add353855681c9612">STDV</a> (standard deviation), <a className="el" href="/content/api/cs/structkinetica_1_1AggregateStatisticsRequest_1_1Stats#a4078fbc16884aff4e45915feabec72c2">VARIANCE</a>, <a className="el" href="/content/api/cs/structkinetica_1_1AggregateStatisticsRequest_1_1Stats#aa1104b17e525829865af87cb5483e773">SKEW</a>, <a className="el" href="/content/api/cs/structkinetica_1_1AggregateStatisticsRequest_1_1Stats#aa79a1a1776b7d294fe2210c38881e77c">KURTOSIS</a>, <a className="el" href="/content/api/cs/structkinetica_1_1AggregateStatisticsRequest_1_1Stats#a61af5c5f290f944b3d59bbbe281a36be">SUM</a>, <a className="el" href="/content/api/cs/structkinetica_1_1AggregateStatisticsRequest_1_1Stats#ad6fa1ef1242407b30f12314e18f0bd66">MIN</a>, <a className="el" href="/content/api/cs/structkinetica_1_1AggregateStatisticsRequest_1_1Stats#a59d17724a5382e5dc6ca903cb8f32722">MAX</a>, <a className="el" href="/content/api/cs/structkinetica_1_1AggregateStatisticsRequest_1_1Stats#a70ad37e69b7d6710837e18de9713fc10">WEIGHTED\_AVERAGE</a>, <a className="el" href="/content/api/cs/structkinetica_1_1AggregateStatisticsRequest_1_1Stats#a116f7f0f7f3b46136c3dcb78e5afc963">CARDINALITY</a> (unique count), <a className="el" href="/content/api/cs/structkinetica_1_1AggregateStatisticsRequest_1_1Stats#a20a11628c07613e3ae2ba3583f690a66">ESTIMATED\_CARDINALITY</a>, <a className="el" href="/content/api/cs/structkinetica_1_1AggregateStatisticsRequest_1_1Stats#aacd763b025f8f2595b9703a893d0b3d1">PERCENTILE</a>, and <a className="el" href="/content/api/cs/structkinetica_1_1AggregateStatisticsRequest_1_1Stats#af4bfd852c306355293fe5578b61817de">PERCENTILE\_RANK</a>.</p>
      <p>Estimated cardinality is calculated by using the hyperloglog approximation technique.</p>
      <p>Percentiles and percentile ranks are approximate and are calculated using the t-digest algorithm. They must include the desired <a className="el" href="/content/api/cs/structkinetica_1_1AggregateStatisticsRequest_1_1Stats#aacd763b025f8f2595b9703a893d0b3d1">PERCENTILE</a>/<a className="el" href="/content/api/cs/structkinetica_1_1AggregateStatisticsRequest_1_1Stats#af4bfd852c306355293fe5578b61817de">PERCENTILE\_RANK</a>. To compute multiple percentiles each value must be specified separately (i.e. 'percentile(75.0),percentile(99.0),percentile\_rank(1234.56),percentile\_rank(-5)').</p>
      <p>A second, comma-separated value can be added to the <a className="el" href="/content/api/cs/structkinetica_1_1AggregateStatisticsRequest_1_1Stats#aacd763b025f8f2595b9703a893d0b3d1">PERCENTILE</a> statistic to calculate percentile resolution, e.g., a 50th percentile with 200 resolution would be 'percentile(50,200)'.</p>
      <p>The weighted average statistic requires a weight column to be specified in <a className="el" href="/content/api/cs/structkinetica_1_1AggregateStatisticsRequest_1_1Options#a2d9a1f9e9945044e64dd81527a8d2a47">WEIGHT\_COLUMN\_NAME</a>. The weighted average is then defined as the sum of the products of <span className="em">column\_name</span> times the <a className="el" href="/content/api/cs/structkinetica_1_1AggregateStatisticsRequest_1_1Options#a2d9a1f9e9945044e64dd81527a8d2a47">WEIGHT\_COLUMN\_NAME</a> values divided by the sum of the <a className="el" href="/content/api/cs/structkinetica_1_1AggregateStatisticsRequest_1_1Options#a2d9a1f9e9945044e64dd81527a8d2a47">WEIGHT\_COLUMN\_NAME</a> values.</p>
      <p>Additional columns can be used in the calculation of statistics via <a className="el" href="/content/api/cs/structkinetica_1_1AggregateStatisticsRequest_1_1Options#a1e269463a87980a31a2c23040edb1f43">ADDITIONAL\_COLUMN\_NAMES</a>. Values in these columns will be included in the overall aggregate calculation–individual aggregates will not be calculated per additional column. For instance, requesting the <a className="el" href="/content/api/cs/structkinetica_1_1AggregateStatisticsRequest_1_1Stats#a1d2d290d476df9298613017ff2a5beba">COUNT</a> and <a className="el" href="/content/api/cs/structkinetica_1_1AggregateStatisticsRequest_1_1Stats#ab5fb571e4e9cd0a868e00ebb02e39ec5">MEAN</a> of <span className="em">column\_name</span> x and <a className="el" href="/content/api/cs/structkinetica_1_1AggregateStatisticsRequest_1_1Options#a1e269463a87980a31a2c23040edb1f43">ADDITIONAL\_COLUMN\_NAMES</a> y and z, where x holds the numbers 1-10, y holds 11-20, and z holds 21-30, would return the total number of x, y, and z values (30), and the single average value across all x, y, and z values (15.5).</p>
      <p>The response includes a list of key/value pairs of each statistic requested and its corresponding value.</p>

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

        <div className="dd">
          <table className="params">
            <tr>
              <td className="paramname">table\_name</td>
              <td>Name of the table on which the statistics operation will be performed, 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="paramname">column\_name</td>
              <td>Name of the primary column for which the statistics are to be calculated.</td>
            </tr>

            <tr>
              <td className="paramname">stats</td>

              <td>
                Comma separated list of the statistics to calculate, e.g. "sum,mean". Supported values:

                <ul>
                  <li> <a className="el" href="/content/api/cs/structkinetica_1_1AggregateStatisticsRequest_1_1Stats#a1d2d290d476df9298613017ff2a5beba">COUNT</a>: Number of objects (independent of the given column(s)). </li>
                  <li> <a className="el" href="/content/api/cs/structkinetica_1_1AggregateStatisticsRequest_1_1Stats#ab5fb571e4e9cd0a868e00ebb02e39ec5">MEAN</a>: Arithmetic mean (average), equivalent to sum/count. </li>
                  <li> <a className="el" href="/content/api/cs/structkinetica_1_1AggregateStatisticsRequest_1_1Stats#a2a7cb3fb00a4a46add353855681c9612">STDV</a>: Sample standard deviation (denominator is count-1). </li>
                  <li> <a className="el" href="/content/api/cs/structkinetica_1_1AggregateStatisticsRequest_1_1Stats#a4078fbc16884aff4e45915feabec72c2">VARIANCE</a>: Unbiased sample variance (denominator is count-1). </li>
                  <li> <a className="el" href="/content/api/cs/structkinetica_1_1AggregateStatisticsRequest_1_1Stats#aa1104b17e525829865af87cb5483e773">SKEW</a>: Skewness (third standardized moment). </li>
                  <li> <a className="el" href="/content/api/cs/structkinetica_1_1AggregateStatisticsRequest_1_1Stats#aa79a1a1776b7d294fe2210c38881e77c">KURTOSIS</a>: Kurtosis (fourth standardized moment). </li>
                  <li> <a className="el" href="/content/api/cs/structkinetica_1_1AggregateStatisticsRequest_1_1Stats#a61af5c5f290f944b3d59bbbe281a36be">SUM</a>: Sum of all values in the column(s). </li>
                  <li> <a className="el" href="/content/api/cs/structkinetica_1_1AggregateStatisticsRequest_1_1Stats#ad6fa1ef1242407b30f12314e18f0bd66">MIN</a>: Minimum value of the column(s). </li>
                  <li> <a className="el" href="/content/api/cs/structkinetica_1_1AggregateStatisticsRequest_1_1Stats#a59d17724a5382e5dc6ca903cb8f32722">MAX</a>: Maximum value of the column(s). </li>
                  <li> <a className="el" href="/content/api/cs/structkinetica_1_1AggregateStatisticsRequest_1_1Stats#a70ad37e69b7d6710837e18de9713fc10">WEIGHTED\_AVERAGE</a>: Weighted arithmetic mean (using the option <a className="el" href="/content/api/cs/structkinetica_1_1AggregateStatisticsRequest_1_1Options#a2d9a1f9e9945044e64dd81527a8d2a47">WEIGHT\_COLUMN\_NAME</a> as the weighting column). </li>
                  <li> <a className="el" href="/content/api/cs/structkinetica_1_1AggregateStatisticsRequest_1_1Stats#a116f7f0f7f3b46136c3dcb78e5afc963">CARDINALITY</a>: Number of unique values in the column(s). </li>
                  <li> <a className="el" href="/content/api/cs/structkinetica_1_1AggregateStatisticsRequest_1_1Stats#a20a11628c07613e3ae2ba3583f690a66">ESTIMATED\_CARDINALITY</a>: Estimate (via hyperloglog technique) of the number of unique values in the column(s). </li>
                  <li> <a className="el" href="/content/api/cs/structkinetica_1_1AggregateStatisticsRequest_1_1Stats#aacd763b025f8f2595b9703a893d0b3d1">PERCENTILE</a>: Estimate (via t-digest) of the given percentile of the column(s) (percentile(50.0) will be an approximation of the median). Add a second, comma-separated value to calculate percentile resolution, e.g., 'percentile(75,150)'. </li>
                  <li> <a className="el" href="/content/api/cs/structkinetica_1_1AggregateStatisticsRequest_1_1Stats#af4bfd852c306355293fe5578b61817de">PERCENTILE\_RANK</a>: Estimate (via t-digest) of the percentile rank of the given value in the column(s) (if the given value is the median of the column(s), percentile\_rank(\<median>) will return approximately 50.0). </li>
                </ul>
              </td>
            </tr>

            <tr>
              <td className="paramname">options</td>

              <td>
                Optional parameters.

                <ul>
                  <li> <a className="el" href="/content/api/cs/structkinetica_1_1AggregateStatisticsRequest_1_1Options#a1e269463a87980a31a2c23040edb1f43">ADDITIONAL\_COLUMN\_NAMES</a>: A list of comma separated column names over which statistics can be accumulated along with the primary column. All columns listed and <span className="em">column\_name</span> must be of the same type. Must not include the column specified in <span className="em">column\_name</span> and no column can be listed twice. </li>
                  <li> <a className="el" href="/content/api/cs/structkinetica_1_1AggregateStatisticsRequest_1_1Options#a2d9a1f9e9945044e64dd81527a8d2a47">WEIGHT\_COLUMN\_NAME</a>: Name of column used as weighting attribute for the weighted average statistic. </li>
                </ul>

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

      <div className="dl section return">
        <div className="dt">Returns</div>
        <div className="dd">Response object containing the result of the operation. </div>
      </div>

      <p className="definition">Definition at line <a className="el" href="https://github.com/kineticadb/kinetica-api-cs/blob/master/Kinetica/KineticaFunctions.cs#L6207">6207</a> of file <a className="el" href="https://github.com/kineticadb/kinetica-api-cs/blob/master/Kinetica/KineticaFunctions.cs">KineticaFunctions.cs</a>.</p>
    </div>
  </div>

  <div id="a4061b806cdd72f6f179aaaf534bc64f4" />

  <h2 className="memtitle"><span className="permalink"><a href="#a4061b806cdd72f6f179aaaf534bc64f4">◆ </a></span>AggregateStatisticsAsync() <span className="overload">\[1/2]</span></h2>

  <div className="memitem">
    <div className="memproto">
      <table className="mlabels">
        <tr>
          <td className="mlabels-left">
            <table className="memname">
              <tr>
                <td className="memname">async System.Threading.Tasks.Task\< <a className="el" href="/content/api/cs/classkinetica_1_1AggregateStatisticsResponse">AggregateStatisticsResponse</a> > kinetica.Kinetica.AggregateStatisticsAsync </td>
                <td>(</td>
                <td className="paramtype"><a className="el" href="/content/api/cs/classkinetica_1_1AggregateStatisticsRequest">AggregateStatisticsRequest</a></td>
                <td className="paramname"><span className="paramname"><span className="em">request\_</span></span>, </td>
              </tr>

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

                <td />

                <td className="paramtype">System.Threading.CancellationToken</td>
                <td className="paramname"><span className="paramname"><span className="em">cancellationToken</span></span><span className="paramdefsep"> = </span><span className="paramdefval">default</span> )</td>
              </tr>
            </table>
          </td>

          <td className="mlabels-right"> <span className="mlabels"><span className="mlabel inline">inline</span></span> </td>
        </tr>
      </table>
    </div>

    <div className="memdoc">
      <p>Calculates the requested statistics of the given column(s) in a given table. </p>
      <p>(async) </p>
      <p>The available statistics are: <a className="el" href="/content/api/cs/structkinetica_1_1AggregateStatisticsRequest_1_1Stats#a1d2d290d476df9298613017ff2a5beba">COUNT</a> (number of total objects), <a className="el" href="/content/api/cs/structkinetica_1_1AggregateStatisticsRequest_1_1Stats#ab5fb571e4e9cd0a868e00ebb02e39ec5">MEAN</a>, <a className="el" href="/content/api/cs/structkinetica_1_1AggregateStatisticsRequest_1_1Stats#a2a7cb3fb00a4a46add353855681c9612">STDV</a> (standard deviation), <a className="el" href="/content/api/cs/structkinetica_1_1AggregateStatisticsRequest_1_1Stats#a4078fbc16884aff4e45915feabec72c2">VARIANCE</a>, <a className="el" href="/content/api/cs/structkinetica_1_1AggregateStatisticsRequest_1_1Stats#aa1104b17e525829865af87cb5483e773">SKEW</a>, <a className="el" href="/content/api/cs/structkinetica_1_1AggregateStatisticsRequest_1_1Stats#aa79a1a1776b7d294fe2210c38881e77c">KURTOSIS</a>, <a className="el" href="/content/api/cs/structkinetica_1_1AggregateStatisticsRequest_1_1Stats#a61af5c5f290f944b3d59bbbe281a36be">SUM</a>, <a className="el" href="/content/api/cs/structkinetica_1_1AggregateStatisticsRequest_1_1Stats#ad6fa1ef1242407b30f12314e18f0bd66">MIN</a>, <a className="el" href="/content/api/cs/structkinetica_1_1AggregateStatisticsRequest_1_1Stats#a59d17724a5382e5dc6ca903cb8f32722">MAX</a>, <a className="el" href="/content/api/cs/structkinetica_1_1AggregateStatisticsRequest_1_1Stats#a70ad37e69b7d6710837e18de9713fc10">WEIGHTED\_AVERAGE</a>, <a className="el" href="/content/api/cs/structkinetica_1_1AggregateStatisticsRequest_1_1Stats#a116f7f0f7f3b46136c3dcb78e5afc963">CARDINALITY</a> (unique count), <a className="el" href="/content/api/cs/structkinetica_1_1AggregateStatisticsRequest_1_1Stats#a20a11628c07613e3ae2ba3583f690a66">ESTIMATED\_CARDINALITY</a>, <a className="el" href="/content/api/cs/structkinetica_1_1AggregateStatisticsRequest_1_1Stats#aacd763b025f8f2595b9703a893d0b3d1">PERCENTILE</a>, and <a className="el" href="/content/api/cs/structkinetica_1_1AggregateStatisticsRequest_1_1Stats#af4bfd852c306355293fe5578b61817de">PERCENTILE\_RANK</a>.</p>
      <p>Estimated cardinality is calculated by using the hyperloglog approximation technique.</p>
      <p>Percentiles and percentile ranks are approximate and are calculated using the t-digest algorithm. They must include the desired <a className="el" href="/content/api/cs/structkinetica_1_1AggregateStatisticsRequest_1_1Stats#aacd763b025f8f2595b9703a893d0b3d1">PERCENTILE</a>/<a className="el" href="/content/api/cs/structkinetica_1_1AggregateStatisticsRequest_1_1Stats#af4bfd852c306355293fe5578b61817de">PERCENTILE\_RANK</a>. To compute multiple percentiles each value must be specified separately (i.e. 'percentile(75.0),percentile(99.0),percentile\_rank(1234.56),percentile\_rank(-5)').</p>
      <p>A second, comma-separated value can be added to the <a className="el" href="/content/api/cs/structkinetica_1_1AggregateStatisticsRequest_1_1Stats#aacd763b025f8f2595b9703a893d0b3d1">PERCENTILE</a> statistic to calculate percentile resolution, e.g., a 50th percentile with 200 resolution would be 'percentile(50,200)'.</p>
      <p>The weighted average statistic requires a weight column to be specified in <a className="el" href="/content/api/cs/structkinetica_1_1AggregateStatisticsRequest_1_1Options#a2d9a1f9e9945044e64dd81527a8d2a47">WEIGHT\_COLUMN\_NAME</a>. The weighted average is then defined as the sum of the products of <a className="el" href="/content/api/cs/classkinetica_1_1AggregateStatisticsRequest#aa789056d7b0c50c9d227b0eb95f79e10">column\_name</a> times the <a className="el" href="/content/api/cs/structkinetica_1_1AggregateStatisticsRequest_1_1Options#a2d9a1f9e9945044e64dd81527a8d2a47">WEIGHT\_COLUMN\_NAME</a> values divided by the sum of the <a className="el" href="/content/api/cs/structkinetica_1_1AggregateStatisticsRequest_1_1Options#a2d9a1f9e9945044e64dd81527a8d2a47">WEIGHT\_COLUMN\_NAME</a> values.</p>
      <p>Additional columns can be used in the calculation of statistics via <a className="el" href="/content/api/cs/structkinetica_1_1AggregateStatisticsRequest_1_1Options#a1e269463a87980a31a2c23040edb1f43">ADDITIONAL\_COLUMN\_NAMES</a>. Values in these columns will be included in the overall aggregate calculation–individual aggregates will not be calculated per additional column. For instance, requesting the <a className="el" href="/content/api/cs/structkinetica_1_1AggregateStatisticsRequest_1_1Stats#a1d2d290d476df9298613017ff2a5beba">COUNT</a> and <a className="el" href="/content/api/cs/structkinetica_1_1AggregateStatisticsRequest_1_1Stats#ab5fb571e4e9cd0a868e00ebb02e39ec5">MEAN</a> of <a className="el" href="/content/api/cs/classkinetica_1_1AggregateStatisticsRequest#aa789056d7b0c50c9d227b0eb95f79e10">column\_name</a> x and <a className="el" href="/content/api/cs/structkinetica_1_1AggregateStatisticsRequest_1_1Options#a1e269463a87980a31a2c23040edb1f43">ADDITIONAL\_COLUMN\_NAMES</a> y and z, where x holds the numbers 1-10, y holds 11-20, and z holds 21-30, would return the total number of x, y, and z values (30), and the single average value across all x, y, and z values (15.5).</p>
      <p>The response includes a list of key/value pairs of each statistic requested and its corresponding value.</p>

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

        <div className="dd">
          <table className="params">
            <tr>
              <td className="paramname">request\_</td>
              <td>Request object containing the parameters for the operation.</td>
            </tr>

            <tr>
              <td className="paramname">cancellationToken</td>
              <td>Cancellation token to cancel the operation.</td>
            </tr>
          </table>
        </div>
      </div>

      <div className="dl section return">
        <div className="dt">Returns</div>
        <div className="dd">Task that returns the response object containing the result of the operation.</div>
      </div>

      <p className="definition">Definition at line <a className="el" href="https://github.com/kineticadb/kinetica-api-cs/blob/master/Kinetica/KineticaFunctions.cs#L6007">6007</a> of file <a className="el" href="https://github.com/kineticadb/kinetica-api-cs/blob/master/Kinetica/KineticaFunctions.cs">KineticaFunctions.cs</a>.</p>
    </div>
  </div>

  <div id="a51ef2b560522576a24ad8361c86d4165" />

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

  <div className="memitem">
    <div className="memproto">
      <table className="mlabels">
        <tr>
          <td className="mlabels-left">
            <table className="memname">
              <tr>
                <td className="memname">async System.Threading.Tasks.Task\< <a className="el" href="/content/api/cs/classkinetica_1_1AggregateStatisticsResponse">AggregateStatisticsResponse</a> > kinetica.Kinetica.AggregateStatisticsAsync </td>
                <td>(</td>
                <td className="paramtype">string</td>
                <td className="paramname"><span className="paramname"><span className="em">table\_name</span></span>, </td>
              </tr>

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

                <td />

                <td className="paramtype">string</td>
                <td className="paramname"><span className="paramname"><span className="em">column\_name</span></span>, </td>
              </tr>

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

                <td />

                <td className="paramtype">string</td>
                <td className="paramname"><span className="paramname"><span className="em">stats</span></span>, </td>
              </tr>

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

                <td />

                <td className="paramtype">IDictionary\< string, string ></td>
                <td className="paramname"><span className="paramname"><span className="em">options</span></span><span className="paramdefsep"> = </span><span className="paramdefval">null</span>, </td>
              </tr>

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

                <td />

                <td className="paramtype">System.Threading.CancellationToken</td>
                <td className="paramname"><span className="paramname"><span className="em">cancellationToken</span></span><span className="paramdefsep"> = </span><span className="paramdefval">default</span> )</td>
              </tr>
            </table>
          </td>

          <td className="mlabels-right"> <span className="mlabels"><span className="mlabel inline">inline</span></span> </td>
        </tr>
      </table>
    </div>

    <div className="memdoc">
      <p>Calculates the requested statistics of the given column(s) in a given table. </p>
      <p>(async) </p>
      <p>The available statistics are: <a className="el" href="/content/api/cs/structkinetica_1_1AggregateStatisticsRequest_1_1Stats#a1d2d290d476df9298613017ff2a5beba">COUNT</a> (number of total objects), <a className="el" href="/content/api/cs/structkinetica_1_1AggregateStatisticsRequest_1_1Stats#ab5fb571e4e9cd0a868e00ebb02e39ec5">MEAN</a>, <a className="el" href="/content/api/cs/structkinetica_1_1AggregateStatisticsRequest_1_1Stats#a2a7cb3fb00a4a46add353855681c9612">STDV</a> (standard deviation), <a className="el" href="/content/api/cs/structkinetica_1_1AggregateStatisticsRequest_1_1Stats#a4078fbc16884aff4e45915feabec72c2">VARIANCE</a>, <a className="el" href="/content/api/cs/structkinetica_1_1AggregateStatisticsRequest_1_1Stats#aa1104b17e525829865af87cb5483e773">SKEW</a>, <a className="el" href="/content/api/cs/structkinetica_1_1AggregateStatisticsRequest_1_1Stats#aa79a1a1776b7d294fe2210c38881e77c">KURTOSIS</a>, <a className="el" href="/content/api/cs/structkinetica_1_1AggregateStatisticsRequest_1_1Stats#a61af5c5f290f944b3d59bbbe281a36be">SUM</a>, <a className="el" href="/content/api/cs/structkinetica_1_1AggregateStatisticsRequest_1_1Stats#ad6fa1ef1242407b30f12314e18f0bd66">MIN</a>, <a className="el" href="/content/api/cs/structkinetica_1_1AggregateStatisticsRequest_1_1Stats#a59d17724a5382e5dc6ca903cb8f32722">MAX</a>, <a className="el" href="/content/api/cs/structkinetica_1_1AggregateStatisticsRequest_1_1Stats#a70ad37e69b7d6710837e18de9713fc10">WEIGHTED\_AVERAGE</a>, <a className="el" href="/content/api/cs/structkinetica_1_1AggregateStatisticsRequest_1_1Stats#a116f7f0f7f3b46136c3dcb78e5afc963">CARDINALITY</a> (unique count), <a className="el" href="/content/api/cs/structkinetica_1_1AggregateStatisticsRequest_1_1Stats#a20a11628c07613e3ae2ba3583f690a66">ESTIMATED\_CARDINALITY</a>, <a className="el" href="/content/api/cs/structkinetica_1_1AggregateStatisticsRequest_1_1Stats#aacd763b025f8f2595b9703a893d0b3d1">PERCENTILE</a>, and <a className="el" href="/content/api/cs/structkinetica_1_1AggregateStatisticsRequest_1_1Stats#af4bfd852c306355293fe5578b61817de">PERCENTILE\_RANK</a>.</p>
      <p>Estimated cardinality is calculated by using the hyperloglog approximation technique.</p>
      <p>Percentiles and percentile ranks are approximate and are calculated using the t-digest algorithm. They must include the desired <a className="el" href="/content/api/cs/structkinetica_1_1AggregateStatisticsRequest_1_1Stats#aacd763b025f8f2595b9703a893d0b3d1">PERCENTILE</a>/<a className="el" href="/content/api/cs/structkinetica_1_1AggregateStatisticsRequest_1_1Stats#af4bfd852c306355293fe5578b61817de">PERCENTILE\_RANK</a>. To compute multiple percentiles each value must be specified separately (i.e. 'percentile(75.0),percentile(99.0),percentile\_rank(1234.56),percentile\_rank(-5)').</p>
      <p>A second, comma-separated value can be added to the <a className="el" href="/content/api/cs/structkinetica_1_1AggregateStatisticsRequest_1_1Stats#aacd763b025f8f2595b9703a893d0b3d1">PERCENTILE</a> statistic to calculate percentile resolution, e.g., a 50th percentile with 200 resolution would be 'percentile(50,200)'.</p>
      <p>The weighted average statistic requires a weight column to be specified in <a className="el" href="/content/api/cs/structkinetica_1_1AggregateStatisticsRequest_1_1Options#a2d9a1f9e9945044e64dd81527a8d2a47">WEIGHT\_COLUMN\_NAME</a>. The weighted average is then defined as the sum of the products of <span className="em">column\_name</span> times the <a className="el" href="/content/api/cs/structkinetica_1_1AggregateStatisticsRequest_1_1Options#a2d9a1f9e9945044e64dd81527a8d2a47">WEIGHT\_COLUMN\_NAME</a> values divided by the sum of the <a className="el" href="/content/api/cs/structkinetica_1_1AggregateStatisticsRequest_1_1Options#a2d9a1f9e9945044e64dd81527a8d2a47">WEIGHT\_COLUMN\_NAME</a> values.</p>
      <p>Additional columns can be used in the calculation of statistics via <a className="el" href="/content/api/cs/structkinetica_1_1AggregateStatisticsRequest_1_1Options#a1e269463a87980a31a2c23040edb1f43">ADDITIONAL\_COLUMN\_NAMES</a>. Values in these columns will be included in the overall aggregate calculation–individual aggregates will not be calculated per additional column. For instance, requesting the <a className="el" href="/content/api/cs/structkinetica_1_1AggregateStatisticsRequest_1_1Stats#a1d2d290d476df9298613017ff2a5beba">COUNT</a> and <a className="el" href="/content/api/cs/structkinetica_1_1AggregateStatisticsRequest_1_1Stats#ab5fb571e4e9cd0a868e00ebb02e39ec5">MEAN</a> of <span className="em">column\_name</span> x and <a className="el" href="/content/api/cs/structkinetica_1_1AggregateStatisticsRequest_1_1Options#a1e269463a87980a31a2c23040edb1f43">ADDITIONAL\_COLUMN\_NAMES</a> y and z, where x holds the numbers 1-10, y holds 11-20, and z holds 21-30, would return the total number of x, y, and z values (30), and the single average value across all x, y, and z values (15.5).</p>
      <p>The response includes a list of key/value pairs of each statistic requested and its corresponding value.</p>

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

        <div className="dd">
          <table className="params">
            <tr>
              <td className="paramname">table\_name</td>
              <td>Name of the table on which the statistics operation will be performed, 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="paramname">column\_name</td>
              <td>Name of the primary column for which the statistics are to be calculated.</td>
            </tr>

            <tr>
              <td className="paramname">stats</td>

              <td>
                Comma separated list of the statistics to calculate, e.g. "sum,mean". Supported values:

                <ul>
                  <li> <a className="el" href="/content/api/cs/structkinetica_1_1AggregateStatisticsRequest_1_1Stats#a1d2d290d476df9298613017ff2a5beba">COUNT</a>: Number of objects (independent of the given column(s)). </li>
                  <li> <a className="el" href="/content/api/cs/structkinetica_1_1AggregateStatisticsRequest_1_1Stats#ab5fb571e4e9cd0a868e00ebb02e39ec5">MEAN</a>: Arithmetic mean (average), equivalent to sum/count. </li>
                  <li> <a className="el" href="/content/api/cs/structkinetica_1_1AggregateStatisticsRequest_1_1Stats#a2a7cb3fb00a4a46add353855681c9612">STDV</a>: Sample standard deviation (denominator is count-1). </li>
                  <li> <a className="el" href="/content/api/cs/structkinetica_1_1AggregateStatisticsRequest_1_1Stats#a4078fbc16884aff4e45915feabec72c2">VARIANCE</a>: Unbiased sample variance (denominator is count-1). </li>
                  <li> <a className="el" href="/content/api/cs/structkinetica_1_1AggregateStatisticsRequest_1_1Stats#aa1104b17e525829865af87cb5483e773">SKEW</a>: Skewness (third standardized moment). </li>
                  <li> <a className="el" href="/content/api/cs/structkinetica_1_1AggregateStatisticsRequest_1_1Stats#aa79a1a1776b7d294fe2210c38881e77c">KURTOSIS</a>: Kurtosis (fourth standardized moment). </li>
                  <li> <a className="el" href="/content/api/cs/structkinetica_1_1AggregateStatisticsRequest_1_1Stats#a61af5c5f290f944b3d59bbbe281a36be">SUM</a>: Sum of all values in the column(s). </li>
                  <li> <a className="el" href="/content/api/cs/structkinetica_1_1AggregateStatisticsRequest_1_1Stats#ad6fa1ef1242407b30f12314e18f0bd66">MIN</a>: Minimum value of the column(s). </li>
                  <li> <a className="el" href="/content/api/cs/structkinetica_1_1AggregateStatisticsRequest_1_1Stats#a59d17724a5382e5dc6ca903cb8f32722">MAX</a>: Maximum value of the column(s). </li>
                  <li> <a className="el" href="/content/api/cs/structkinetica_1_1AggregateStatisticsRequest_1_1Stats#a70ad37e69b7d6710837e18de9713fc10">WEIGHTED\_AVERAGE</a>: Weighted arithmetic mean (using the option <a className="el" href="/content/api/cs/structkinetica_1_1AggregateStatisticsRequest_1_1Options#a2d9a1f9e9945044e64dd81527a8d2a47">WEIGHT\_COLUMN\_NAME</a> as the weighting column). </li>
                  <li> <a className="el" href="/content/api/cs/structkinetica_1_1AggregateStatisticsRequest_1_1Stats#a116f7f0f7f3b46136c3dcb78e5afc963">CARDINALITY</a>: Number of unique values in the column(s). </li>
                  <li> <a className="el" href="/content/api/cs/structkinetica_1_1AggregateStatisticsRequest_1_1Stats#a20a11628c07613e3ae2ba3583f690a66">ESTIMATED\_CARDINALITY</a>: Estimate (via hyperloglog technique) of the number of unique values in the column(s). </li>
                  <li> <a className="el" href="/content/api/cs/structkinetica_1_1AggregateStatisticsRequest_1_1Stats#aacd763b025f8f2595b9703a893d0b3d1">PERCENTILE</a>: Estimate (via t-digest) of the given percentile of the column(s) (percentile(50.0) will be an approximation of the median). Add a second, comma-separated value to calculate percentile resolution, e.g., 'percentile(75,150)'. </li>
                  <li> <a className="el" href="/content/api/cs/structkinetica_1_1AggregateStatisticsRequest_1_1Stats#af4bfd852c306355293fe5578b61817de">PERCENTILE\_RANK</a>: Estimate (via t-digest) of the percentile rank of the given value in the column(s) (if the given value is the median of the column(s), percentile\_rank(\<median>) will return approximately 50.0). </li>
                </ul>
              </td>
            </tr>

            <tr>
              <td className="paramname">options</td>

              <td>
                Optional parameters.

                <ul>
                  <li> <a className="el" href="/content/api/cs/structkinetica_1_1AggregateStatisticsRequest_1_1Options#a1e269463a87980a31a2c23040edb1f43">ADDITIONAL\_COLUMN\_NAMES</a>: A list of comma separated column names over which statistics can be accumulated along with the primary column. All columns listed and <span className="em">column\_name</span> must be of the same type. Must not include the column specified in <span className="em">column\_name</span> and no column can be listed twice. </li>
                  <li> <a className="el" href="/content/api/cs/structkinetica_1_1AggregateStatisticsRequest_1_1Options#a2d9a1f9e9945044e64dd81527a8d2a47">WEIGHT\_COLUMN\_NAME</a>: Name of column used as weighting attribute for the weighted average statistic. </li>
                </ul>

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

            <tr>
              <td className="paramname">cancellationToken</td>
              <td>Cancellation token to cancel the operation.</td>
            </tr>
          </table>
        </div>
      </div>

      <div className="dl section return">
        <div className="dt">Returns</div>
        <div className="dd">Task that returns the response object containing the result of the operation.</div>
      </div>

      <p className="definition">Definition at line <a className="el" href="https://github.com/kineticadb/kinetica-api-cs/blob/master/Kinetica/KineticaFunctions.cs#L6411">6411</a> of file <a className="el" href="https://github.com/kineticadb/kinetica-api-cs/blob/master/Kinetica/KineticaFunctions.cs">KineticaFunctions.cs</a>.</p>
    </div>
  </div>
</div>
