---
schema_version: "1"
id: c2a500d0699212f1a771e75826b905129a9a9e05dc8c7a53c2aa9a61386b936d
title: SQL Functions for Insights
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/data/264-0-0/c360_a_calculated_insights_aggregates.md
canonical_url: https://help.salesforce.com/s/articleView?id=data.c360_a_calculated_insights_aggregates.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 730aa2dbb85eb5e3fd03450b9f0f54f9ded31dab8cca25aa748aedf13f3fc35e
description: Use these aggregate, datetime, analytical, formatting, math and statistical, and boolean functions when you author calculated insights in Data 360. The Aggregatable column indicates whether a function's output can be rolled up across fewer dimensions when queried in segments or activations.
products:
  - Data 360
release: "264"
---
# SQL Functions for Insights

Use these aggregate, datetime, analytical, formatting, math and statistical, and boolean functions when you author calculated insights in Data 360. The Aggregatable column indicates whether a function's output can be rolled up across fewer dimensions when queried in segments or activations.

### Required Editions

![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-data-data_cloud-264-0-0-production-enus/f3569962-3c9b-4f83-9d0c-b6a574e785da/images/icon_note.png)

Note Streaming and real-time insights support only the SUM and COUNT aggregate functions.

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small edition"><colgroup><col></colgroup><tbody><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: <strong>All Editions</strong> supported by Data 360. See <a href="https://help.salesforce.com/s/articleView?id=data.c360_a_dc_editions.htm&amp;language=en_US" target="_blank">Data 360 edition availability</a>.</td></tr></tbody></table>

## Aggregatable and Non-Aggregatable Metrics

Some functions produce metrics that can be rolled up or collapsed across dimensions. These are called aggregatable metrics. Functions such as SUM, COUNT, and AVG are examples of aggregatable metrics. You can query the result for any subset of the dimensions you defined when you created the insight.

Other functions produce non-aggregatable metrics. Functions such as RANK, NTILE, and CASE are examples of non-aggregatable metrics. Because the result depends on all the dimensions at once, you can't reduce or collapse the metric to a smaller set of dimensions. When you query a non-aggregatable metric, you must provide values for all the dimensions that were defined when you created the insight.

For example, if you create a metric called "Rank customers by total spend by product category and location" using the RANK function, you can't later query that rank for product category alone. When querying the metric, you must always specify both "Product Category" and "Location."

```sql
SELECT
  ssot__SalesOrder__dlm.ssot__SalesChannelId__c AS channel__c,
  RANK() OVER (ORDER BY SUM(ssot__SalesOrder__dlm.ssot__GrandTotalAmount__c) ASC) AS spend_rank__c,
  UnifiedIndividual__dlm.ssot__Id__c AS unified_individual__c
FROM
  ssot__SalesOrder__dlm
  JOIN IndividualIdentityLink__dlm
    ON ssot__SalesOrder__dlm.ssot__SoldToCustomerId__c = IndividualIdentityLink__dlm.SourceRecordId__c
  JOIN UnifiedIndividual__dlm
    ON IndividualIdentityLink__dlm.UnifiedRecordId__c = UnifiedIndividual__dlm.ssot__Id__c
GROUP BY
  unified_individual__c,
  channel__c
```

You can see whether a function produces a non-aggregatable metric in the object home screen of the Calculated Insights.

![A screenshot of the aggregated functions in Calculated Insights](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-data-data_cloud-264-0-0-production-enus/f3569962-3c9b-4f83-9d0c-b6a574e785da/data_cloud/images/CalculatedInsightsAggregatableFunctions.png)

## Aggregate Functions

![Important](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-data-data_cloud-264-0-0-production-enus/f3569962-3c9b-4f83-9d0c-b6a574e785da/images/icon_important.png)

Important To compare the results of aggregate functions, use a CASE WHEN statement. Boolean comparison doesn't support aggregate functions.

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small ">
        <colgroup>
          <col style="width:20.40816326530612%">
          <col style="width:10.20408163265306%">
          <col style="width:28.57142857142857%">
          <col style="width:40.81632653061224%">
        </colgroup>
        <thead class="slds-text-title_caps ">
          <tr class="">
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d192628e114">Function</th>
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d192628e117">Aggregatable</th>
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d192628e120">Description</th>
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d192628e123">Example</th>
          </tr>
        </thead>
        <tbody>
          <tr class="">
            <td data-label="Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e114 "><code>SUM</code></td>

            <td data-label="Aggregatable" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e117 ">Y</td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e120 ">Calculates the total by adding all values in the selected field. Supports
              numerical values.</td>

            <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e123 ">
              <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code class="language-sql">SELECT ProductID, SUM(Quantity)
FROM OrderDetails
GROUP BY ProductID</code></pre>
            </td>

          </tr>
          <tr class="">
            <td data-label="Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e114 "><code>COUNT</code></td>

            <td data-label="Aggregatable" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e117 ">Y</td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e120 ">Counts all values in the selected field. Supports date, text, and boolean
              measures. COUNT(*) isn't supported.</td>

            <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e123 ">
              <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code class="language-sql">SELECT
COUNT(EmailEngagement__dlm.Id__c) as email_engagement_count__c,
UnifiedIndividual__dlm.Id__c as customer_id__c
FROM EmailEngagement__dlm</code></pre>
            </td>

          </tr>
          <tr class="">
            <td data-label="Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e114 "><code>AVG</code></td>

            <td data-label="Aggregatable" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e117 ">Y</td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e120 ">Calculates the average of all the values in the selected field. Supports
              numerical values.</td>

            <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e123 ">
              <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code class="language-sql">SELECT avg(SalesOrder__dlm.TotalAmount__c) as avg__c,
SubQuery1.Id as customer_id__c
FROM SalesOrder__dlm</code></pre>
            </td>

          </tr>
          <tr class="">
            <td data-label="Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e114 "><code>MIN</code></td>

            <td data-label="Aggregatable" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e117 ">Y</td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e120 ">Calculates the minimum value of the selected field. Supports numerical
              values.</td>

            <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e123 ">
              <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code class="language-sql">SELECT MIN(Price) FROM SalesOrder__dlm;</code></pre>
            </td>

          </tr>
          <tr class="">
            <td data-label="Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e114 "><code>MAX</code></td>

            <td data-label="Aggregatable" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e117 ">Y</td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e120 ">Calculates the maximum value of the selected field. Supports numerical
              values.</td>

            <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e123 ">
              <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code class="language-sql">SELECT MAX(Price) FROM SalesOrder__dlm;</code></pre>
            </td>

          </tr>
          <tr class="">
            <td data-label="Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e114 "><code>MEAN</code></td>

            <td data-label="Aggregatable" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e117 ">Y</td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e120 ">Calculates the average of the given dataset by dividing the total sum by the
              number of values in the dataset.</td>

            <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e123 ">
              <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code class="language-sql">SELECT AVG(sale_amount) FROM sales;</code></pre>
            </td>

          </tr>
          <tr class="">
            <td data-label="Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e114 "><code>FIRST</code></td>

            <td data-label="Aggregatable" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e117 ">Y</td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e120 ">Returns the first value of the expression for a group of rows.</td>

            <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e123 ">
              <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code class="language-sql">SELECT first(col)
FROM VALUES (10), (5), (20) AS tab(col); -- 10</code></pre>
            </td>

          </tr>
          <tr class="">
            <td data-label="Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e114 "><code>LAST</code></td>

            <td data-label="Aggregatable" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e117 ">Y</td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e120 ">Returns the last value of the expression for a group of rows.</td>

            <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e123 ">
              <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code class="language-sql">SELECT last(col)
FROM VALUES (10), (5), (20) AS tab(col); -- 20</code></pre>
            </td>

          </tr>
          <tr class="">
            <td data-label="Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e114 "><code>APPROX_COUNT_DISTINCT</code></td>

            <td data-label="Aggregatable" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e117 ">N</td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e120 ">Returns the estimated cardinality by using the HyperLogLog++ algorithm, similar
              to COUNT DISTINCT. Use this function when you want to count unique occurrences of
              dimensions in a calculated insight.</td>

            <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e123 ">
              <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code class="language-sql">SELECT approx_count_distinct(col1)
FROM VALUES (1), (1), (2), (2), (3) tab(col1); -- 3</code></pre>
            </td>

          </tr>
          <tr class="">
            <td data-label="Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e114 "><code>PERCENTILE</code></td>

            <td data-label="Aggregatable" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e117 ">N</td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e120 ">Returns the exact percentile of the numeric column at the given percentage. The
              percentage must be from 0.0 through 1.0.</td>

            <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e123 ">
              <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code class="language-sql">SELECT percentile(col, array(0.25, 0.75))
FROM VALUES (0), (10) AS tab(col); -- [2.5, 7.5]</code></pre>
            </td>

          </tr>
          <tr class="">
            <td data-label="Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e114 "><code>STDDEV</code></td>

            <td data-label="Aggregatable" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e117 ">N</td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e120 ">Returns the statistical standard deviation of all values in the specified
              expression.</td>

            <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e123 ">
              <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code class="language-sql">SELECT stddev(col)</code></pre>
            </td>

          </tr>
        </tbody>
      </table>

## DateTime Functions

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small ">
        <colgroup>
          <col style="width:20.40816326530612%">
          <col style="width:10.20408163265306%">
          <col style="width:28.57142857142857%">
          <col style="width:40.81632653061224%">
        </colgroup>
        <thead class="slds-text-title_caps ">
          <tr class="">
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d192628e344">Function</th>
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d192628e347">Aggregatable</th>
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d192628e350">Description</th>
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d192628e353">Example</th>
          </tr>
        </thead>
        <tbody>
          <tr class="">
            <td data-label="Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e344 "><code>HOUR(TIMESTAMP)</code></td>

            <td data-label="Aggregatable" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e347 ">N</td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e350 ">Returns the hour component of the string or timestamp. Return type: integer
              0–23.</td>

            <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e353 ">
              <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code class="language-sql">SELECT hour('2009-07-30 12:58:59'); -- 12</code></pre>
            </td>

          </tr>
          <tr class="">
            <td data-label="Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e344 "><code>DAY(DATE)</code></td>

            <td data-label="Aggregatable" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e347 ">N</td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e350 ">Returns the day of the month of the date or timestamp. Return type: integer
              1–31.</td>

            <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e353 ">
              <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code class="language-sql">SELECT day('2009-07-30'); -- 30</code></pre>
            </td>

          </tr>
          <tr class="">
            <td data-label="Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e344 "><code>MONTH(DATE)</code></td>

            <td data-label="Aggregatable" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e347 ">N</td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e350 ">Returns the month component of the date or timestamp. Return type: integer
              1–12.</td>

            <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e353 ">
              <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code class="language-sql">SELECT month('2016-07-30'); -- 7</code></pre>
            </td>

          </tr>
          <tr class="">
            <td data-label="Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e344 "><code>QUARTER(DATE)</code></td>

            <td data-label="Aggregatable" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e347 ">N</td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e350 ">Returns the quarter of the year for the date. Return type: integer 1–4.</td>

            <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e353 ">
              <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code class="language-sql">SELECT quarter('2016-08-31'); -- 3</code></pre>
            </td>

          </tr>
          <tr class="">
            <td data-label="Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e344 "><code>YEAR(DATE)</code></td>

            <td data-label="Aggregatable" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e347 ">N</td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e350 ">Returns the year component of the date or timestamp. Return type:
              integer.</td>

            <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e353 ">
              <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code class="language-sql">SELECT year('2016-07-30'); -- 2016</code></pre>
            </td>

          </tr>
          <tr class="">
            <td data-label="Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e344 "><code>CDPHOUR(TIMESTAMP)</code></td>

            <td data-label="Aggregatable" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e347 ">N</td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e350 ">Returns a timestamp representing the hour of the timestamp. Return type:
              timestamp.</td>

            <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e353 ">
              <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code class="language-sql">SELECT CdpHour('2009-07-30 01:10:05');
-- '2009-07-30 01:00:00'</code></pre>
            </td>

          </tr>
          <tr class="">
            <td data-label="Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e344 "><code>CDPDAY(DATE)</code></td>

            <td data-label="Aggregatable" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e347 ">N</td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e350 ">Returns a timestamp representing the 0th hour of the day. Return type:
              timestamp.</td>

            <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e353 ">
              <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code class="language-sql">SELECT CdpDay('2009-07-30 01:10:05');
-- '2009-07-30 00:00:00'</code></pre>
            </td>

          </tr>
          <tr class="">
            <td data-label="Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e344 "><code>CDPMONTH(DATE)</code></td>

            <td data-label="Aggregatable" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e347 ">N</td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e350 ">Returns a timestamp representing the month. Return type: timestamp.</td>

            <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e353 ">
              <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code class="language-sql">SELECT CdpMonth('2009-07-30 01:10:05');
-- '2009-07-01 00:00:00'</code></pre>
            </td>

          </tr>
          <tr class="">
            <td data-label="Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e344 "><code>CDPQUARTER(DATE)</code></td>

            <td data-label="Aggregatable" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e347 ">N</td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e350 ">Returns a timestamp representing the first day of the quarter. Return type:
              timestamp.</td>

            <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e353 ">
              <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code class="language-sql">SELECT CdpQuarter('2009-07-30 01:10:05');
-- '2009-07-01 00:00:00'</code></pre>
            </td>

          </tr>
          <tr class="">
            <td data-label="Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e344 "><code>CDPYEAR(DATE)</code></td>

            <td data-label="Aggregatable" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e347 ">N</td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e350 ">Returns a timestamp representing the first day of the year. Return type:
              timestamp.</td>

            <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e353 ">
              <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code class="language-sql">SELECT CdpYear('2009-07-30 01:10:05');
-- '2009-01-01 00:00:00'</code></pre>
            </td>

          </tr>
          <tr class="">
            <td data-label="Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e344 "><code>CURRENT_DATE</code></td>

            <td data-label="Aggregatable" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e347 ">N</td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e350 ">Returns the current date at the start of query evaluation. All CURRENT_DATE
              calls within the same query return the same value.</td>

            <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e353 ">
              <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code class="language-sql">SELECT current_date(); -- 2020-04-25</code></pre>
            </td>

          </tr>
          <tr class="">
            <td data-label="Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e344 "><code>DATE_SUB</code></td>

            <td data-label="Aggregatable" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e347 ">N</td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e350 ">Subtracts a number of days from the date value and returns the earlier
              date.</td>

            <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e353 ">
              <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code class="language-sql">SELECT date_sub('2016-07-30', 1); -- 2016-07-29</code></pre>
            </td>

          </tr>
          <tr class="">
            <td data-label="Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e344 "><code>DATE_ADD</code></td>

            <td data-label="Aggregatable" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e347 ">N</td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e350 ">Adds a number of days to the date value and returns the later date.</td>

            <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e353 ">
              <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code class="language-sql">SELECT date_add('2016-07-30', 1); -- 2016-07-31</code></pre>
            </td>

          </tr>
          <tr class="">
            <td data-label="Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e344 "><code>DATEDIFF</code></td>

            <td data-label="Aggregatable" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e347 ">N</td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e350 ">Returns the number of days from the start date to the end date.</td>

            <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e353 ">
              <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code class="language-sql">SELECT datediff('2009-07-31', '2009-07-30'); -- 1</code></pre>
            </td>

          </tr>
          <tr class="">
            <td data-label="Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e344 "><code>MONTHS_BETWEEN</code></td>

            <td data-label="Aggregatable" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e347 ">N</td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e350 ">Returns the number of months between two dates.</td>

            <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e353 ">
              <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code class="language-sql">SELECT months_between('1997-02-28 10:30:00', '1996-10-30');
-- 3.94959677</code></pre>
            </td>

          </tr>
          <tr class="">
            <td data-label="Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e344 "><code>DAYOFWEEK</code></td>

            <td data-label="Aggregatable" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e347 ">N</td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e350 ">Returns the day of the week for a date or timestamp (1 = Sunday, 2 = Monday,
              ..., 7 = Saturday).</td>

            <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e353 ">
              <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code class="language-sql">SELECT dayofweek('2009-07-30'); -- 5</code></pre>
            </td>

          </tr>
          <tr class="">
            <td data-label="Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e344 "><code>DAYOFMONTH</code></td>

            <td data-label="Aggregatable" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e347 ">N</td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e350 ">Returns the day of the month of the date or timestamp.</td>

            <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e353 ">
              <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code class="language-sql">SELECT dayofmonth('2009-07-30'); -- 30</code></pre>
            </td>

          </tr>
          <tr class="">
            <td data-label="Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e344 "><code>DAYOFYEAR</code></td>

            <td data-label="Aggregatable" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e347 ">N</td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e350 ">Returns the day of the year of the date or timestamp.</td>

            <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e353 ">
              <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code class="language-sql">SELECT dayofyear('2009-07-30'); -- 211</code></pre>
            </td>

          </tr>
          <tr class="">
            <td data-label="Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e344 "><code>TO_DATE</code></td>

            <td data-label="Aggregatable" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e347 ">N</td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e350 ">Parses the date string with the format expression to a date. Returns null if
              the input isn't valid.</td>

            <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e353 ">
              <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code class="language-sql">SELECT to_date('2016-12-31', 'yyyy-MM-dd'); -- 2016-12-31</code></pre>
            </td>

          </tr>
          <tr class="">
            <td data-label="Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e344 "><code>TO_TIMESTAMP</code></td>

            <td data-label="Aggregatable" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e347 ">N</td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e350 ">Parses the timestamp string with the format expression to a timestamp. Returns
              null if the input isn't valid.</td>

            <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e353 ">
              <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code class="language-sql">SELECT to_timestamp('2016-12-31 00:12:00');
-- 2016-12-31 00:12:00</code></pre>
            </td>

          </tr>
          <tr class="">
            <td data-label="Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e344 "><code>DATE_TRUNC</code></td>

            <td data-label="Aggregatable" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e347 ">N</td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e350 ">Returns the timestamp truncated to the unit specified by the format
              model.</td>

            <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e353 ">
              <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code class="language-sql">SELECT date_trunc('YEAR', '2015-03-05T09:32:05.359');
-- 2015-01-01 00:00:00</code></pre>
            </td>

          </tr>
          <tr class="">
            <td data-label="Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e344 "><code>HOUR_ADD</code></td>

            <td data-label="Aggregatable" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e347 ">N</td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e350 ">Adds a number of hours to the datetime value and returns the later
              datetime.</td>

            <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e353 ">
              <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code class="language-sql">SELECT COUNT(SalesOrder__dlm.orderid__c) as orderid__c,
HOUR_ADD(SalesOrder__dlm.checkout_date__c, 2) as newDateHour__c
FROM SalesOrder__dlm GROUP BY newDateHour__c</code></pre>
            </td>

          </tr>
          <tr class="">
            <td data-label="Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e344 "><code>HOUR_SUB</code></td>

            <td data-label="Aggregatable" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e347 ">N</td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e350 ">Subtracts a number of hours from the datetime value and returns the earlier
              datetime.</td>

            <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e353 ">
              <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code class="language-sql">SELECT COUNT(SalesOrder__dlm.orderid__c) as orderid__c,
HOUR_SUB(SalesOrder__dlm.checkout_date__c, 2) as newDateHour__c
FROM SalesOrder__dlm GROUP BY newDateHour__c</code></pre>
            </td>

          </tr>
          <tr class="">
            <td data-label="Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e344 "><code>NOW</code></td>

            <td data-label="Aggregatable" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e347 ">N</td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e350 ">Returns the current date and time aligned to when the insight is processed. All
              NOW calls within the same query return the same value. Time is calculated at
              millisecond precision in UTC for your instance's region.</td>

            <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e353 ">
              <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code class="language-sql">SELECT NOW(); -- 2020-04-25T13:00:00.000Z</code></pre>
            </td>

          </tr>
          <tr class="">
            <td data-label="Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e344 "><code>SECOND_ADD</code></td>

            <td data-label="Aggregatable" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e347 ">N</td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e350 ">Adds a number of seconds to a datetime value and returns the later
              datetime.</td>

            <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e353 ">
              <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code class="language-sql">SELECT SECOND_ADD('2020-04-25T13:00:00.000Z', 305);
-- 2020-04-25T13:05:05.000Z</code></pre>
            </td>

          </tr>
          <tr class="">
            <td data-label="Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e344 "><code>SECOND_SUB</code></td>

            <td data-label="Aggregatable" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e347 ">N</td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e350 ">Subtracts a number of seconds from a datetime value and returns the earlier
              datetime. For example, use this function to include records from the last 5 minutes
              at the time of batch processing.</td>

            <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e353 ">
              <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code class="language-sql">SELECT SECOND_SUB('2020-04-25T13:00:00.000Z', 305);
-- 2020-04-25T12:54:55.000Z</code></pre>
            </td>

          </tr>
        </tbody>
      </table>

## Analytical Functions

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small ">
        <colgroup>
          <col style="width:20.40816326530612%">
          <col style="width:10.20408163265306%">
          <col style="width:28.57142857142857%">
          <col style="width:40.81632653061224%">
        </colgroup>
        <thead class="slds-text-title_caps ">
          <tr class="">
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d192628e833">Function</th>
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d192628e836">Aggregatable</th>
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d192628e839">Description</th>
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d192628e842">Example</th>
          </tr>
        </thead>
        <tbody>
          <tr class="">
            <td data-label="Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e833 "><code>LAG</code></td>

            <td data-label="Aggregatable" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e836 ">N</td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e839 ">Returns the input value at the offset row before the current row in the window.
              The default offset is 1. Returns null if the input value at the offset row is
              null.</td>

            <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e842 ">
              <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code class="language-sql">SELECT a, b, lag(b)
OVER (PARTITION BY a ORDER BY b)
FROM VALUES ('A1', 2), ('A1', 1), ('A2', 3), ('A1', 1) tab(a, b);
-- A1 1 NULL  A1 1 1  A1 2 1  A2 3 NULL</code></pre>
            </td>

          </tr>
          <tr class="">
            <td data-label="Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e833 "><code>LEAD</code></td>

            <td data-label="Aggregatable" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e836 ">N</td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e839 ">Returns the value at the offset row after the current row in the window. The
              default offset is 1. Returns null if there's no offset row.</td>

            <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e842 ">
              <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code class="language-sql">SELECT a, b, lead(b)
OVER (PARTITION BY a ORDER BY b)
FROM VALUES ('A1', 2), ('A1', 1), ('A2', 3), ('A1', 1) tab(a, b);
-- A1 1 1  A1 1 2  A1 2 NULL  A2 3 NULL</code></pre>
            </td>

          </tr>
          <tr class="">
            <td data-label="Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e833 "><code>NTILE</code></td>

            <td data-label="Aggregatable" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e836 ">N</td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e839 ">Divides the rows for each window partition into n buckets ranging from 1 to at
              most <em>n</em>.</td>

            <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e842 ">
              <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code class="language-sql">SELECT a, b, ntile(2)
OVER (PARTITION BY a ORDER BY b)
FROM VALUES ('A1', 2), ('A1', 1), ('A2', 3), ('A1', 1) tab(a, b);
-- A1 1 1  A1 1 1  A1 2 2  A2 3 1</code></pre>
            </td>

          </tr>
          <tr class="">
            <td data-label="Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e833 "><code>RANK</code></td>

            <td data-label="Aggregatable" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e836 ">N</td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e839 ">Computes the rank of a value in a group of values. The result is 1 plus the
              number of rows preceding the current row in the ordering of the partition. Produces
              gaps in the sequence.</td>

            <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e842 ">
              <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code class="language-sql">SELECT a, b, rank(b)
OVER (PARTITION BY a ORDER BY b)
FROM VALUES ('A1', 2), ('A1', 1), ('A2', 3), ('A1', 1) tab(a, b);
-- A1 1 1  A1 1 1  A1 2 3  A2 3 1</code></pre>
            </td>

          </tr>
          <tr class="">
            <td data-label="Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e833 "><code>PERCENT_RANK</code></td>

            <td data-label="Aggregatable" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e836 ">N</td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e839 ">Computes the percentage ranking of a value in a group of values.</td>

            <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e842 ">
              <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code class="language-sql">SELECT a, b, percent_rank(b)
OVER (PARTITION BY a ORDER BY b)
FROM VALUES ('A1', 2), ('A1', 1), ('A2', 3), ('A1', 1) tab(a, b);
-- A1 1 0.0  A1 1 0.0  A1 2 1.0  A2 3 0.0</code></pre>
            </td>

          </tr>
          <tr class="">
            <td data-label="Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e833 "><code>DENSE_RANK</code></td>

            <td data-label="Aggregatable" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e836 ">N</td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e839 ">Computes the rank of a value in a group of values. Unlike RANK, doesn't produce
              gaps in the ranking sequence.</td>

            <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e842 ">
              <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code class="language-sql">SELECT a, b, dense_rank(b)
OVER (PARTITION BY a ORDER BY b)
FROM VALUES ('A1', 2), ('A1', 1), ('A2', 3), ('A1', 1) tab(a, b);
-- A1 1 1  A1 1 1  A1 2 2  A2 3 1</code></pre>
            </td>

          </tr>
          <tr class="">
            <td data-label="Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e833 "><code>ROW_NUMBER</code></td>

            <td data-label="Aggregatable" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e836 ">N</td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e839 ">Assigns a unique, sequential number to each row starting with 1, based on the
              ordering of rows within the window partition.</td>

            <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e842 ">
              <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code class="language-sql">SELECT a, b, row_number()
OVER (PARTITION BY a ORDER BY b)
FROM VALUES ('A1', 2), ('A1', 1), ('A2', 3), ('A1', 1) tab(a, b);
-- A1 1 1  A1 1 2  A1 2 3  A2 3 1</code></pre>
            </td>

          </tr>
          <tr class="">
            <td data-label="Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e833 "><code>FIRST_VALUE</code></td>

            <td data-label="Aggregatable" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e836 ">N</td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e839 ">Returns the first value of the expression for each row in the window.</td>

            <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e842 ">
              <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code class="language-sql">SELECT first_value(col)
FROM VALUES (10), (5), (20) AS tab(col); -- 10</code></pre>
            </td>

          </tr>
          <tr class="">
            <td data-label="Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e833 "><code>LAST_VALUE</code></td>

            <td data-label="Aggregatable" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e836 ">N</td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e839 ">Returns the last value of the expression for each row in the window.</td>

            <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e842 ">
              <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code class="language-sql">SELECT last_value(col)
FROM VALUES (10), (5), (20) AS tab(col); -- 20</code></pre>
            </td>

          </tr>
          <tr class="">
            <td data-label="Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e833 "><code>REGEXP</code></td>

            <td data-label="Aggregatable" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e836 ">N</td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e839 ">Searches strings for patterns in text.</td>

            <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e842 ">
              <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code class="language-sql">SELECT * FROM Customers
WHERE name REGEXP '^[A-Z][a-z]+'</code></pre>
            </td>

          </tr>
          <tr class="">
            <td data-label="Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e833 "><code>REGEXP_EXTRACT</code></td>

            <td data-label="Aggregatable" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e836 ">N</td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e839 ">Creates dimension values by extracting them from a source dimension using
              Google RE2 regular expressions.</td>

            <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e842 ">
              <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code class="language-sql">SELECT regexp_extract('100-200', '(\\d+)-(\\d+)', 1); -- 100</code></pre>
            </td>

          </tr>
          <tr class="">
            <td data-label="Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e833 "><code>REGEXP_REPLACE</code></td>

            <td data-label="Aggregatable" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e836 ">N</td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e839 ">Extends REPLACE by letting you search a string for a regular expression
              pattern.</td>

            <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e842 ">
              <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code class="language-sql">SELECT regexp_replace('100-200', '(\\d+)', 'num'); -- num-num</code></pre>
            </td>

          </tr>
          <tr class="">
            <td data-label="Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e833 "><code>ISNULL</code></td>

            <td data-label="Aggregatable" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e836 ">N</td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e839 ">Returns true if the expression is null; otherwise, returns false.</td>

            <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e842 ">
              <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code class="language-sql">SELECT isnull(1); -- false</code></pre>
            </td>

          </tr>
          <tr class="">
            <td data-label="Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e833 "><code>ISNOTNULL</code></td>

            <td data-label="Aggregatable" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e836 ">N</td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e839 ">Returns true if the expression isn't null; otherwise, returns false.</td>

            <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e842 ">
              <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code class="language-sql">SELECT isnotnull(1); -- true</code></pre>
            </td>

          </tr>
          <tr class="">
            <td data-label="Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e833 "><code>IFNULL</code></td>

            <td data-label="Aggregatable" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e836 ">N</td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e839 ">Returns the second argument if the first argument is null; otherwise, returns
              the first argument.</td>

            <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e842 ">
              <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code class="language-sql">SELECT ifnull(null, 'default'); -- default</code></pre>
            </td>

          </tr>
          <tr class="">
            <td data-label="Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e833 "><code>NULLIF</code></td>

            <td data-label="Aggregatable" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e836 ">N</td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e839 ">Returns null if the two expressions are equal; otherwise, returns the first
              expression.</td>

            <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e842 ">
              <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code class="language-sql">SELECT nullif(2, 2); -- NULL</code></pre>
            </td>

          </tr>
          <tr class="">
            <td data-label="Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e833 "><code>CONTAINS</code></td>

            <td data-label="Aggregatable" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e836 ">N</td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e839 ">Searches for a word or phrase in one or more text columns using precise or
              fuzzy matching.</td>

            <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e842 ">
              <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code class="language-sql">SELECT * FROM COMPANY
WHERE CONTAINS(products, "product1")</code></pre>
            </td>

          </tr>
          <tr class="">
            <td data-label="Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e833 "><code>LIKE</code></td>

            <td data-label="Aggregatable" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e836 ">N</td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e839 ">Searches for a specific pattern in a string value.</td>

            <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e842 ">
              <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code class="language-sql">SELECT * FROM Customers
WHERE last_name LIKE 'R%';</code></pre>
            </td>

          </tr>
          <tr class="">
            <td data-label="Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e833 "><code>RLIKE</code></td>

            <td data-label="Aggregatable" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e836 ">N</td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e839 ">Searches a string for a regular expression pattern.</td>

            <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e842 ">
              <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code class="language-sql">SELECT id, text_field, text_field RLIKE '..number'
FROM SalesOrder__dlm ORDER BY id;</code></pre>
            </td>

          </tr>
          <tr class="">
            <td data-label="Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e833 "><code>NOTLIKE</code></td>

            <td data-label="Aggregatable" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e836 ">N</td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e839 ">Ignores values that match the specified pattern in the column.</td>

            <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e842 ">
              <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code class="language-sql">SELECT * FROM Customers
WHERE last_name NOTLIKE 'R%'</code></pre>
            </td>

          </tr>
          <tr class="">
            <td data-label="Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e833 "><code>NOTRLIKE</code></td>

            <td data-label="Aggregatable" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e836 ">N</td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e839 ">Ignores values that match a regular expression pattern in the column.</td>

            <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e842 ">
              <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code class="language-sql">SELECT * FROM SalesOrder__dlm
WHERE description__c NOTRLIKE '[0-9]+'</code></pre>
            </td>

          </tr>
          <tr class="">
            <td data-label="Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e833 "><code>CASE</code></td>

            <td data-label="Aggregatable" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e836 ">N</td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e839 ">Evaluates conditions and returns a value when the first condition is met. If no
              conditions are true, the ELSE value is returned (or null if there's no ELSE
              clause).</td>

            <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e842 ">
              <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code class="language-sql">SELECT
  CASE
    WHEN SUM(ssot__Order__dlm.ssot__TotalAmount__c) &gt; 500
    THEN 'high spender'
    ELSE 'low spender'
  END AS spend_label__c,
  Individual__dlm.ssot__Id__c AS customer_id__c
FROM ssot__Order__dlm
  JOIN IdLink__dlm ON ssot__Order__dlm.ssot__SoldId__c = IdLink__dlm.RecId__c
  JOIN UnifiedIndividual__dlm ON IdLink__dlm.UnifiedRecId__c = Individual__dlm.ssot__Id__c
GROUP BY customer_id__c</code></pre>
            </td>

          </tr>
        </tbody>
      </table>

## Formatting Functions

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small ">
        <colgroup>
          <col style="width:20.40816326530612%">
          <col style="width:10.20408163265306%">
          <col style="width:28.57142857142857%">
          <col style="width:40.81632653061224%">
        </colgroup>
        <thead class="slds-text-title_caps ">
          <tr class="">
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d192628e1255">Function</th>
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d192628e1258">Aggregatable</th>
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d192628e1261">Description</th>
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d192628e1264">Example</th>
          </tr>
        </thead>
        <tbody>
          <tr class="">
            <td data-label="Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e1255 "><code>SUBSTRING</code></td>

            <td data-label="Aggregatable" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e1258 ">N</td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e1261 ">Extracts a substring from a string. Accepts a start index and a length.</td>

            <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e1264 ">
              <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code class="language-sql">SELECT COUNT(SUBSTRING(ssot__Acct__dlm.ssot__AcctTypeId__c, 1, 9))
AS count_of_acct_type__c,
ssot__Acct__dlm.ssot__Id__c AS account_id__c
FROM ssot__Acct__dlm
GROUP BY account_id__c</code></pre>
            </td>

          </tr>
          <tr class="">
            <td data-label="Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e1255 "><code>SUBSTR</code></td>

            <td data-label="Aggregatable" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e1258 ">N</td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e1261 ">Extracts a substring from a string. Accepts a start position and a character
              count.</td>

            <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e1264 ">
              <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code class="language-sql">substr(Account_Id, 13, 3)</code></pre>
            </td>

          </tr>
          <tr class="">
            <td data-label="Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e1255 "><code>RTRIM</code></td>

            <td data-label="Aggregatable" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e1258 ">N</td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e1261 ">Removes trailing space characters from a string.</td>

            <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e1264 ">
              <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code class="language-sql">rtrim('2 Spaces After  ')</code></pre>
            </td>

          </tr>
          <tr class="">
            <td data-label="Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e1255 "><code>UPPER</code></td>

            <td data-label="Aggregatable" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e1258 ">N</td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e1261 ">Converts lowercase characters to uppercase.</td>

            <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e1264 ">
              <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code class="language-sql">upper("Account.Industry")</code></pre>
            </td>

          </tr>
          <tr class="">
            <td data-label="Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e1255 "><code>LOWER</code></td>

            <td data-label="Aggregatable" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e1258 ">N</td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e1261 ">Converts uppercase characters to lowercase.</td>

            <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e1264 ">
              <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code class="language-sql">lower("Account.Industry")</code></pre>
            </td>

          </tr>
          <tr class="">
            <td data-label="Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e1255 "><code>CONCAT</code></td>

            <td data-label="Aggregatable" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e1258 ">N</td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e1261 ">Returns a string by merging the values of specified fields and input
              strings.</td>

            <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e1264 ">
              <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code class="language-sql">concat("OwnerId.FirstName", ' ', "OwnerId.LastName")</code></pre>
            </td>

          </tr>
        </tbody>
      </table>

## Math and Statistical Functions

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small ">
        <colgroup>
          <col style="width:20.40816326530612%">
          <col style="width:10.20408163265306%">
          <col style="width:28.57142857142857%">
          <col style="width:40.81632653061224%">
        </colgroup>
        <thead class="slds-text-title_caps ">
          <tr class="">
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d192628e1400">Function</th>
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d192628e1403">Aggregatable</th>
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d192628e1406">Description</th>
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d192628e1409">Example</th>
          </tr>
        </thead>
        <tbody>
          <tr class="">
            <td data-label="Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e1400 "><code>MOD</code></td>

            <td data-label="Aggregatable" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e1403 ">N</td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e1406 ">Returns the remainder after expr1 / expr2.</td>

            <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e1409 ">
              <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code class="language-sql">SELECT MOD(3, 1.8);</code></pre>
            </td>

          </tr>
          <tr class="">
            <td data-label="Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e1400 "><code>ABS</code></td>

            <td data-label="Aggregatable" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e1403 ">N</td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e1406 ">Calculates the absolute value of a number (the value without its sign).</td>

            <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e1409 ">
              <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code class="language-sql">abs(number)</code></pre>
            </td>

          </tr>
          <tr class="">
            <td data-label="Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e1400 "><code>RAND</code></td>

            <td data-label="Aggregatable" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e1403 ">N</td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e1406 ">Returns a random decimal number in [0, 1). Non-deterministic in the general
              case. Specify a seed to return a repeatable sequence.</td>

            <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e1409 ">
              <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code class="language-sql">SELECT rand();   -- random
SELECT rand(0);  -- repeatable sequence</code></pre>
            </td>

          </tr>
          <tr class="">
            <td data-label="Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e1400 "><code>ROUND</code></td>

            <td data-label="Aggregatable" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e1403 ">N</td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e1406 ">Rounds a number to the specified number of decimal places.</td>

            <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e1409 ">
              <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code class="language-sql">SELECT round(2.5, 0)</code></pre>
            </td>

          </tr>
          <tr class="">
            <td data-label="Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e1400 "><code>GREATEST</code></td>

            <td data-label="Aggregatable" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e1403 ">N</td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e1406 ">Returns the greatest value in the argument list, skipping null values.</td>

            <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e1409 ">
              <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code class="language-sql">SELECT greatest(10, 9, 2, 4, 3);</code></pre>
            </td>

          </tr>
          <tr class="">
            <td data-label="Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e1400 "><code>LEAST</code></td>

            <td data-label="Aggregatable" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e1403 ">N</td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e1406 ">Returns the smallest value in the argument list, skipping null values.</td>

            <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e1409 ">
              <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code class="language-sql">SELECT least(10, 9, 2, 4, 3);</code></pre>
            </td>

          </tr>
          <tr class="">
            <td data-label="Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e1400 "><code>LOG</code></td>

            <td data-label="Aggregatable" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e1403 ">N</td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e1406 ">Returns the logarithm of a number in a specified base. Arguments:
              <code>base</code> (the base of the logarithm) and <code>number</code> (the
              value to take the logarithm of).
            </td>

            <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e1409 ">
              <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code class="language-sql">log(base, number)</code></pre>
            </td>

          </tr>
          <tr class="">
            <td data-label="Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e1400 "><code>EXP</code></td>

            <td data-label="Aggregatable" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e1403 ">N</td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e1406 ">Returns e raised to the power of the specified number.</td>

            <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e1409 ">
              <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code class="language-sql">SELECT EXP(2);</code></pre>
            </td>

          </tr>
          <tr class="">
            <td data-label="Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e1400 "><code>BETWEEN</code></td>

            <td data-label="Aggregatable" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e1403 ">N</td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e1406 ">Selects values within a given range (inclusive). Values can be numbers, text,
              or dates.</td>

            <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e1409 ">
              <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code class="language-sql">SELECT * FROM table
WHERE price BETWEEN 50 AND 100;</code></pre>
            </td>

          </tr>
        </tbody>
      </table>

## Boolean Functions

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small ">
        <colgroup>
          <col style="width:20.40816326530612%">
          <col style="width:10.20408163265306%">
          <col style="width:28.57142857142857%">
          <col style="width:40.81632653061224%">
        </colgroup>
        <thead class="slds-text-title_caps ">
          <tr class="">
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d192628e1602">Function</th>
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d192628e1605">Aggregatable</th>
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d192628e1608">Description</th>
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d192628e1611">Example</th>
          </tr>
        </thead>
        <tbody>
          <tr class="">
            <td data-label="Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e1602 "><code>IS_TRUE</code></td>

            <td data-label="Aggregatable" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e1605 ">N</td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e1608 ">Returns true if the value is true.</td>

            <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e1611 ">
              <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code class="language-sql">SELECT count(Id) FROM Table
WHERE Is_True(Boolean_Column);</code></pre>
            </td>

          </tr>
          <tr class="">
            <td data-label="Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e1602 "><code>IS_FALSE</code></td>

            <td data-label="Aggregatable" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e1605 ">N</td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e1608 ">Returns true if the value is false.</td>

            <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e1611 ">
              <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code class="language-sql">SELECT count(Id) FROM Table
WHERE Is_False(Boolean_Column);</code></pre>
            </td>

          </tr>
          <tr class="">
            <td data-label="Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e1602 "><code>HAS_BOOLEAN_VALUE</code></td>

            <td data-label="Aggregatable" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e1605 ">N</td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e1608 ">Returns true if the field contains a value; returns false if it's null or
              blank.</td>

            <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e1611 ">
              <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code class="language-sql">SELECT count(Id) FROM Table
WHERE Has_Boolean_Value(Boolean_Column);</code></pre>
            </td>

          </tr>
          <tr class="">
            <td data-label="Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e1602 "><code>HAS_NO_BOOLEAN_VALUE</code></td>

            <td data-label="Aggregatable" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e1605 ">N</td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e1608 ">Returns true if the field's value is null or blank; returns false if it
              contains a value.</td>

            <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d192628e1611 ">
              <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code class="language-sql">SELECT count(Id) FROM Table
WHERE Has_No_Boolean_Value(Boolean_Column);</code></pre>
            </td>

          </tr>
        </tbody>
      </table>