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

# filter

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

  <h2 className="memtitle"><span className="permalink"><a href="#ad975f31cd9d87d805ebb0513f652eca6">◆ </a></span>filter() <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_1FilterResponse">FilterResponse</a> gpudb::GPUdb::filter </td>
          <td>(</td>
          <td className="paramtype">const <a className="el" href="/content/api/cpp/structgpudb_1_1FilterRequest">FilterRequest</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>Filters data based on the specified expression. </p>
      <p>The results are stored in a <a href="/content/concepts/filtered_views/" target="_top">result set</a> with the given <a className="el" href="/content/api/cpp/structgpudb_1_1FilterRequest#a7a88abd6b2c66418fc3224690efbcd11">viewName</a>.</p>
      <p>For details see <a href="/content/concepts/expressions/" target="_top">Expressions</a>.</p>
      <p>The response message contains the number of points for which the expression evaluated to be true, which is equivalent to the size of the result view.</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_1FilterRequest">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_1FilterResponse">Response</a> object containing the result of the operation. </div>
      </div>
    </div>
  </div>

  <div id="a345135f1227d9d1576c3d30a997a258d" />

  <h2 className="memtitle"><span className="permalink"><a href="#a345135f1227d9d1576c3d30a997a258d">◆ </a></span>filter() <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_1FilterResponse">FilterResponse</a> & gpudb::GPUdb::filter </td>
          <td>(</td>
          <td className="paramtype">const <a className="el" href="/content/api/cpp/structgpudb_1_1FilterRequest">FilterRequest</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_1FilterResponse">FilterResponse</a> &</td>
          <td className="paramname"><span className="paramname"><span className="em">response\_</span></span> ) const</td>
        </tr>
      </table>
    </div>

    <div className="memdoc">
      <p>Filters data based on the specified expression. </p>
      <p>The results are stored in a <a href="/content/concepts/filtered_views/" target="_top">result set</a> with the given <a className="el" href="/content/api/cpp/structgpudb_1_1FilterRequest#a7a88abd6b2c66418fc3224690efbcd11">viewName</a>.</p>
      <p>For details see <a href="/content/concepts/expressions/" target="_top">Expressions</a>.</p>
      <p>The response message contains the number of points for which the expression evaluated to be true, which is equivalent to the size of the result view.</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_1FilterRequest">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_1FilterResponse">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_1FilterResponse">Response</a> object containing the result of the operation (initially passed in by reference). </div>
      </div>
    </div>
  </div>

  <div id="ac5b65e73c01c331f1fcfb21b0e8d67ce" />

  <h2 className="memtitle"><span className="permalink"><a href="#ac5b65e73c01c331f1fcfb21b0e8d67ce">◆ </a></span>filter() <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_1FilterResponse">FilterResponse</a> gpudb::GPUdb::filter </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">viewName</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">expression</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>Filters data based on the specified expression. </p>
      <p>The results are stored in a <a href="/content/concepts/filtered_views/" target="_top">result set</a> with the given <span className="em arg">viewName</span>.</p>
      <p>For details see <a href="/content/concepts/expressions/" target="_top">Expressions</a>.</p>
      <p>The response message contains the number of points for which the expression evaluated to be true, which is equivalent to the size of the result view.</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 to filter, in \[schema\_name.]table\_name format, using standard <a href="/content/concepts/tables/#table-name-resolution" target="_top">name resolution rules</a>. This may be the name of a table or a view (when chaining queries). </td>
            </tr>

            <tr>
              <td className="paramdir">\[in]</td>
              <td className="paramname">viewName</td>
              <td>If provided, then this will be the name of the view containing the results, in \[schema\_name.]view\_name format, using standard <a href="/content/concepts/tables/#table-name-resolution" target="_top">name resolution rules</a> and meeting <a href="/content/concepts/tables/#table-naming-criteria" target="_top">table naming criteria</a>. Must not be an already existing table or view. The default value is ''. </td>
            </tr>

            <tr>
              <td className="paramdir">\[in]</td>
              <td className="paramname">expression</td>
              <td>The select expression to filter the specified table. For details see <a href="/content/concepts/expressions/" target="_top">Expressions</a>. </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#a1971f80bf1fcdb4621d3b041ef370ba5">filter\_create\_temp\_table</a>: If <a className="el" href="/content/api/cpp/namespacegpudb#a2a4b400ec6df130a22393344cd0c3320">true</a>, a unique temporary table name will be generated in the sys\_temp schema and used in place of <span className="em arg">viewName</span>. This is always allowed even if the caller does not have permission to create tables. The generated name is returned in <a className="el" href="/content/api/cpp/namespacegpudb#a78930610ce1aebc6008c576a2cc7cc2c">qualified\_view\_name</a>. Supported values:

                    <ul>
                      <li> <a className="el" href="/content/api/cpp/namespacegpudb#a2a4b400ec6df130a22393344cd0c3320">filter\_true</a> </li>
                      <li> <a className="el" href="/content/api/cpp/namespacegpudb#aaff79a4ddba623ac0d20db43f399e8f4">filter\_false</a> </li>
                    </ul>

                    The default value is <a className="el" href="/content/api/cpp/namespacegpudb#aaff79a4ddba623ac0d20db43f399e8f4">filter\_false</a>.
                  </li>

                  <li> <a className="el" href="/content/api/cpp/namespacegpudb#a9927509352a13c67d949a7f7b1b84422">filter\_collection\_name</a>: \[DEPRECATED–please specify the containing schema for the view as part of <span className="em arg">viewName</span> and use <a className="el" href="#a33d9a0a8e738d14b688f9f869f9640ad">createSchema</a> to create the schema if non-existent] Name of a schema for the newly created view. If the schema is non-existent, it will be automatically created. </li>
                  <li> <a className="el" href="/content/api/cpp/namespacegpudb#a311644db88d1ce29d716715519e4c474">filter\_view\_id</a>: View this filtered-view is part of. The default value is ''. </li>
                  <li> <a className="el" href="/content/api/cpp/namespacegpudb#a92682542e63a9580e5bde8c728398e59">filter\_ttl</a>: Sets the <a href="/content/concepts/ttl/" target="_top">TTL</a> of the view specified in <span className="em arg">viewName</span>. </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_1FilterResponse">Response</a> object containing the result of the operation. </div>
      </div>
    </div>
  </div>

  <div id="a98d8963830d3286bd2bbee4271a259b0" />

  <h2 className="memtitle"><span className="permalink"><a href="#a98d8963830d3286bd2bbee4271a259b0">◆ </a></span>filter() <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_1FilterResponse">FilterResponse</a> & gpudb::GPUdb::filter </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">viewName</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">expression</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_1FilterResponse">FilterResponse</a> &</td>
          <td className="paramname"><span className="paramname"><span className="em">response\_</span></span> ) const</td>
        </tr>
      </table>
    </div>

    <div className="memdoc">
      <p>Filters data based on the specified expression. </p>
      <p>The results are stored in a <a href="/content/concepts/filtered_views/" target="_top">result set</a> with the given <span className="em arg">viewName</span>.</p>
      <p>For details see <a href="/content/concepts/expressions/" target="_top">Expressions</a>.</p>
      <p>The response message contains the number of points for which the expression evaluated to be true, which is equivalent to the size of the result view.</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 to filter, in \[schema\_name.]table\_name format, using standard <a href="/content/concepts/tables/#table-name-resolution" target="_top">name resolution rules</a>. This may be the name of a table or a view (when chaining queries). </td>
            </tr>

            <tr>
              <td className="paramdir">\[in]</td>
              <td className="paramname">viewName</td>
              <td>If provided, then this will be the name of the view containing the results, in \[schema\_name.]view\_name format, using standard <a href="/content/concepts/tables/#table-name-resolution" target="_top">name resolution rules</a> and meeting <a href="/content/concepts/tables/#table-naming-criteria" target="_top">table naming criteria</a>. Must not be an already existing table or view. The default value is ''. </td>
            </tr>

            <tr>
              <td className="paramdir">\[in]</td>
              <td className="paramname">expression</td>
              <td>The select expression to filter the specified table. For details see <a href="/content/concepts/expressions/" target="_top">Expressions</a>. </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#a1971f80bf1fcdb4621d3b041ef370ba5">filter\_create\_temp\_table</a>: If <a className="el" href="/content/api/cpp/namespacegpudb#a2a4b400ec6df130a22393344cd0c3320">true</a>, a unique temporary table name will be generated in the sys\_temp schema and used in place of <span className="em arg">viewName</span>. This is always allowed even if the caller does not have permission to create tables. The generated name is returned in <a className="el" href="/content/api/cpp/namespacegpudb#a78930610ce1aebc6008c576a2cc7cc2c">qualified\_view\_name</a>. Supported values:

                    <ul>
                      <li> <a className="el" href="/content/api/cpp/namespacegpudb#a2a4b400ec6df130a22393344cd0c3320">filter\_true</a> </li>
                      <li> <a className="el" href="/content/api/cpp/namespacegpudb#aaff79a4ddba623ac0d20db43f399e8f4">filter\_false</a> </li>
                    </ul>

                    The default value is <a className="el" href="/content/api/cpp/namespacegpudb#aaff79a4ddba623ac0d20db43f399e8f4">filter\_false</a>.
                  </li>

                  <li> <a className="el" href="/content/api/cpp/namespacegpudb#a9927509352a13c67d949a7f7b1b84422">filter\_collection\_name</a>: \[DEPRECATED–please specify the containing schema for the view as part of <span className="em arg">viewName</span> and use <a className="el" href="#a33d9a0a8e738d14b688f9f869f9640ad">createSchema</a> to create the schema if non-existent] Name of a schema for the newly created view. If the schema is non-existent, it will be automatically created. </li>
                  <li> <a className="el" href="/content/api/cpp/namespacegpudb#a311644db88d1ce29d716715519e4c474">filter\_view\_id</a>: View this filtered-view is part of. The default value is ''. </li>
                  <li> <a className="el" href="/content/api/cpp/namespacegpudb#a92682542e63a9580e5bde8c728398e59">filter\_ttl</a>: Sets the <a href="/content/concepts/ttl/" target="_top">TTL</a> of the view specified in <span className="em arg">viewName</span>. </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_1FilterResponse">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_1FilterResponse">Response</a> object containing the result of the operation (initially passed in by reference). </div>
      </div>
    </div>
  </div>
</div>
