---
schema_version: "1"
id: 48c6435b137becca273a62119c92631dcd311be33a289cca5dbb40d56f2e56ce
title: All Functions (Alphabetical)
collection: tableau
version: next
locale: en-us
portal_url: https://docs.salesforce.com/tableau/next/en-us/pro/desktop/functions_all_alphabetical.md
canonical_url: https://help.tableau.com/v0.0/pro/desktop/en-us/functions_all_alphabetical.htm
source_site: help.tableau.com
content_type: documentation
content_hash: b0cb951293e997cfa2e9068369568204684f67258ab764a14023e50a497d8d5e
description: Reference of all Tableau calculation functions organized in alphabetical order.
---
[Skip to main content](#main-content)

# Tableau Functions (Alphabetical)

The Tableau functions in this reference are organized alphabetically. Click a letter to jump to that location in the list. You can also use Ctrl+F (Command-F on a Mac) to open a search box to look for a specific function.

[A](#A)  [B](#B)  [C](#C)  [D](#D)  [E](#E)  [F](#F)  [G](#G)  [H](#H)  [I](#I)  [J](#J)  [K](#K)  [L](#L)  [M](#M)  [N](#N)  [O](#O)  [P](#P)  [Q](#Q)  [R](#R)  [S](#S)  [T](#T)  [U](#U)  [V](#V)  [W](#W)  [X](#X)  [Y](#Y)  [Z](#Z)

  

## A

### ABS

<table class="table--plain" style="width: 100%;">
                    <colgroup><col style="width: 20%;">
                    <col>
                    </colgroup><tbody>
                        <tr>
                            <td>Syntax</td>
                            <td><code>ABS(number)</code>
                            </td>
                        </tr>
                        <tr>
                            <td>Output</td>
                            <td>Number (positive)</td>
                        </tr>
                        <tr>
                            <td>Definition</td>
                            <td>Returns the absolute value of the given <code>&lt;number&gt;</code>.</td>
                        </tr>
                        <tr>
                            <td>Example</td>
                            <td><pre>ABS(-7) = 7<br>ABS([Budget Variance])</pre>
                                <p>The second example returns the absolute value for all the numbers contained in the Budget Variance field.</p>
                            </td>
                        </tr>
                        <tr>
                            <td>Notes</td>
                            <td>See also <code><a href="#SIGN" class="xref">SIGN</a></code>.</td>
                        </tr>
                    </tbody>
                </table>

### ACOS

<table class="table--plain" style="width: 100%;">
                    <colgroup><col style="width: 20%;">
                    <col>
                    </colgroup><tbody>
                        <tr>
                            <td>Syntax</td>
                            <td><code>ACOS(number)</code>
                            </td>
                        </tr>
                        <tr>
                            <td>Output</td>
                            <td>Number (angle in radians)</td>
                        </tr>
                        <tr>
                            <td>Definition</td>
                            <td>Returns the arccosine (angle) of the given <code>&lt;number&gt;</code>. </td>
                        </tr>
                        <tr>
                            <td>Example</td>
                            <td><pre>ACOS(-1) = 3.14159265358979</pre>
                            </td>
                        </tr>
                        <tr>
                            <td>Notes</td>
                            <td>The inverse function, <code><a href="#COS" class="xref">COS</a></code>, takes the angle in radians as the argument and returns the cosine. </td>
                        </tr>
                    </tbody>
                </table>

### AND

<table class="table--plain" style="width: 100%;">
                    <colgroup><col style="width: 20%;">
                    <col>
                    </colgroup><tbody>
                        <tr>
                            <td>Syntax</td>
                            <td><code>&lt;expr1&gt; AND &lt;expr2&gt;</code>
                            </td>
                        </tr>
                        <tr>
                            <td>Definition</td>
                            <td>Performs a logical conjunction on two expressions. (If both sides are true, the logical test returns true.)</td>
                        </tr>
                        <tr>
                            <td>Output</td>
                            <td>Boolean </td>
                        </tr>
                        <tr>
                            <td>Example</td>
                            <td><pre>IF [Season] = "Spring" AND "[Season] = "Fall" <br>THEN "It's the apocalypse and footwear doesn't matter" <br>END</pre>
                                <p><i>"If both (Season = Spring) and (Season = Fall) are true simultaneously, then return It's the apocalypse and footwear doesn't matter."</i>
                                </p>
                            </td>
                        </tr>
                        <tr>
                            <td>Notes</td>
                            <td>
                                <p>Often used with <a href="#IF" class="xref">IF</a> and <a href="#IIF" class="xref">IIF</a>. See also <a href="#NOT" class="xref">NOT</a> and <a href="#OR" class="xref">OR</a>. </p>
                                <p>If both expressions are <code>TRUE</code> (that is, not <code>FALSE</code> or <code>NULL</code>), then the result is <code>TRUE</code>. If either expression is <code>NULL</code>, then the result is <code>NULL</code>. In all other cases, the result is <code>FALSE</code>.</p>
                                <p>If you create a calculation in which the result of an <code>AND</code> comparison is displayed on a worksheet, Tableau displays <code>TRUE</code> and <code>FALSE</code>. If you would like to change this, use the Format area in the format dialog.</p>
                                <p class="note"><b>Note</b>: The <code>AND</code> operator employs <i>short circuit evaluation</i>. This means that if the first expression is evaluated to be <code>FALSE</code>, then the second expression is not evaluated at all. This can be helpful if the second expression results in an error when the first expression is <code>FALSE</code>, because the second expression in this case is never evaluated.</p>
                            </td>
                        </tr>
                    </tbody>
                </table>

### AREA

<table class="table--plain" style="width: 100%;">
                    <colgroup><col style="width: 20%;">
                    <col>
                    </colgroup><tbody>
                        <tr>
                            <td>Syntax</td>
                            <td><code>AREA(Spatial Polygon, 'units')</code>
                            </td>
                        </tr>
                        <tr>
                            <td>Output</td>
                            <td>Number</td>
                        </tr>
                        <tr>
                            <td>Definition</td>
                            <td>Returns the total surface area of a <code>&lt;spatial polygon&gt;</code>.</td>
                        </tr>
                        <tr>
                            <td>Example</td>
                            <td><pre xml:space="preserve">AREA([Geometry], 'feet')</pre>
                            </td>
                        </tr>
                        <tr>
                            <td>Notes</td>
                            <td>
                                <p>Supported unit names (must be in quotation marks in the calculation, such as <code>'miles'</code>):
						</p><ul><li><i>meters</i>: meters, metres, m</li><li><i>kilometers</i>: kilometers, kilometres, km</li><li><i>miles</i>: miles, mi</li><li><i>feet</i>: feet, ft</li></ul><p></p>
                            </td>
                        </tr>
                    </tbody>
                </table>

### ASCII

<table class="table--plain" style="width: 100%;">
                    <colgroup><col style="width: 20%;">
                    <col>
                    </colgroup><tbody>
                        <tr>
                            <td>Syntax</td>
                            <td><code>ASCII(string)</code>
                            </td>
                        </tr>
                        <tr>
                            <td>Output</td>
                            <td>Number</td>
                        </tr>
                        <tr>
                            <td>Definition</td>
                            <td>Returns the ASCII code for the first character of a <code>&lt;string&gt;</code>. </td>
                        </tr>
                        <tr>
                            <td>Example</td>
                            <td><pre>ASCII('A') = 65</pre>
                            </td>
                        </tr>
                        <tr>
                            <td>Notes</td>
                            <td>This is the inverse of the <code>CHAR</code> function. </td>
                        </tr>
                    </tbody>
                </table>

### ASIN

<table class="table--plain" style="width: 100%;">
                    <colgroup><col style="width: 20%;">
                    <col>
                    </colgroup><tbody>
                        <tr>
                            <td>Syntax</td>
                            <td><code>ASIN(number)</code>
                            </td>
                        </tr>
                        <tr>
                            <td>Output</td>
                            <td>Number (angle in radians)</td>
                        </tr>
                        <tr>
                            <td>Definition</td>
                            <td>Returns the arcsine (angle) of a given <code>&lt;number&gt;</code>. </td>
                        </tr>
                        <tr>
                            <td>Example</td>
                            <td><pre>ASIN(1) = 1.5707963267949</pre>
                            </td>
                        </tr>
                        <tr>
                            <td>Notes</td>
                            <td>The inverse function, <code><a href="#SIN" class="xref">SIN</a></code>, takes the angle in radians as the argument and returns the sine. </td>
                        </tr>
                    </tbody>
                </table>

### ATAN

<table class="table--plain" style="width: 100%;">
                    <colgroup><col style="width: 20%;">
                    <col>
                    </colgroup><tbody>
                        <tr>
                            <td>Syntax</td>
                            <td><code>ATAN(number)</code>
                            </td>
                        </tr>
                        <tr>
                            <td>Output</td>
                            <td>Number (angle in radians)</td>
                        </tr>
                        <tr>
                            <td>Definition</td>
                            <td>Returns the arctangent (angle) of a given <code>&lt;number&gt;</code>. </td>
                        </tr>
                        <tr>
                            <td>Example</td>
                            <td><pre>ATAN(180) = 1.5652408283942</pre>
                            </td>
                        </tr>
                        <tr>
                            <td>Notes</td>
                            <td>
                                <p>The inverse function, <code>TAN</code>, takes the angle in radians as the argument and returns the tangent. </p>
                                <p>See also <code><a href="#ATAN2" class="xref">ATAN2</a></code> and <code><a href="#COT" class="xref">COT</a></code>.</p>
                            </td>
                        </tr>
                    </tbody>
                </table>

### ATAN2

<table class="table--plain" style="width: 100%;">
                    <colgroup><col style="width: 20%;">
                    <col>
                    </colgroup><tbody>
                        <tr>
                            <td>Syntax</td>
                            <td><code>ATAN2(y number, x number)</code>
                            </td>
                        </tr>
                        <tr>
                            <td>Output</td>
                            <td>Number (angle in radians)</td>
                        </tr>
                        <tr>
                            <td>Definition</td>
                            <td>Returns the arctangent (angle) between two numbers (<code>&lt;y number&gt;</code> and <code>&lt;x number&gt;</code>). The result is in radians. </td>
                        </tr>
                        <tr>
                            <td>Example</td>
                            <td><pre>ATAN2(2, 1) = 1.10714871779409</pre>
                            </td>
                        </tr>
                        <tr>
                            <td>Notes</td>
                            <td>See also <code><a href="#ATAN" class="xref">ATAN</a></code>, <code><a href="#TAN" class="xref">TAN</a></code>, and <code><a href="#COT" class="xref">COT</a></code>.</td>
                        </tr>
                    </tbody>
                </table>

### ATTR

<table class="table--plain" style="width: 100%;"><colgroup><col style="width: 20%;"> <col></colgroup><tbody><tr><td>Syntax</td><td><code>ATTR(expression)</code></td></tr><tr><td>Definition</td><td>Returns the value of the <code>&lt;expression&gt;</code> if it has a single value for all rows. Otherwise returns an asterisk. Null values are ignored.</td></tr></tbody></table>

### AVG

<table class="table--plain" style="width: 100%;"><colgroup><col style="width: 20%;"> <col></colgroup><tbody><tr><td>Syntax</td><td><code>AVG(expression)</code></td></tr><tr><td>Definition</td><td>Returns the average of all the values in the <code>&lt;expression&gt;</code>. Null values are ignored.</td></tr><tr><td>Notes</td><td><code>AVG</code> can only be used with numeric fields.</td></tr></tbody></table>

[back to top](#top)

## B

### BUFFER

<table class="table--plain" style="width: 100%;">
                    <colgroup><col style="width: 20%;">
                    <col>
                    </colgroup><tbody>
                        <tr>
                            <td>Syntax</td>
                            <td><code>BUFFER(Spatial Point, distance, 'units')</code>
                            </td>
                        </tr>
                        <tr>
                            <td>Output</td>
                            <td>Geometry</td>
                        </tr>
                        <tr>
                            <td>Definition</td>
                            <td>Returns a polygon shape centered over a <code>&lt;spatial point&gt;</code>, with a radius determined by the <code>&lt;distance&gt;</code> and <code>&lt;unit&gt;</code> values.</td>
                        </tr>
                        <tr>
                            <td>Example</td>
                            <td><pre>BUFFER([Spatial Point Geometry], 25, 'mi')</pre><pre>BUFFER(MAKEPOINT(47.59, -122.32), 3, 'km')</pre>
                            </td>
                        </tr>
                        <tr>
                            <td>Notes</td>
                            <td>
                                <p>Supported unit names (must be in quotation marks in the calculation, such as <code>'miles'</code>):
						</p>
                                <ul>
                                    <li><i>meters</i>: meters, metres, m</li>
                                    <li><i>kilometers</i>: kilometers, kilometres, km</li>
                                    <li><i>miles</i>: miles, mi                           </li>
                                    <li><i>feet</i>: feet, ft</li>
                                </ul>
                            </td>
                        </tr>
                    </tbody>
                </table>

[back to top](#top)

## C

### CASE

<table class="table--plain" style="width: 100%;">
                    <colgroup><col style="width: 20%;">
                    <col>
                    </colgroup><tbody>
                        <tr>
                            <td>Syntax</td>
                            <td><code><b>CASE</b> &lt;expression&gt; 
							<br>WHEN &lt;value1&gt; THEN &lt;then1&gt; 
							<br>WHEN &lt;value2&gt; THEN &lt;then2&gt; 
							<br>...
						<br>[ELSE &lt;default&gt;]<br>END</code>
                            </td>
                        </tr>
                        <tr>
                            <td>Output</td>
                            <td>Depends on data type of the <code>&lt;then&gt;</code>&nbsp;values. </td>
                        </tr>
                        <tr>
                            <td>Definition</td>
                            <td>
                                <p>Evaluates the <code>expression</code> and compares it to the specified options (<code>&lt;value1&gt;</code>, <code>&lt;value2&gt;</code>, etc.). When a <code>value</code> that matches expression is encountered, CASE returns the corresponding <code>return</code>. If no match is found, the (optional) default is returned. If there is no default and no values match, then Null is returned.</p>
                            </td>
                        </tr>
                        <tr>
                            <td>Example</td>
                            <td><pre><code><b>CASE</b> [Season] <br>WHEN 'Summer' THEN 'Sandals' <br>WHEN 'Winter' THEN 'Boots' <br>ELSE 'Sneakers' <br>END</code></pre>
                                <p><i>"Look at the Season field. If the value is Summer, then return Sandals. If the value is Winter, then return Boots. If none of the options in the calculation match what is in the Season field, return a Sneakers."</i>
                                </p>
                            </td>
                        </tr>
                        <tr>
                            <td>Notes</td>
                            <td>
                                <p>See also <a href="#IF" class="xref">IF</a> and <a href="#IIF" class="xref">IIF</a>. </p>
                                <p>Used with <a href="#WHEN" class="xref">WHEN</a>, <a href="#THEN" class="xref">THEN</a>, <a href="#ELSE" class="xref">ELSE</a>, and <a href="#END" class="xref">END</a>. </p>
                                <blockquote><p>[!TIP]</p><p>Many times you can use a group to get the same results as a complicated CASE function, or use CASE to replace native grouping functionality, such as in the previous example. You may want to test which is more performant for your scenario.</p></blockquote>
                            </td>
                        </tr>
                    </tbody>
                </table>

### CEILING

<table class="table--plain" style="width: 100%;">
                    <colgroup><col style="width: 20%;">
                    <col>
                    </colgroup><tbody>
                        <tr>
                            <td>Syntax</td>
                            <td><code>CEILING(number)</code>
                            </td>
                        </tr>
                        <tr>
                            <td>Output</td>
                            <td>Integer</td>
                        </tr>
                        <tr>
                            <td>Definition</td>
                            <td>Rounds a <code>&lt;number&gt;</code> to the nearest integer of equal or greater value.</td>
                        </tr>
                        <tr>
                            <td>Example</td>
                            <td><pre>CEILING(2.1) = 3</pre>
                            </td>
                        </tr>
                        <tr>
                            <td>Notes</td>
                            <td>See also <code><a href="#FLOOR" class="xref">FLOOR</a></code> and <code><a href="#ROUND" class="xref">ROUND</a></code>. </td>
                        </tr>
                        <tr>
                            <td>Database limitations</td>
                            <td>
                                <p><code>CEILING</code> is available through the following connectors: Microsoft Excel, Text File, Statistical File, Published Data Source, Amazon EMR Hadoop Hive, Amazon Redshift, Cloudera Hadoop, DataStax Enterprise, Google Analytics, Google BigQuery, Hortonworks Hadoop Hive, MapR&nbsp;Hadoop Hive, Microsoft SQL&nbsp;Server, Salesforce, Spark&nbsp;SQL.</p>
                            </td>
                        </tr>
                    </tbody>
                </table>

### CHAR

<table class="table--plain" style="width: 100%;">
                    <colgroup><col style="width: 20%;">
                    <col>
                    </colgroup><tbody>
                        <tr>
                            <td>Syntax</td>
                            <td><code>CHAR(number)</code>
                            </td>
                        </tr>
                        <tr>
                            <td>Output</td>
                            <td>String</td>
                        </tr>
                        <tr>
                            <td>Definition</td>
                            <td>Returns the character encoded by the ASCII code <code>&lt;number&gt;</code>.</td>
                        </tr>
                        <tr>
                            <td>Example</td>
                            <td><pre>CHAR(65) = 'A'</pre>
                            </td>
                        </tr>
                        <tr>
                            <td>Notes</td>
                            <td>This is the inverse of the <code>ASCII</code> function. </td>
                        </tr>
                    </tbody>
                </table>

### COLLECT

<table class="table--plain" style="width: 100%;"><colgroup><col style="width: 20%;"> <col></colgroup><tbody><tr><td>Syntax</td><td><code>COLLECT(spatial)</code></td></tr><tr><td>Definition</td><td>An aggregate calculation that combines the values in the argument field. Null values are ignored.</td></tr><tr><td>Notes</td><td><code>COLLECT</code> can only be used with spatial fields.</td></tr></tbody></table>

### CONTAINS

<table class="table--plain" style="width: 100%;">
                    <colgroup><col style="width: 20%;">
                    <col>
                    </colgroup><tbody>
                        <tr>
                            <td>Syntax</td>
                            <td><code>CONTAINS(string, substring)</code>
                            </td>
                        </tr>
                        <tr>
                            <td>Output</td>
                            <td>Boolean</td>
                        </tr>
                        <tr>
                            <td>Definition</td>
                            <td>Returns true if the given <code>&lt;string&gt;</code> contains the specified <code>&lt;substring&gt;</code>.</td>
                        </tr>
                        <tr>
                            <td>Example</td>
                            <td><pre>CONTAINS("Calculation", "alcu") = true</pre>
                            </td>
                        </tr>
                        <tr>
                            <td>Notes</td>
                            <td>See also the <a href="https://help.tableau.com/current/pro/desktop/en-us/functions_functions_logical.htm" target="_blank">logical function</a> <code>IN</code> as well as supported RegEx in the <a href="https://help.tableau.com/current/pro/desktop/en-us/functions_functions_additional.htm" target="_blank">additional functions documentation</a>. </td>
                        </tr>
                    </tbody>
                </table>

### CORR

<table class="table--plain" style="width: 100%;">
                    <colgroup><col style="width: 20%;">
                    <col>
                    </colgroup><tbody>
                        <tr>
                            <td>Syntax</td>
                            <td><code>CORR(expression1, expression2)</code>
                            </td>
                        </tr>
                        <tr>
                            <td>Output</td>
                            <td>Number from -1 to 1</td>
                        </tr>
                        <tr>
                            <td>Definition</td>
                            <td>Returns the Pearson correlation coefficient of two expressions.</td>
                        </tr>
                        <tr>
                            <td>Example</td>
                            <td><pre>example</pre>
                            </td>
                        </tr>
                        <tr>
                            <td>Notes</td>
                            <td>
                                <p>The Pearson correlation measures the linear relationship between two variables. Results range from -1 to +1 inclusive, where 1 denotes an exact positive linear relationship, 0 denotes no linear relationship between the variance, and −1 is an exact negative relationship.</p>
                                <p>The square of a CORR result is equivalent to the R-Squared value for a linear trend line model. See <a href="https://help.tableau.com/current/pro/desktop/en-us/trendlines_add.htm#Terms" target="_blank">Trend Line Model Terms</a>.</p>
                                <p><b>Use with table scoped LOD&nbsp;expressions:</b>
                                </p>
                                <p>You can use CORR to visualize correlation in a disaggregated scatter using a <a href="https://help.tableau.com/current/pro/desktop/en-us/calculations_calculatedfields_lod.htm#Table" target="_blank">table-scoped level of detail expression</a>. For example:</p><pre>{CORR(Sales, Profit)}</pre>
                                <p>With a level of detail expression, the correlation is run over all rows. If you used a formula like <code>CORR(Sales, Profit)</code> (without the surrounding brackets to make it a level of detail expression), the view would show the correlation of each individual point in the scatter plot with each other point, which is undefined.</p>
                            </td>
                        </tr>
                        <tr>
                            <td>Database limitations</td>
                            <td>
                                <p><code>CORR</code> is available with the following data sources: Tableau data extracts, Cloudera Hive, EXASolution, Firebird (version 3.0 and later), Google BigQuery, Hortonworks Hadoop Hive, IBM PDA (Netezza), Oracle, PostgreSQL, Presto, SybaseIQ, Teradata, Vertica.</p>
                                <p>For other data sources, consider either extracting the data or using <code>WINDOW_CORR</code>. See <a href="https://help.tableau.com/current/pro/desktop/en-us/functions_functions_tablecalculation.htm" target="_blank">Table Calculation Functions</a>.</p>
                            </td>
                        </tr>
                    </tbody>
                </table>

### COS

<table class="table--plain" style="width: 100%;">
                    <colgroup><col style="width: 20%;">
                    <col>
                    </colgroup><tbody>
                        <tr>
                            <td>Syntax</td>
                            <td><code>COS(number)</code>
                                <p>The number argument is the angle in radians. </p>
                            </td>
                        </tr>
                        <tr>
                            <td>Output</td>
                            <td>Number</td>
                        </tr>
                        <tr>
                            <td>Definition</td>
                            <td>Returns the cosine of an angle. </td>
                        </tr>
                        <tr>
                            <td>Example</td>
                            <td><pre>COS(PI( ) /4) = 0.707106781186548</pre>
                            </td>
                        </tr>
                        <tr>
                            <td>Notes</td>
                            <td>
                                <p>The inverse function, <code><a href="#ACOS" class="xref">ACOS</a></code>, takes the cosine as the argument and returns the angle in radians. </p>
                                <p>See also <code><a href="#PI" class="xref">PI</a></code>.</p>
                            </td>
                        </tr>
                    </tbody>
                </table>

### COT

<table class="table--plain" style="width: 100%;">
                    <colgroup><col style="width: 20%;">
                    <col>
                    </colgroup><tbody>
                        <tr>
                            <td>Syntax</td>
                            <td><code>COT(number)</code>
                                <p>The number argument is the angle in radians. </p>
                            </td>
                        </tr>
                        <tr>
                            <td>Output</td>
                            <td>Number</td>
                        </tr>
                        <tr>
                            <td>Definition</td>
                            <td>Returns the cotangent of an angle.</td>
                        </tr>
                        <tr>
                            <td>Example</td>
                            <td><pre>COT(PI( ) /4) = 1</pre>
                            </td>
                        </tr>
                        <tr>
                            <td>Notes</td>
                            <td>See also <code><a href="#ATAN" class="xref">ATAN</a></code>, <code><a href="#TAN" class="xref">TAN</a></code>, and <code><a href="#PI" class="xref">PI</a></code>.</td>
                        </tr>
                    </tbody>
                </table>

### COUNT

<table class="table--plain" style="width: 100%;"><colgroup><col style="width: 20%;"> <col></colgroup><tbody><tr><td>Syntax</td><td><code>COUNT(expression)</code></td></tr><tr><td>Definition</td><td>Returns the number of items. Null values are not counted.</td></tr></tbody></table>

### COUNTD

<table class="table--plain" style="width: 100%;"><colgroup><col style="width: 20%;"> <col></colgroup><tbody><tr><td>Syntax</td><td><code>COUNTD(expression)</code></td></tr><tr><td>Definition</td><td>Returns the number of distinct items in a group. Null values are not counted.</td></tr></tbody></table>

### COVAR

<table class="table--plain" style="width: 100%;">
                    <colgroup><col style="width: 20%;">
                    <col>
                    </colgroup><tbody>
                        <tr>
                            <td>Syntax</td>
                            <td><code>COVAR(expression1, expression2)</code>
                            </td>
                        </tr>
                        <tr>
                            <td>Definition</td>
                            <td>Returns the <i>sample</i> covariance of two expressions.</td>
                        </tr>
                        <tr>
                            <td>Notes</td>
                            <td>
                                <p>Covariance quantifies how two variables change together. A positive covariance indicates that the variables tend to move in the same direction, as when larger values of one variable tend to correspond to larger values of the other variable, on average. <i>Sample covariance</i> uses the number of non-null data points n - 1 to normalize the covariance calculation, rather than n, which is used by the population covariance (available with the <code>COVARP</code> function). Sample covariance is the appropriate choice when the data is a random sample that is being used to estimate the covariance for a larger population.</p>
                                <p>If <code>&lt;expression1&gt;</code> and <code>&lt;expression2&gt;</code> are the same, for example <code>COVAR([profit], [profit])</code>, <code>COVAR</code> returns a value that indicates how widely values are distributed.</p>
                                <p>The value of <code>COVAR(X, X)</code> is equivalent to the value of <code>VAR(X)</code> and also to the value of <code>STDEV(X)^2</code>.</p>
                            </td>
                        </tr>
                        <tr>
                            <td>Database limitations</td>
                            <td>
                                <p><code>COVAR</code> is available with the following data sources: Tableau data extracts, Cloudera Hive, EXASolution, Firebird (version 3.0 and later), Google BigQuery, Hortonworks Hadoop Hive, IBM PDA (Netezza), Oracle, PostgreSQL, Presto, SybaseIQ, Teradata, Vertica.</p>
                                <p>For other data sources, consider either extracting the data or using <code>WINDOW_COVAR</code>. See <a href="https://help.tableau.com/current/pro/desktop/en-us/functions_functions_tablecalculation.htm" target="_blank">Table Calculation Functions</a>.</p>
                            </td>
                        </tr>
                    </tbody>
                </table>

### COVARP

<table class="table--plain" style="width: 100%;">
                    <colgroup><col style="width: 20%;">
                    <col>
                    </colgroup><tbody>
                        <tr>
                            <td>Syntax</td>
                            <td><code>COVARP(expression 1, expression2)</code>
                            </td>
                        </tr>
                        <tr>
                            <td>Definition</td>
                            <td>Returns the <i>population</i> covariance of two expressions.</td>
                        </tr>
                        <tr>
                            <td>Notes</td>
                            <td>
                                <p>Covariance quantifies how two variables change together. A positive covariance indicates that the variables tend to move in the same direction, as when larger values of one variable tend to correspond to larger values of the other variable, on average. <i>Population covariance</i> is sample covariance multiplied by (n-1)/n, where n is the total number of non-null data points. Population covariance is the appropriate choice when there is data available for all items of interest as opposed to when there is only a random subset of items, in which case sample covariance (with the <code>COVAR</code> function) is appropriate.</p>
                                <p>If <code>&lt;expression1&gt;</code> and <code>&lt;expression2&gt;</code> are the same, for example <code>COVARP([profit], [profit])</code>, <code>COVARP</code> returns a value that indicates how widely values are distributed. Note: The value of <code>COVARP(X, X)</code> is equivalent to the value of <code>VARP(X)</code> and also to the value of <code>STDEVP(X)^2</code>.</p>
                            </td>
                        </tr>
                        <tr>
                            <td>Database limitations</td>
                            <td>
                                <p><code>COVARP</code> is available with the following data sources: Tableau data extracts, Cloudera Hive, EXASolution, Firebird (version 3.0 and later), Google BigQuery, Hortonworks Hadoop Hive, IBM PDA (Netezza), Oracle, PostgreSQL, Presto, SybaseIQ, Teradata, Vertica</p>
                                <p>For other data sources, consider either extracting the data or using <code>WINDOW_COVAR</code>. See <a href="https://help.tableau.com/current/pro/desktop/en-us/functions_functions_tablecalculation.htm" target="_blank">Table Calculation Functions</a>.</p>
                            </td>
                        </tr>
                    </tbody>
                </table>

[back to top](#top)

## D

### DATE

Type conversion function that changes string and number expressions into dates, as long as they are in a recognizable format.

<table class="table--plain">
                    <colgroup><col style="width: 20%;">
                    <col>
                    </colgroup><tbody>
                        <tr>
                            <td>Syntax</td>
                            <td><code>DATE(expression)</code>
                            </td>
                        </tr>
                        <tr>
                            <td>Output</td>
                            <td>Date</td>
                        </tr>
                        <tr>
                            <td>Definition</td>
                            <td>Returns a date given a number, string, or date <code>&lt;expression&gt;</code>.</td>
                        </tr>
                        <tr>
                            <td>Example</td>
                            <td><pre>DATE([Employee Start Date])</pre><pre>DATE("September 22, 2018") </pre><pre>DATE("9/22/2018")</pre><pre>DATE(#2018-09-22 14:52#)</pre>
                            </td>
                        </tr>
                        <tr>
                            <td>Notes</td>
                            <td>
                                <p>Unlike <code><a href="#DATEPARSE" class="xref">DATEPARSE</a></code>, there is no need to provide a pattern as <code>DATE</code> automatically recognizes many standard date formats. If <code>DATE</code> does not recognize the input, however, try using <code>DATEPARSE</code> and specifying the format.</p>
                                <p><code><a href="#MAKEDATE" class="xref">MAKEDATE</a></code> is another similar function, but <code>MAKEDATE</code> requires the input of numeric values for year, month, and day.</p>
                            </td>
                        </tr>
                    </tbody>
                </table>

### DATEADD

Adds a specified number of date parts (months, days, etc) to the starting date.

<table class="table--plain" style="width: 100%;">
                    <colgroup><col style="width: 20%;">
                    <col>
                    </colgroup><tbody>
                        <tr>
                            <td>Syntax</td>
                            <td><code>DATEADD(date_part, interval, date)</code>
                            </td>
                        </tr>
                        <tr>
                            <td>Output</td>
                            <td>Date</td>
                        </tr>
                        <tr>
                            <td>Definition</td>
                            <td>Returns the specified date with the specified number <code>&lt;interval&gt;</code> added to the specified &gt;<code>&lt;date_part</code> of that date. For example, adding three months or 12 days to a starting date.</td>
                        </tr>
                        <tr>
                            <td>Example</td>
                            <td>
                                <p>Push out all due dates by one week</p><pre>DATEADD('week', 1, [due date])</pre>
                                <p>Add 280 days to the date February 20, 2021</p><pre>DATEADD('day', 280, #2/20/21#) = #November 27, 2021#</pre>
                            </td>
                        </tr>
                        <tr>
                            <td>Notes</td>
                            <td>Supports ISO 8601 dates.</td>
                        </tr>
                    </tbody>
                </table>

### DATEDIFF

Returns the number of date parts (weeks, years, etc) between two dates.

<table class="table--plain" style="width: 100%;">
                    <colgroup><col style="width: 20%;">
                    <col>
                    </colgroup><tbody>
                        <tr>
                            <td>Syntax</td>
                            <td><code>DATEDIFF(date_part, date1, date2, [start_of_week])</code>
                            </td>
                        </tr>
                        <tr>
                            <td>Output</td>
                            <td>Integer</td>
                        </tr>
                        <tr>
                            <td>Definition</td>
                            <td>Returns the difference between <code>date1</code> and <code>date2</code> expressed in units of <code>date_part</code>. For example, subtracting the dates someone entered and left a band to see how long they were in the band.</td>
                        </tr>
                        <tr>
                            <td>Example</td>
                            <td>
                                <p>Number of days between March 25, 1986 and February 20, 2021</p><pre>DATEDIFF('day', #3/25/1986#, #2/20/2021#) = 12,751</pre>
                                <p>How many months someone was in a band</p><pre>DATEDIFF('month', [date joined band], [date left band])</pre>
                            </td>
                        </tr>
                        <tr>
                            <td>Notes</td>
                            <td>Supports ISO 8601 dates.</td>
                        </tr>
                    </tbody>
                </table>

### DATENAME

Returns the name of the specified date part as a discrete string.

<table class="table--plain" style="width: 100%;">
                    <colgroup><col style="width: 20%;">
                    <col>
                    </colgroup><tbody>
                        <tr>
                            <td>Syntax</td>
                            <td><code>DATENAME(date_part, date, [start_of_week])</code>
                            </td>
                        </tr>
                        <tr>
                            <td>Output</td>
                            <td>String</td>
                        </tr>
                        <tr>
                            <td>Definition</td>
                            <td>Returns <code>&lt;date_part&gt;</code> of date as a string.</td>
                        </tr>
                        <tr>
                            <td>Example</td>
                            <td><pre>DATENAME('year', #3/25/1986#) = "1986"</pre><pre>DATENAME('month', #1986-03-25#) = "March"</pre>
                            </td>
                        </tr>
                        <tr>
                            <td>Notes</td>
                            <td>
                                <p>Supports ISO 8601 dates.</p>
                                <p>A very similar calculation is <a href="#DATEPART" class="xref">DATEPART</a>, which returns the value of the specified date part as a continuous integer. <code>DATEPART</code> can be faster because it is a numerical operation.</p>
                                <p>By changing the attributes of the calculation’s result (dimension or measure, continuous or discrete) and the date formatting, the results of <code>DATEPART</code> and <code>DATENAME</code> can be formatted to be identical.</p>
                                <p>An inverse function is <code><a href="#DATEPARSE" class="xref">DATEPARSE</a></code>, which takes a string value and formats it as a date.</p>
                            </td>
                        </tr>
                    </tbody>
                </table>

### DATEPARSE

Returns specifically formatted strings as dates.

<table class="table--plain" style="width: 100%;">
                    <colgroup><col style="width: 20%;">
                    <col>
                    </colgroup><tbody>
                        <tr>
                            <td>Syntax</td>
                            <td><code>DATEPARSE(date_format, date_string)</code>
                            </td>
                        </tr>
                        <tr>
                            <td>Output</td>
                            <td>Date</td>
                        </tr>
                        <tr>
                            <td>Definition</td>
                            <td>The <code>&lt;date_format&gt;</code> argument describes how the <code>&lt;date_string&gt;</code> field is arranged. Because of the variety of ways the string field can be ordered, the <code>&lt;date_format&gt;</code> must match exactly. For a full explanation, see <a href="https://help.tableau.com/current/pro/desktop/en-us/data_dateparse.htm" target="_blank">Convert a Field to a Date Field</a>.</td>
                        </tr>
                        <tr>
                            <td>Example</td>
                            <td><pre>DATEPARSE('yyyy-MM-dd', "1986-03-25") = #March 25, 1986#</pre>
                            </td>
                        </tr>
                        <tr>
                            <td>Notes</td>
                            <td>
                                <p><code><a href="#DATE" class="xref">DATE</a></code> is a similar function that automatically recognizes many standard date formats.  <code>DATEPARSE</code> may be a better option if <code>DATE</code> does not recognize the input pattern. </p>
                                <p><code><a href="#MAKEDATE" class="xref">MAKEDATE</a></code> is another similar function, but <code>MAKEDATE</code> requires the input of numeric values for year, month, and day. </p>
                                <p>Inverse functions, which take dates apart and return the value of their parts, are <code><a href="#DATEPART" class="xref">DATEPART</a></code> (integer output) and <code><a href="#DATENAME" class="xref">DATENAME</a></code> (string output). </p>
                            </td>
                        </tr>
                        <tr>
                            <td>Database limitations</td>
                            <td>
                                <p><code>DATEPARSE</code> is available through the following connectors: non-legacy Excel and text file connections, Amazon EMR Hadoop Hive, Cloudera Hadoop, Google Sheets, Hortonworks Hadoop Hive, MapR Hadoop Hive, MySQL, Oracle, PostgreSQL, and Tableau extracts. Some formats may not be available for all connections.</p>
                                <p><code>DATEPARSE</code> is not supported on Hive variants. Only Denodo, Drill, and Snowflake are supported.</p>
                            </td>
                        </tr>
                    </tbody>
                </table>

### DATEPART

Returns the name of the specified date part as an integer.

<table class="table--plain" style="width: 100%;">
                    <colgroup><col style="width: 20%;">
                    <col>
                    </colgroup><tbody>
                        <tr>
                            <td>Syntax</td>
                            <td><code>DATEPART(date_part, date, [start_of_week])</code>
                            </td>
                        </tr>
                        <tr>
                            <td>Output</td>
                            <td>Integer</td>
                        </tr>
                        <tr>
                            <td>Definition</td>
                            <td>Returns <code>&lt;date_part&gt;</code> of date as an integer.</td>
                        </tr>
                        <tr>
                            <td>Example</td>
                            <td><pre>DATEPART('year', #1986-03-25#) = 1986</pre><pre>DATEPART('month', #1986-03-25#) = 3</pre>
                            </td>
                        </tr>
                        <tr>
                            <td>Notes</td>
                            <td>
                                <p>Supports ISO 8601 dates.</p>
                                <p>A very similar calculation is <code><a href="#DATENAME" class="xref">DATENAME</a></code>, which returns the name of the specified date part as a discrete string. <code>DATEPART</code> can be faster because it is a numerical operation. By changing the attributes of the field (dimension or measure, continuous or discrete) and the date formatting, the results of <code>DATEPART</code> and <code>DATENAME</code> can be formatted to be identical. </p>
                                <p>An inverse function is <code><a href="#DATEPARSE" class="xref">DATEPARSE</a></code>, which takes a string value and formats it as a date.</p>
                            </td>
                        </tr>
                    </tbody>
                </table>

### DATETIME

<table class="table--plain" style="width: 100%;">
                    <colgroup><col style="width: 20%;">
                    <col>
                    </colgroup><tbody>
                        <tr>
                            <td>Syntax</td>
                            <td><code>DATETIME(expression)</code>
                            </td>
                        </tr>
                        <tr>
                            <td>Output</td>
                            <td>Datetime</td>
                        </tr>
                        <tr>
                            <td>Definition</td>
                            <td>Returns a datetime given a number, string, or date expression.</td>
                        </tr>
                        <tr>
                            <td>Example</td>
                            <td><pre>DATETIME("April 15, 2005 07:59:00") = April 15, 2005 07:59:00</pre>
                            </td>
                        </tr>
                    </tbody>
                </table>

### DATETRUNC

This function can be thought of as date rounding. It takes a specific date and returns a version of that date at the desired specificity. Because every date must have a value for day, month, quarter, and year, `DATETRUNC` sets the values as the lowest value for each date part up to the date part specified. Refer to the example for more information.

<table class="table--plain" style="width: 100%;">
                    <colgroup><col style="width: 20%;">
                    <col>
                    </colgroup><tbody>
                        <tr>
                            <td>Syntax</td>
                            <td><code>DATETRUNC(date_part, date, [start_of_week])</code>
                            </td>
                        </tr>
                        <tr>
                            <td>Output</td>
                            <td>Date</td>
                        </tr>
                        <tr>
                            <td>Definition</td>
                            <td>Truncates the <code>&lt;date&gt;</code> to the accuracy specified by the <code>&lt;date_part&gt;</code>. This function returns a new date. For example, when you truncate a date that is in the middle of the month at the month level, this function returns the first day of the month. </td>
                        </tr>
                        <tr>
                            <td>Example</td>
                            <td><pre>DATETRUNC('day', #9/22/2018#) = #9/22/2018#</pre><pre>DATETRUNC('iso-week', #9/22/2018#) = #9/17/2018#</pre>
                                <p>(the monday of the week containing 9/22/2018)</p><pre>DATETRUNC(quarter, #9/22/2018#) = #7/1/2018# </pre>
                                <p>(the first day of the quarter containing 9/22/2018)</p>
                                <p class="note">Note: For week and iso-week, the <code>start_of_week</code> comes into play. ISO-weeks always start on Monday. For the locale of this example, an unspecified <code>start_of_week</code> means the week starts on Sunday.</p>
                            </td>
                        </tr>
                        <tr>
                            <td>Notes</td>
                            <td>
                                <p>Supports ISO 8601 dates.</p>
                                <p>You shouldn't use <code>DATETRUNC</code> to, for example, stop showing the time for a datetime field in a viz.  If you want to truncate the <i>display</i> of a date rather than round its accuracy, <a href="https://help.tableau.com/current/pro/desktop/en-us/dates_custom_date_formats.htm" target="_blank">adjust the formatting</a>. </p>
                                <p>For example, <code>DATETRUNC('day', #5/17/2022 3:12:48 PM#)</code>,  if formatted in the viz to display seconds, would display as <code>5/17/2022 12:00:00 AM</code>. </p>
                            </td>
                        </tr>
                    </tbody>
                </table>

### DAY

Returns the day of the month (1-31) as an integer.

<table class="table--plain" style="width: 100%;">
                    <colgroup><col style="width: 20%;">
                    <col>
                    </colgroup><tbody>
                        <tr>
                            <td>Syntax</td>
                            <td><code>DAY(date)</code>
                            </td>
                        </tr>
                        <tr>
                            <td>Output</td>
                            <td>Integer</td>
                        </tr>
                        <tr>
                            <td>Definition</td>
                            <td>Returns the day of the given <code>&lt;date&gt;</code> as an integer.</td>
                        </tr>
                        <tr>
                            <td>Example</td>
                            <td><pre>Day(#September 22, 2018#) = 22</pre>
                            </td>
                        </tr>
                        <tr>
                            <td>Notes</td>
                            <td>See also <code><a href="#WEEK" class="xref">WEEK</a></code>, <code><a href="#MONTH" class="xref">MONTH</a></code>, <code><a href="#QUARTER" class="xref">Quarter</a></code>, <code><a href="#YEAR" class="xref">YEAR</a></code>, and the ISO equivalents</td>
                        </tr>
                    </tbody>
                </table>

### DEGREES

<table class="table--plain" style="width: 100%;">
                    <colgroup><col style="width: 20%;">
                    <col>
                    </colgroup><tbody>
                        <tr>
                            <td>Syntax</td>
                            <td><code>DEGREES(number)</code>
                                <p>The number argument is the angle in radians. </p>
                            </td>
                        </tr>
                        <tr>
                            <td>Output</td>
                            <td>Number (degrees)</td>
                        </tr>
                        <tr>
                            <td>Definition</td>
                            <td>Converts an angle in radians to degrees.</td>
                        </tr>
                        <tr>
                            <td>Example</td>
                            <td><pre>DEGREES(PI( )/4) = 45.0</pre>
                            </td>
                        </tr>
                        <tr>
                            <td>Notes</td>
                            <td>
                                <p>The inverse function, <code><a href="#RADIANS" class="xref">RADIANS</a></code>, takes an angle in degrees and returns the angle in radians. </p>
                                <p>See also <code><a href="#PI" class="xref">PI</a>()</code>.</p>
                            </td>
                        </tr>
                    </tbody>
                </table>

### DISTANCE

<table class="table--plain" style="width: 100%;">
                    <colgroup><col style="width: 20%;">
                    <col>
                    </colgroup><tbody>
                        <tr>
                            <td>Syntax</td>
                            <td><code>DISTANCE(&lt;SpatialPoint1&gt;, &lt;SpatialPoint2&gt;, 'units')</code>
                            </td>
                        </tr>
                        <tr>
                            <td>Output</td>
                            <td>Number</td>
                        </tr>
                        <tr>
                            <td>Definition</td>
                            <td>Returns the distance measurement between two points in the specified <code>units</code>. </td>
                        </tr>
                        <tr>
                            <td>Example</td>
                            <td><pre>DISTANCE([Origin Point],[Destination Point], 'km')</pre>
                            </td>
                        </tr>
                        <tr>
                            <td>Notes</td>
                            <td>
                                <p>Supported unit names (must be in quotation marks in the calculation):
						</p>
                                <ul>
                                    <li><i>meters</i>: meters, metres, m</li>
                                    <li><i>kilometers</i>: kilometers, kilometres, km</li>
                                    <li><i>miles</i>: miles, mi                           </li>
                                    <li><i>feet</i>: feet, ft</li>
                                </ul>
                            </td>
                        </tr>
                        <tr>
                            <td>Database limitations</td>
                            <td>This function can only be created with a live connection but will continue to work if the data source is converted to an extract.</td>
                        </tr>
                    </tbody>
                </table>

### DIV

<table class="table--plain" style="width: 100%;">
                    <colgroup><col style="width: 20%;">
                    <col>
                    </colgroup><tbody>
                        <tr>
                            <td>Syntax</td>
                            <td><code>DIV(integer1, integer2)</code>
                            </td>
                        </tr>
                        <tr>
                            <td>Output</td>
                            <td>Integer</td>
                        </tr>
                        <tr>
                            <td>Definition</td>
                            <td>Returns the integer part of a division operation, in which <code>&lt;integer1&gt;</code> is divided by <code>&lt;integer2&gt;</code>.</td>
                        </tr>
                        <tr>
                            <td>Example</td>
                            <td><pre>DIV(11,2) = 5</pre>
                            </td>
                        </tr>
                    </tbody>
                </table>

### DOMAIN

`DOMAIN(string_url)`

Only supported when connected to Google BigQuery. For more information, see [Additional Functions](https://help.tableau.com/current/pro/desktop/en-us/functions_functions_additional.htm).

[back to top](#top)

## E

### ELSE

<table class="table--plain" style="width: 100%;">
                    <colgroup><col style="width: 20%;">
                    <col>
                    </colgroup><tbody>
                        <tr>
                            <td>Syntax</td>
                            <td><code>CASE &lt;expression&gt; 
							<br>WHEN &lt;value1&gt; THEN &lt;then1&gt; 
							<br>WHEN &lt;value2&gt; THEN &lt;then2&gt; 
							<br>...
						<br>[<b>ELSE</b> &lt;default&gt;]<br>END</code>
                            </td>
                        </tr>
                        <tr>
                            <td>Definition</td>
                            <td>An optional piece of an <code>IF</code>&nbsp;or <code>CASE</code> expression used to specify a default value to return if none of the tested expressions are true. </td>
                        </tr>
                        <tr>
                            <td>Example</td>
                            <td><pre>IF [Season] = "Summer"&nbsp;THEN&nbsp;'Sandals' <br>ELSEIF&nbsp;[Season] = "Winter"&nbsp;THEN&nbsp;'Boots' <br><b>ELSE</b>&nbsp;'Sneakers'&nbsp;<br>END</pre><pre>CASE [Season] <br>WHEN 'Summer' THEN 'Sandals' <br>WHEN 'Winter' THEN 'Boots' <br><b>ELSE</b> 'Sneakers' <br>END</pre>
                            </td>
                        </tr>
                        <tr>
                            <td>Notes</td>
                            <td>
                                <p>Used with <a href="#CASE" class="xref">CASE</a>, <a href="#WHEN" class="xref">WHEN</a>, <a href="#IF" class="xref">IF</a>, <a href="#ELSEIF" class="xref">ELSEIF</a>, <a href="#THEN" class="xref">THEN</a>,  and <a href="#END" class="xref">END</a></p>
                                <p><code>ELSE</code> is optional with <code>CASE</code> and <code>IF</code>. In a calculation where <code>ELSE</code> is not specified, if none of the <code>&lt;test&gt;</code>are true, the overall calculation will return null. </p>
                                <p><code>ELSE</code> does not require a condition (such as <code>[Season] = "Winter"</code>) and can be thought of as a form of null handling. </p>
                            </td>
                        </tr>
                    </tbody>
                </table>

### ELSEIF

<table class="table--plain" style="width: 100%;">
                    <colgroup><col style="width: 20%;">
                    <col>
                    </colgroup><tbody>
                        <tr>
                            <td>Syntax</td>
                            <td><code>[<b>ELSEIF</b> &lt;test2&gt; THEN &lt;then2&gt;]</code>
                            </td>
                        </tr>
                        <tr>
                            <td>Definition</td>
                            <td>An optional piece of an <code>IF</code>&nbsp;expression used to specify additional conditions beyond the initial IF.</td>
                        </tr>
                        <tr>
                            <td>Example</td>
                            <td><pre>IF [Season] = "Summer" THEN 'Sandals' <br><b>ELSEIF</b> [Season] = "Winter" THEN 'Boots' <br><b>ELSEIF</b> [Season] = "Spring" THEN 'Sneakers' <br><b>ELSEIF</b> [Season] = "Autumn" THEN 'Sneakers'<br>ELSE 'Bare feet' <br>END</pre>
                            </td>
                        </tr>
                        <tr>
                            <td>Notes</td>
                            <td>
                                <p>Used with <a href="#IF" class="xref">IF</a>,  <a href="#THEN" class="xref">THEN</a>, <a href="#ELSE" class="xref">ELSE</a>, and <a href="#END" class="xref">END</a></p>
                                <p><code>ELSEIF</code> can be thought of as additional <code>IF</code> clauses. <code>ELSEIF</code> is optional and can be repeated multiple times. </p>
                                <p>Unlike <code>ELSE</code>, <code>ELSEIF</code> requires a condition (such as <code>[Season] = "Winter"</code>).</p>
                            </td>
                        </tr>
                    </tbody>
                </table>

### END

<table class="table--plain" style="width: 100%;">
                    <colgroup><col style="width: 20%;">
                    <col>
                    </colgroup><tbody>
                        <tr>
                            <td>Definition</td>
                            <td>Used to close an <code>IF</code>&nbsp;or <code>CASE</code> expression. </td>
                        </tr>
                        <tr>
                            <td>Example</td>
                            <td><pre xml:space="preserve">IF [Season] = "Summer"&nbsp;THEN&nbsp;'Sandals' <br>ELSEIF&nbsp;[Season] = "Winter"&nbsp;THEN&nbsp;'Boots' <br>ELSE&nbsp;'Sneakers'&nbsp;<br><b>END</b></pre>
                                <p><i>"If Season = Summer, then return Sandals. If not, look at the next expression. If Season = Winter, then return Boots. If neither of the expressions are true, return Sneakers."</i>
                                </p><pre>CASE [Season] <br>WHEN 'Summer' THEN 'Sandals' <br>WHEN 'Winter' THEN 'Boots' <br>ELSE 'Sneakers' <br><b>END</b></pre>
                                <p><i>"Look at the Season field. If the value is Summer, then return Sandals. If the value is Winter, then return Boots. If none of the options in the calculation match what is in the Season field, return a Sneakers."</i>
                                </p>
                            </td>
                        </tr>
                        <tr>
                            <td>Notes</td>
                            <td>
                                <p>Used with <a href="#CASE" class="xref">CASE</a>, <a href="#WHEN" class="xref">WHEN</a>, <a href="#IF" class="xref">IF</a>, <a href="#ELSEIF" class="xref">ELSEIF</a>, <a href="#THEN" class="xref">THEN</a>, and <a href="#ELSE" class="xref">ELSE</a>.</p>
                            </td>
                        </tr>
                    </tbody>
                </table>

### ENDSWITH

### ENDSWITH

<table class="table--plain" style="width: 100%;">
                    <colgroup><col style="width: 20%;">
                    <col>
                    </colgroup><tbody>
                        <tr>
                            <td>Syntax</td>
                            <td><code>ENDSWITH(string, substring)</code>
                            </td>
                        </tr>
                        <tr>
                            <td>Output</td>
                            <td>Boolean</td>
                        </tr>
                        <tr>
                            <td>Definition</td>
                            <td>Returns true if the given <code>&lt;string&gt;</code> ends with the specified <code>&lt;substring&gt;</code>. Trailing white spaces are ignored.</td>
                        </tr>
                        <tr>
                            <td>Example</td>
                            <td><pre>ENDSWITH("Tableau", "leau") = true</pre>
                            </td>
                        </tr>
                        <tr>
                            <td>Notes</td>
                            <td>See also the supported RegEx in the <a href="https://help.tableau.com/current/pro/desktop/en-us/functions_functions_additional.htm" target="_blank">additional functions documentation</a>. </td>
                        </tr>
                    </tbody>
                </table>

### EXCLUDE

For more information, see [Level of Detail Expressions](https://help.tableau.com/current/pro/desktop/en-us/calculations_calculatedfields_lod.htm).

### EXP

<table class="table--plain" style="width: 100%;">
                    <colgroup><col style="width: 20%;">
                    <col>
                    </colgroup><tbody>
                        <tr>
                            <td>Syntax</td>
                            <td><code>EXP(number)</code>
                            </td>
                        </tr>
                        <tr>
                            <td>Output</td>
                            <td>Number</td>
                        </tr>
                        <tr>
                            <td>Definition</td>
                            <td>Returns e raised to the power of the given <code>&lt;number&gt;</code>.</td>
                        </tr>
                        <tr>
                            <td>Example</td>
                            <td><pre>EXP(2) = 7.389<br>EXP(-[Growth Rate]*[Time])</pre>
                            </td>
                        </tr>
                        <tr>
                            <td>Notes</td>
                            <td>See also <code><a href="#LN" class="xref">LN</a></code>. </td>
                        </tr>
                    </tbody>
                </table>

[back to top](#top)

## F

### FIND

<table class="table--plain" style="width: 100%;">
                    <colgroup><col style="width: 20%;">
                    <col>
                    </colgroup><tbody>
                        <tr>
                            <td>Syntax</td>
                            <td><code>FIND(string, substring, [start])</code>
                            </td>
                        </tr>
                        <tr>
                            <td>Output</td>
                            <td>Number</td>
                        </tr>
                        <tr>
                            <td>Definition</td>
                            <td>
                                <p>Returns the index position of <code>&lt;substring&gt;</code> in <code>&lt;string&gt;</code>, or 0 if the substring isn't found. The first character in the string is position 1.</p>
                                <p>If the optional numeric argument <code>start</code> is added, the function ignores any instances of substring that appear before the  starting position. </p>
                            </td>
                        </tr>
                        <tr>
                            <td>Example</td>
                            <td><pre>FIND("Calculation", "alcu") = 2</pre><pre>FIND("Calculation", "Computer") = 0</pre><pre>FIND("Ca<b>l</b>culation", "a", <b>3</b>) = 7</pre><pre>FIND("C<b>a</b>lculation", "a", <b>2</b>) = 2</pre><pre>FIND("Calcula<b>t</b>ion", "a", <b>8</b>) = 0</pre>
                            </td>
                        </tr>
                        <tr>
                            <td>Notes</td>
                            <td>See also the supported RegEx in the <a href="https://help.tableau.com/current/pro/desktop/en-us/functions_functions_additional.htm" target="_blank">additional functions documentation</a>. </td>
                        </tr>
                    </tbody>
                </table>

### FINDNTH

<table class="table--plain" style="width: 100%;">
                    <colgroup><col style="width: 20%;">
                    <col>
                    </colgroup><tbody>
                        <tr>
                            <td>Syntax</td>
                            <td><code>FINDNTH(string, substring, occurrence)</code>
                            </td>
                        </tr>
                        <tr>
                            <td>Output</td>
                            <td>Number</td>
                        </tr>
                        <tr>
                            <td>Definition</td>
                            <td>Returns the position of the nth occurrence of <code>&lt;substring&gt;</code> within the specified <code>&lt;string&gt;</code>, where n is defined by the <code>&lt;occurence&gt;</code> argument.</td>
                        </tr>
                        <tr>
                            <td>Example</td>
                            <td><pre>FINDNTH("Calculation", "a", 2) = 7</pre>
                            </td>
                        </tr>
                        <tr>
                            <td>Notes</td>
                            <td>
                                <p><code>FINDNTH</code> is not available for all data sources.</p>
                                <p>See also the supported RegEx in the <a href="https://help.tableau.com/current/pro/desktop/en-us/functions_functions_additional.htm" target="_blank">additional functions documentation</a>. </p>
                            </td>
                        </tr>
                    </tbody>
                </table>

### FIRST

`FIRST()`

For more information, see [Table Calculation Functions](https://help.tableau.com/current/pro/desktop/en-us/functions_functions_tablecalculation.htm).

### FIXED

For more information, see [Level of Detail Expressions](https://help.tableau.com/current/pro/desktop/en-us/calculations_calculatedfields_lod.htm).

### FLOAT

<table class="table--plain" style="width: 100%;">
                    <colgroup><col style="width: 20%;">
                    <col>
                    </colgroup><tbody>
                        <tr>
                            <td>Syntax</td>
                            <td><code>FLOAT(expression)</code>
                            </td>
                        </tr>
                        <tr>
                            <td>Output</td>
                            <td>Floating point number (decimal)</td>
                        </tr>
                        <tr>
                            <td>Definition</td>
                            <td>Casts its argument as a floating point number.</td>
                        </tr>
                        <tr>
                            <td>Example</td>
                            <td><pre>FLOAT(3) = 3.000</pre>
                            </td>
                        </tr>
                        <tr>
                            <td>Notes</td>
                            <td>See also <code><a href="#INT" class="xref">INT</a></code> which returns an integer. </td>
                        </tr>
                    </tbody>
                </table>

### FLOOR

<table class="table--plain" style="width: 100%;">
                    <colgroup><col style="width: 20%;">
                    <col>
                    </colgroup><tbody>
                        <tr>
                            <td>Syntax</td>
                            <td><code>FLOOR(number)</code>
                            </td>
                        </tr>
                        <tr>
                            <td>Output</td>
                            <td>Integer</td>
                        </tr>
                        <tr>
                            <td>Definition</td>
                            <td>Rounds a <code>&lt;number&gt;</code> to the nearest integer of equal or lesser value.</td>
                        </tr>
                        <tr>
                            <td>Example</td>
                            <td><pre>FLOOR(7.9) = 7</pre>
                            </td>
                        </tr>
                        <tr>
                            <td>Notes</td>
                            <td>See also <code><a href="#CEILING" class="xref">CEILING</a></code> and <code><a href="#ROUND" class="xref">ROUND</a></code>. </td>
                        </tr>
                        <tr>
                            <td>Database limitations</td>
                            <td>
                                <p><code>FLOOR</code> is available through the following connectors: Microsoft Excel, Text File, Statistical File, Published Data Source, Amazon EMR Hadoop Hive, Cloudera Hadoop, DataStax Enterprise, Google Analytics, Google BigQuery, Hortonworks Hadoop Hive, MapR&nbsp;Hadoop Hive, Microsoft SQL&nbsp;Server, Salesforce, Spark&nbsp;SQL.</p>
                            </td>
                        </tr>
                    </tbody>
                </table>

### FULLNAME

<table class="table--plain" style="width: 100%;">
                    <colgroup><col style="width: 20%;">
                    <col>
                    </colgroup><tbody>
                        <tr>
                            <td>Syntax</td>
                            <td><code>FULLNAME( )</code>
                            </td>
                        </tr>
                        <tr>
                            <td>Output</td>
                            <td>String</td>
                        </tr>
                        <tr>
                            <td>Definition</td>
                            <td>
                                <p>	
Returns the full name for the current user. </p>
                            </td>
                        </tr>
                        <tr>
                            <td>Example</td>
                            <td><pre>FULLNAME( )</pre>
                                <p>This returns the full name of the signed in user, such as "Hamlin Myrer".</p><pre>[Manager] = FULLNAME( )</pre>
                                <p>If manager "Hamlin Myrer" is signed in, this example returns TRUE only if the Manager field in the view contains "Hamlin Myrer". </p>
                            </td>
                        </tr>
                        <tr>
                            <td>Notes</td>
                            <td>
                                <p>This function checks:</p>
                                <ul>
                                    <li><span class="mc-variable Variables.TabsProductOnline variable">Tableau Cloud</span> and <span class="mc-variable Variables.TabsProductServer variable">Tableau Server</span>:&nbsp;the full name of the signed-in user</li>
                                    <li><span class="mc-variable Variables.TabsProductDesktop variable">Tableau Desktop</span>: the local or network full name for the user</li>
                                </ul>
                                <p><b>User filters</b>
                                </p>
                                <p>When used as a filter, a calculated field such as <code>[Username field] = FULLNAME( )</code> can be used to create a user filter that only shows data that is relevant to the person signed in to the server.</p>
                            </td>
                        </tr>
                    </tbody>
                </table>

[back to top](#top)

## G

### GET\_JSON\_OBJECT

`GET_JSON_OBJECT(JSON string, JSON path)`

Only supported when connected to Hadoop Hive. For more information, see [Additional Functions](https://help.tableau.com/current/pro/desktop/en-us/functions_functions_additional.htm).

### GROUP\_CONCAT

`GROUP_CONCAT(expression)`

Only supported when connected to Google BigQuery. For more information, see [Additional Functions](https://help.tableau.com/current/pro/desktop/en-us/functions_functions_additional.htm).

[back to top](#top)

## H

### HEXBINX

<table class="table--plain" style="width: 100%;">
                    <colgroup><col style="width: 20%;">
                    <col>
                    </colgroup><tbody>
                        <tr>
                            <td>Syntax</td>
                            <td><code>HEXBINX(number, number)</code>
                            </td>
                        </tr>
                        <tr>
                            <td>Output</td>
                            <td>Number</td>
                        </tr>
                        <tr>
                            <td>Definition</td>
                            <td>Maps an x, y coordinate to the x-coordinate of the nearest hexagonal bin. The bins have side length 1, so the inputs may need to be scaled appropriately.</td>
                        </tr>
                        <tr>
                            <td>Example</td>
                            <td><pre>HEXBINX([Longitude]*2.5, [Latitude]*2.5)</pre>
                            </td>
                        </tr>
                        <tr>
                            <td>Notes</td>
                            <td><code>HEXBINX </code>and <code><a href="#HEXBINY" class="xref">HEXBINY</a></code> are binning and plotting functions for hexagonal bins. Hexagonal bins are an efficient and elegant option for visualizing data in an x/y plane such as a map. Because the bins are hexagonal, each bin closely approximates a circle and minimizes variation in the distance from the data point to the center of the bin. This makes the clustering both more accurate and informative.</td>
                        </tr>
                    </tbody>
                </table>

### HEXBINY

<table class="table--plain" style="width: 100%;">
                    <colgroup><col style="width: 20%;">
                    <col>
                    </colgroup><tbody>
                        <tr>
                            <td>Syntax</td>
                            <td><code>HEXBINY(number, number)</code>
                            </td>
                        </tr>
                        <tr>
                            <td>Output</td>
                            <td>Number</td>
                        </tr>
                        <tr>
                            <td>Definition</td>
                            <td>Maps an x, y coordinate to the y-coordinate of the nearest hexagonal bin. The bins have side length 1, so the inputs may need to be scaled appropriately.</td>
                        </tr>
                        <tr>
                            <td>Example</td>
                            <td><pre>HEXBINY([Longitude]*2.5, [Latitude]*2.5)</pre>
                            </td>
                        </tr>
                        <tr>
                            <td>Notes</td>
                            <td>See also <code><a href="#HEXBINX" class="xref">HEXBINX</a></code>.</td>
                        </tr>
                    </tbody>
                </table>

### HOST

`HOST(string_url)`

Only supported when connected to Google BigQuery. For more information, see [Additional Functions](https://help.tableau.com/current/pro/desktop/en-us/functions_functions_additional.htm).

[back to top](#top)

## I

### IF

<table class="table--plain" style="width: 100%;">
                    <colgroup><col style="width: 20%;">
                    <col>
                    </colgroup><tbody>
                        <tr>
                            <td>Syntax</td>
                            <td><code><b>IF</b> &lt;test1&gt; THEN &lt;then1&gt; <br>[ELSEIF &lt;test2&gt; THEN &lt;then2&gt;...]<br>[ELSE &lt;default&gt;] <br>END</code>
                            </td>
                        </tr>
                        <tr>
                            <td>Output</td>
                            <td>Depends on data type of the <code>&lt;then&gt;</code>&nbsp;values. </td>
                        </tr>
                        <tr>
                            <td>Definition</td>
                            <td>
                                <p>Tests a series of expressions  and returns the <code>&lt;then&gt;</code> value for the first true <code>&lt;test&gt;</code>.</p>
                            </td>
                        </tr>
                        <tr>
                            <td>Example</td>
                            <td><pre>IF [Season] = "Summer"&nbsp;THEN&nbsp;'Sandals' <br>ELSEIF&nbsp;[Season] = "Winter"&nbsp;THEN&nbsp;'Boots' <br>ELSE&nbsp;'Sneakers'&nbsp;<br><b>END</b></pre>
                                <p><i>"If Season = Summer, then return Sandals. If not, look at the next expression. If Season = Winter, then return Boots. If neither of the expressions are true, return Sneakers."</i>
                                </p>
                            </td>
                        </tr>
                        <tr>
                            <td>Notes</td>
                            <td>
                                <p>See also <a href="#IF" class="xref">IF</a> and <a href="#IIF" class="xref">IIF</a>. </p>
                                <p>Used with <a href="#ELSEIF" class="xref">ELSEIF</a>, <a href="#THEN" class="xref">THEN</a>, <a href="#ELSE" class="xref">ELSE</a>, and <a href="#END" class="xref">END</a></p>
                            </td>
                        </tr>
                    </tbody>
                </table>

### IFNULL

<table class="table--plain" style="width: 100%;">
                    <colgroup><col style="width: 20%;">
                    <col>
                    </colgroup><tbody>
                        <tr>
                            <td>Syntax</td>
                            <td><code>IFNULL(expr1, expr2)</code>
                            </td>
                        </tr>
                        <tr>
                            <td>Output</td>
                            <td>Depends on the data type of the <code>&lt;expr&gt;</code> values. </td>
                        </tr>
                        <tr>
                            <td>Definition</td>
                            <td>
                                <p>Returns <code>&lt;expr1&gt;</code> if it's non-null, otherwise returns <code>&lt;expr2&gt;</code>.</p>
                            </td>
                        </tr>
                        <tr>
                            <td>Example</td>
                            <td><pre>IFNULL([Assigned Room], "TBD")</pre>
                                <p><i>"If the Assigned Room field isn't null, return its value. If the Assigned room field is null, return TBD instead."</i>
                                </p>
                            </td>
                        </tr>
                        <tr>
                            <td>Notes</td>
                            <td>
                                <p>Compare with <a href="#ISNULL" class="xref">ISNULL</a>. <code>IFNULL</code> always returns a value. <code>ISNULL</code>&nbsp;returns a boolean (true or false). </p>
                                <p>See also <a href="#ZN" class="xref">ZN</a>. </p>
                            </td>
                        </tr>
                    </tbody>
                </table>

### IIF

<table class="table--plain" style="width: 100%;">
                    <colgroup><col style="width: 20%;">
                    <col>
                    </colgroup><tbody>
                        <tr>
                            <td>Syntax</td>
                            <td><code><b>IIF</b>(&lt;test&gt;, &lt;then&gt;, &lt;else&gt;, [&lt;unknown&gt;])</code>
                            </td>
                        </tr>
                        <tr>
                            <td>Output</td>
                            <td>Depends on the data type of the values in the expression. </td>
                        </tr>
                        <tr>
                            <td>Definition</td>
                            <td>Checks whether a condition is met (<code>&lt;test&gt;</code>), and returns <code>&lt;then&gt;</code>if the test is true, <code>&lt;else&gt;</code>&nbsp;if the test is false, and an optional  value for <code>&lt;unknown&gt;</code> if the test is null. If the optional unknown isn't specified, <code>IIF</code> returns null. </td>
                        </tr>
                        <tr>
                            <td>Example</td>
                            <td><pre>IIF([Season] = 'Summer', 'Sandals', 'Other footwear')</pre>
                                <p><i>"If Season = Summer, then return Sandals. If not, return Other footwear"</i>
                                </p><pre>IIF([Season] = 'Summer', 'Sandals', <br>   IIF('Season' = 'Winter', 'Boots',  'Other footwear')<br>)</pre>
                                <p><i>"If Season = Summer, then return Sandals. If not, look at the next expression. If Season = Winter, then return Boots. If neither are true, return Sneakers."</i>
                                </p><pre>IIF('Season' = 'Summer', 'Sandals', <br>   IIF('Season' = 'Winter', 'Boots',  <br>      IIF('Season' = 'Spring', 'Sneakers', 'Other footwear')<br>   )<br>)</pre>
                                <p><i>"If Season = Summer, then return Sandals. If not, look at the next expression. If Season = Winter, then return Boots. If none of the expressions are true, return Sneakers."</i>
                                </p>
                            </td>
                        </tr>
                        <tr>
                            <td>Notes</td>
                            <td>
                                <p>See also <a href="#IF" class="xref">IF</a> and<a href="#CASE" class="xref">CASE</a>. </p>
                                <p><code>IIF</code> doesn't have an equivalent to <code>ELSEIF</code> (like <code>IF</code>)&nbsp;or repeated <code>WHEN</code> clauses (like <code>CASE</code>). Instead, multiple tests can be evaluated sequentially by nesting <code>IIF</code> statements as the <code>&lt;unknown&gt;</code>&nbsp;element. The first (outermost) true  is returned. </p>
                                <p>That is to say, in the calculation below,  the result will be Red, not Orange, because the expression stops being evaluated as soon as A=A is evaluated as true: </p>
                                <p> <code>IIF('A' = 'A', 'Red', IIF('B' = 'B', 'Orange',  IIF('C' = 'D', 'Yellow', 'Green')))</code></p>
                            </td>
                        </tr>
                    </tbody>
                </table>

### IN

<table class="table--plain" style="width: 100%;">
                    <colgroup><col style="width: 20%;">
                    <col>
                    </colgroup><tbody>
                        <tr>
                            <td>Syntax</td>
                            <td><code>&lt;expr1&gt; IN &lt;expr2&gt;</code>
                            </td>
                        </tr>
                        <tr>
                            <td>Output</td>
                            <td>Boolean (true or false)</td>
                        </tr>
                        <tr>
                            <td>Definition</td>
                            <td>	
					Returns <code>TRUE</code> if any value in <code>&lt;expr1&gt;</code> matches any value in <code>&lt;expr2&gt;</code>.</td>
                        </tr>
                        <tr>
                            <td>Example</td>
                            <td><pre>SUM([Cost]) IN&nbsp;(1000, 15, 200)</pre>
                                <p><i>"Is the value of the Cost field 1000, 15, or 200?"</i>
                                </p><pre>[Field] IN&nbsp;[Set]</pre>
                                <p><i>"Is the value of the field present in the set?"</i>
                                </p>
                            </td>
                        </tr>
                        <tr>
                            <td>Notes</td>
                            <td>
                                <p>The values in <code>&lt;expr2&gt;</code> can be a set, list of literal values, or combined field.</p>
                                <p>See also  <a href="#WHEN" class="xref">WHEN</a>. </p>
                            </td>
                        </tr>
                    </tbody>
                </table>

### INCLUDE

For more information, see [Level of Detail Expressions](https://help.tableau.com/current/pro/desktop/en-us/calculations_calculatedfields_lod.htm).

### INDEX

`INDEX( )`

For more information, see [Table Calculation Functions](https://help.tableau.com/current/pro/desktop/en-us/functions_functions_tablecalculation.htm).

### INT

<table class="table--plain" style="width: 100%;">
                    <colgroup><col style="width: 20%;">
                    <col>
                    </colgroup><tbody>
                        <tr>
                            <td>Syntax</td>
                            <td><code>INT(expression)</code>
                            </td>
                        </tr>
                        <tr>
                            <td>Output</td>
                            <td>Integer</td>
                        </tr>
                        <tr>
                            <td>Definition</td>
                            <td>Casts its argument as an integer. For expressions, this function truncates results to the closest integer toward zero.</td>
                        </tr>
                        <tr>
                            <td>Example</td>
                            <td><pre>INT(8/3) = 2</pre><pre>INT(-9.7) = -9</pre>
                            </td>
                        </tr>
                        <tr>
                            <td>Notes</td>
                            <td>
                                <p>When a string is converted to an integer it is first converted to a float and then rounded.</p>
                                <p>See also <code><a href="#FLOAT" class="xref">FLOAT</a></code> which returns a decimal.<br>See also <a href="#ROUND" class="xref">ROUND</a>, <a href="#CEILING" class="xref">CEILING</a>, and <a href="#FLOOR" class="xref">FLOOR</a></p>
                            </td>
                        </tr>
                    </tbody>
                </table>

### INTERSECTS

<table class="table--plain" style="width: 100%;"><colgroup><col style="width: 20%;"> <col></colgroup><tbody><tr><td>Syntax</td><td><code>INTERSECTS (&lt;geometry1&gt;, &lt;geometry2&gt;)</code></td></tr><tr><td>Output</td><td>Boolean</td></tr><tr><td>Definition</td><td>Returns true or false indicating if two geometries overlap in space.</td></tr><tr><td>Notes</td><td>Supported combinations: point/polygon, line/polygon, and polygon/polygon.</td></tr></tbody></table>

### ISDATE

Checks if the string is a valid date format.

<table class="table--plain" style="width: 100%;">
                    <colgroup><col style="width: 20%;">
                    <col>
                    </colgroup><tbody>
                        <tr>
                            <td>Syntax</td>
                            <td><code>ISDATE(string)</code>
                            </td>
                        </tr>
                        <tr>
                            <td>Output</td>
                            <td>Boolean</td>
                        </tr>
                        <tr>
                            <td>Definition</td>
                            <td>Returns true if a given <code>&lt;string&gt;</code> is a valid date.</td>
                        </tr>
                        <tr>
                            <td>Example</td>
                            <td><pre>ISDATE(09/22/2018) = true</pre><pre>ISDATE(22SEP18) = false</pre>
                            </td>
                        </tr>
                        <tr>
                            <td>Notes</td>
                            <td>The required argument must be a string. ISDATE cannot be used for a field with a date data type—the calculation will return an error. </td>
                        </tr>
                    </tbody>
                </table>

### ISFULLNAME

<table class="table--plain" style="width: 100%;">
                    <colgroup><col style="width: 20%;">
                    <col>
                    </colgroup><tbody>
                        <tr>
                            <td>Syntax</td>
                            <td><code>ISFULLNAME("User Full Name")</code>
                            </td>
                        </tr>
                        <tr>
                            <td>Output</td>
                            <td>Boolean</td>
                        </tr>
                        <tr>
                            <td>Definition</td>
                            <td>
                                <p>Returns <code>TRUE</code> if the current user's full name matches the specified full name or <code>FALSE</code> if it does not match.</p>
                            </td>
                        </tr>
                        <tr>
                            <td>Example</td>
                            <td><pre>ISFULLNAME("Hamlin Myrer")</pre>
                            </td>
                        </tr>
                        <tr>
                            <td>Notes</td>
                            <td>
                                <p>The <code>&lt;"User Full Name"&gt;</code> argument must be a literal string, not a field. </p>
                                <p>This function checks:</p>
                                <ul>
                                    <li><span class="mc-variable Variables.TabsProductOnline variable">Tableau Cloud</span> and <span class="mc-variable Variables.TabsProductServer variable">Tableau Server</span>:&nbsp;the full name of the signed-in user</li>
                                    <li><span class="mc-variable Variables.TabsProductDesktop variable">Tableau Desktop</span>: the local or network full name for the user</li>
                                </ul>
                            </td>
                        </tr>
                    </tbody>
                </table>

### ISMEMBEROF

<table class="table--plain" style="width: 100%;">
                    <colgroup><col style="width: 20%;">
                    <col>
                    </colgroup><tbody>
                        <tr>
                            <td>Syntax</td>
                            <td><code>ISMEMBEROF("Group Name")</code>
                            </td>
                        </tr>
                        <tr>
                            <td>Output</td>
                            <td>Boolean or null</td>
                        </tr>
                        <tr>
                            <td>Definition</td>
                            <td>
                                <p>Returns <code>TRUE</code> if the person currently using Tableau is a member of a group that matches the given string, <code>FALSE</code> if they're not a member, and <code>NULL</code> if they're not signed in. </p>
                            </td>
                        </tr>
                        <tr>
                            <td>Example</td>
                            <td><pre>ISMEMBEROF('Superstars')</pre><pre>ISMEMBEROF('domain.lan\Sales')</pre>
                            </td>
                        </tr>
                        <tr>
                            <td>Notes</td>
                            <td>
                                <p>The <code>&lt;"Group Full Name"&gt;</code> argument must be a literal string, not a field. </p>
                                <p>If the user is signed in to <span class="mc-variable Variables.TabsProductOnline variable">Tableau Cloud</span> or <span class="mc-variable Variables.TabsProductServer variable">Tableau Server</span>, group membership is determined by Tableau groups. The function will return TRUE if the given string is "All Users" </p>
                                <p>The <code>ISMEMBEROF( )</code> function will also accept Active Directory domains. The Active Directory domain must be declared in the calculation with the group name.</p>
                            </td>
                        </tr>
                    </tbody>
                </table>

### ISNULL

<table class="table--plain" style="width: 100%;">
                    <colgroup><col style="width: 20%;">
                    <col>
                    </colgroup><tbody>
                        <tr>
                            <td>Syntax</td>
                            <td><code>ISNULL(expression)</code>
                            </td>
                        </tr>
                        <tr>
                            <td>Output</td>
                            <td>Boolean (true or false)</td>
                        </tr>
                        <tr>
                            <td>Definition</td>
                            <td>
                                <p>Returns true if the <code>&lt;expression&gt;</code> is NULL (does not contain valid data).</p>
                            </td>
                        </tr>
                        <tr>
                            <td>Example</td>
                            <td><pre>ISNULL([Assigned Room])</pre>
                                <p><i>"Is the Assigned Room field null?"</i>
                                </p>
                            </td>
                        </tr>
                        <tr>
                            <td>Notes</td>
                            <td>
                                <p>Compare with <a href="#IFNULL" class="xref">IFNULL</a>. <code>IFNULL</code> always returns a value. <code>ISNULL</code> returns a boolean.</p>
                                <p>See also <a href="#ZN" class="xref">ZN</a>. </p>
                            </td>
                        </tr>
                    </tbody>
                </table>

### ISOQUARTER

<table class="table--plain" style="width: 100%;">
                    <colgroup><col style="width: 20%;">
                    <col>
                    </colgroup><tbody>
                        <tr>
                            <td>Syntax</td>
                            <td><code>ISOQUARTER(date)</code>
                            </td>
                        </tr>
                        <tr>
                            <td>Output</td>
                            <td>Integer</td>
                        </tr>
                        <tr>
                            <td>Definition</td>
                            <td>Returns the ISO8601 week-based quarter of a given <code>&lt;date&gt;</code> as an integer.</td>
                        </tr>
                        <tr>
                            <td>Example</td>
                            <td><pre>ISOQUARTER(#1986-03-25#) = 1</pre>
                            </td>
                        </tr>
                        <tr>
                            <td>Notes</td>
                            <td>See also <code><a href="#ISOWEEK" class="xref">ISOWEEK</a></code>, <code><a href="#ISOWEEKDAY" class="xref">ISOWEEKDAY</a></code>, <code><a href="#ISOYEAR" class="xref">ISOYEAR</a></code>, and the non-ISO equivalents.</td>
                        </tr>
                    </tbody>
                </table>

### ISOWEEK

<table class="table--plain" style="width: 100%;">
                    <colgroup><col style="width: 20%;">
                    <col>
                    </colgroup><tbody>
                        <tr>
                            <td>Syntax</td>
                            <td><code>ISOWEEK(date)</code>
                            </td>
                        </tr>
                        <tr>
                            <td>Output</td>
                            <td>Integer</td>
                        </tr>
                        <tr>
                            <td>Definition</td>
                            <td>Returns the ISO8601 week-based week of a given <code>&lt;date&gt;</code> as an integer.</td>
                        </tr>
                        <tr>
                            <td>Example</td>
                            <td><pre>ISOWEEK(#1986-03-25#) = 13</pre>
                            </td>
                        </tr>
                        <tr>
                            <td>Notes</td>
                            <td>See also <code><a href="#ISOWEEKDAY" class="xref">ISOWEEKDAY</a></code>, <code><a href="#ISOQUARTER" class="xref">ISOQUARTER</a></code>, <code><a href="#ISOYEAR" class="xref">ISOYEAR</a></code>, and the non-ISO equivalents.</td>
                        </tr>
                    </tbody>
                </table>

### ISOWEEKDAY

<table class="table--plain" style="width: 100%;">
                    <colgroup><col style="width: 20%;">
                    <col>
                    </colgroup><tbody>
                        <tr>
                            <td>Syntax</td>
                            <td><code>ISOWEEKDAY(date)</code>
                            </td>
                        </tr>
                        <tr>
                            <td>Output</td>
                            <td>Integer</td>
                        </tr>
                        <tr>
                            <td>Definition</td>
                            <td>Returns the ISO8601 week-based weekday of a given <code>&lt;date&gt;</code> as an integer.</td>
                        </tr>
                        <tr>
                            <td>Example</td>
                            <td><pre>ISOWEEKDAY(#1986-03-25#) = 2</pre>
                            </td>
                        </tr>
                        <tr>
                            <td>Notes</td>
                            <td>See also <code><a href="#ISOWEEK" class="xref">ISOWEEK</a></code>, <code><a href="#ISOQUARTER" class="xref">ISOQUARTER</a></code>, <code><a href="#ISOYEAR" class="xref">ISOYEAR</a></code>, and the non-ISO equivalents</td>
                        </tr>
                    </tbody>
                </table>

### ISOYEAR

<table class="table--plain" style="width: 100%;">
                    <colgroup><col style="width: 20%;">
                    <col>
                    </colgroup><tbody>
                        <tr>
                            <td>Syntax</td>
                            <td><code>ISOYEAR(date)</code>
                            </td>
                        </tr>
                        <tr>
                            <td>Output</td>
                            <td>Integer</td>
                        </tr>
                        <tr>
                            <td>Definition</td>
                            <td>Returns the ISO8601 week-based year of a given date as an integer.</td>
                        </tr>
                        <tr>
                            <td>Example</td>
                            <td><pre>ISOYEAR(#1986-03-25#) = 1,986</pre>
                            </td>
                        </tr>
                        <tr>
                            <td>Notes</td>
                            <td>See also <code><a href="#ISOWEEK" class="xref">ISOWEEK</a></code>, <code><a href="#ISOWEEKDAY" class="xref">ISOWEEKDAY</a></code>, <code><a href="#ISOQUARTER" class="xref">ISOQUARTER</a></code>, and the non-ISO equivalents.</td>
                        </tr>
                    </tbody>
                </table>

### ISUSERNAME

<table class="table--plain" style="width: 100%;">
                    <colgroup><col style="width: 20%;">
                    <col>
                    </colgroup><tbody>
                        <tr>
                            <td>Syntax</td>
                            <td><code>ISUSERNAME("username")</code>
                            </td>
                        </tr>
                        <tr>
                            <td>Output</td>
                            <td>Boolean</td>
                        </tr>
                        <tr>
                            <td>Definition</td>
                            <td>Returns <code>TRUE</code> if the current user's username matches the specified <code>&lt;username&gt;</code> or <code>FALSE</code> if it does not match.</td>
                        </tr>
                        <tr>
                            <td>Example</td>
                            <td><pre>ISUSERNAME("hmyrer")</pre>
                            </td>
                        </tr>
                        <tr>
                            <td>Notes</td>
                            <td>
                                <p>The <code>&lt;"username"&gt;</code> argument must be a literal string, not a field. </p>
                                <p>This function checks:</p>
                                <ul>
                                    <li><span class="mc-variable Variables.TabsProductOnline variable">Tableau Cloud</span> and <span class="mc-variable Variables.TabsProductServer variable">Tableau Server</span>:&nbsp;the username of the signed-in user</li>
                                    <li><span class="mc-variable Variables.TabsProductDesktop variable">Tableau Desktop</span>: the local or network username for the user</li>
                                </ul>
                            </td>
                        </tr>
                    </tbody>
                </table>

[back to top](#top)

## J

[back to top](#top)

## K

[back to top](#top)

## L

### LAST

`LAST()`

For more information, see [Table Calculation Functions](https://help.tableau.com/current/pro/desktop/en-us/functions_functions_tablecalculation.htm).

### LEFT

<table class="table--plain" style="width: 100%;">
                    <colgroup><col style="width: 20%;">
                    <col>
                    </colgroup><tbody>
                        <tr>
                            <td>Syntax</td>
                            <td><code>	LEFT(string, number)</code>
                            </td>
                        </tr>
                        <tr>
                            <td>Output</td>
                            <td>String</td>
                        </tr>
                        <tr>
                            <td>Definition</td>
                            <td>Returns the left-most <code>&lt;number&gt;</code> of characters in the string.</td>
                        </tr>
                        <tr>
                            <td>Example</td>
                            <td><pre>LEFT("Matador", 4) = "Mata"</pre>
                            </td>
                        </tr>
                        <tr>
                            <td>Notes</td>
                            <td>See also <a href="#MID" class="xref">MID</a> and <a href="#RIGHT" class="xref">RIGHT</a>. </td>
                        </tr>
                    </tbody>
                </table>

### LEN

<table class="table--plain" style="width: 100%;">
                    <colgroup><col style="width: 20%;">
                    <col>
                    </colgroup><tbody>
                        <tr>
                            <td>Syntax</td>
                            <td><code>LEN(string)</code>
                            </td>
                        </tr>
                        <tr>
                            <td>Output</td>
                            <td>Number</td>
                        </tr>
                        <tr>
                            <td>Definition</td>
                            <td>Returns the length of the <code>&lt;string&gt;</code>.</td>
                        </tr>
                        <tr>
                            <td>Example</td>
                            <td><pre>LEN("Matador") = 7</pre>
                            </td>
                        </tr>
                        <tr>
                            <td>Notes</td>
                            <td>Not to be confused with the spatial function <code><a href="#LENGTH" class="xref">LENGTH</a></code>. </td>
                        </tr>
                    </tbody>
                </table>

### LENGTH

<table class="table--plain" style="width: 100%;">
                    <colgroup><col style="width: 20%;">
                    <col>
                    </colgroup><tbody>
                        <tr>
                            <td>Syntax</td>
                            <td><code>LENGTH(geometry, 'units')</code>
                            </td>
                        </tr>
                        <tr>
                            <td>Output</td>
                            <td>Number</td>
                        </tr>
                        <tr>
                            <td>Definition</td>
                            <td>Returns the geodetic path length of the line string or strings in the <code>&lt;geometry&gt;</code> using the given <code>&lt;units&gt;</code>. </td>
                        </tr>
                        <tr>
                            <td>Example</td>
                            <td><pre>LENGTH([Spatial], 'metres')</pre>
                            </td>
                        </tr>
                        <tr>
                            <td>Notes</td>
                            <td>
                                <p>The result is <code>&lt;NaN&gt;</code> if the geometry argument has no linestrings, though other elements are permitted. </p>
                                <p>Not to be confused with the string function <code><a href="#LEN" class="xref">LEN</a></code>.</p>
                            </td>
                        </tr>
                    </tbody>
                </table>

### LN

<table class="table--plain" style="width: 100%;">
                    <colgroup><col style="width: 20%;">
                    <col>
                    </colgroup><tbody>
                        <tr>
                            <td>Syntax</td>
                            <td><code>LN(number)</code>
                            </td>
                        </tr>
                        <tr>
                            <td>Output</td>
                            <td>
                                <p>Number</p>
                                <p>The output is <code>Null</code> if the argument is less than or equal to zero.</p>
                            </td>
                        </tr>
                        <tr>
                            <td>Definition</td>
                            <td>Returns the natural logarithm of a <code>&lt;number&gt;</code>.</td>
                        </tr>
                        <tr>
                            <td>Example</td>
                            <td><pre>LN(50) = 3.912023005</pre>
                            </td>
                        </tr>
                        <tr>
                            <td>Notes</td>
                            <td>See also <code><a href="#EXP" class="xref">EXP</a></code> and <code><a href="#LOG" class="xref">LOG</a></code>.</td>
                        </tr>
                    </tbody>
                </table>

### LOG

<table class="table--plain" style="width: 100%;">
                    <colgroup><col style="width: 20%;">
                    <col>
                    </colgroup><tbody>
                        <tr>
                            <td>Syntax</td>
                            <td><code>LOG(number, [base])</code>
                                <p>If the optional base argument isn't present, base 10 is used. </p>
                            </td>
                        </tr>
                        <tr>
                            <td>Output</td>
                            <td>Number</td>
                        </tr>
                        <tr>
                            <td>Definition</td>
                            <td>Returns the logarithm of a <code>&lt;number&gt;</code> for the given <code>&lt;base&gt;</code>.</td>
                        </tr>
                        <tr>
                            <td>Example</td>
                            <td><pre xml:space="preserve">LOG(16,4) = 2</pre>
                            </td>
                        </tr>
                        <tr>
                            <td>Notes</td>
                            <td>See also <code><a href="#POWER" class="xref">POWER</a></code> <code><a href="#LN" class="xref">LN</a></code>.</td>
                        </tr>
                    </tbody>
                </table>

### LOG2

`LOG2(number)`

Only supported when connected to Google BigQuery. For more information, see [Additional Functions](https://help.tableau.com/current/pro/desktop/en-us/functions_functions_additional.htm).

### LOOKUP

`LOOKUP(expression, [offest])`

For more information, see [Table Calculation Functions](https://help.tableau.com/current/pro/desktop/en-us/functions_functions_tablecalculation.htm).

### LOWER

<table class="table--plain" style="width: 100%;">
                    <colgroup><col style="width: 20%;">
                    <col>
                    </colgroup><tbody>
                        <tr>
                            <td>Syntax</td>
                            <td><code>LOWER(string)</code>
                            </td>
                        </tr>
                        <tr>
                            <td>Output</td>
                            <td>String</td>
                        </tr>
                        <tr>
                            <td>Definition</td>
                            <td>Returns the provided <code>&lt;string&gt;</code> in all lowercase characters.</td>
                        </tr>
                        <tr>
                            <td>Example</td>
                            <td><pre>LOWER("ProductVersion") = "productversion"</pre>
                            </td>
                        </tr>
                        <tr>
                            <td>Notes</td>
                            <td>See also <a href="#UPPER" class="xref">UPPER</a> and <a href="#PROPER" class="xref">PROPER</a>. </td>
                        </tr>
                    </tbody>
                </table>

### LTRIM

<table class="table--plain" style="width: 100%;">
                    <colgroup><col style="width: 20%;">
                    <col>
                    </colgroup><tbody>
                        <tr>
                            <td>Syntax</td>
                            <td><code>	LTRIM(string)</code>
                            </td>
                        </tr>
                        <tr>
                            <td>Output</td>
                            <td>String</td>
                        </tr>
                        <tr>
                            <td>Definition</td>
                            <td>Returns the provided <code>&lt;string&gt;</code> with any leading spaces removed.</td>
                        </tr>
                        <tr>
                            <td>Example</td>
                            <td><pre>LTRIM(" Matador ") = "Matador "</pre>
                            </td>
                        </tr>
                        <tr>
                            <td>Notes</td>
                            <td>See also <a href="#RTRIM" class="xref">RTRIM</a>. </td>
                        </tr>
                    </tbody>
                </table>

### LTRIM\_THIS

`LTRIM_THIS(string, string)`

Only supported when connected to Google BigQuery. For more information, see [Additional Functions](https://help.tableau.com/current/pro/desktop/en-us/functions_functions_additional.htm).

[back to top](#top)

## M

### MAKEDATE

<table class="table--plain" style="width: 100%;">
                    <colgroup><col style="width: 20%;">
                    <col>
                    </colgroup><tbody>
                        <tr>
                            <td>Syntax</td>
                            <td><code>MAKEDATE(year, month, day)</code>
                            </td>
                        </tr>
                        <tr>
                            <td>Output</td>
                            <td>Date</td>
                        </tr>
                        <tr>
                            <td>Definition</td>
                            <td>Returns a date value constructed from the specified <code>&lt;year&gt;</code>, <code>&lt;month&gt;</code>, and <code>&lt;day&gt;</code>.</td>
                        </tr>
                        <tr>
                            <td>Example</td>
                            <td><pre>MAKEDATE(1986,3,25) = #1986-03-25#</pre>
                            </td>
                        </tr>
                        <tr>
                            <td>Notes</td>
                            <td>
                                <p class="note"><b>Note</b>: Incorrectly entered values will be adjusted into a date, such as <code>MAKEDATE(2020,4,31) = May 1, 2020</code> rather than returning an error that there is no 31st day of April.</p>
                                <p>Available for Tableau Data Extracts. Check for availability in other data sources.</p>
                                <p><code>MAKEDATE</code> requires numerical inputs for the parts of a date. If your data is a string that should be a date, try the <code><a href="#DATE" class="xref">DATE</a></code> function. <code>DATE</code> automatically recognizes many standard date formats. If <code>DATE</code> does not recognize the input try using <code><a href="#DATEPARSE" class="xref">DATEPARSE</a></code>.</p>
                            </td>
                        </tr>
                    </tbody>
                </table>

### MAKEDATETIME

<table class="table--plain" style="width: 100%;">
                    <colgroup><col style="width: 20%;">
                    <col>
                    </colgroup><tbody>
                        <tr>
                            <td>Syntax</td>
                            <td><code>MAKEDATETIME(date, time)</code>
                            </td>
                        </tr>
                        <tr>
                            <td>Output</td>
                            <td>Datetime</td>
                        </tr>
                        <tr>
                            <td>Definition</td>
                            <td>Returns a datetime that combines a <code>&lt;date&gt;</code> and a <code>&lt;time&gt;</code>. The date can be a date, datetime, or a string type. The time must be a datetime.</td>
                        </tr>
                        <tr>
                            <td>Example</td>
                            <td><pre>MAKEDATETIME("1899-12-30", #07:59:00#) = #12/30/1899 7:59:00 AM#</pre><pre>MAKEDATETIME([Date], [Time]) = #1/1/2001 6:00:00 AM#</pre>
                            </td>
                        </tr>
                        <tr>
                            <td>Notes</td>
                            <td>
                                <p>This function is available only for MySQL-compatible connections (which for Tableau are MySQL and Amazon Aurora).</p>
                                <p><code><a href="#MAKETIME" class="xref">MAKETIME</a></code> is a similar function available for Tableau Data Extracts and some other data sources.</p>
                            </td>
                        </tr>
                    </tbody>
                </table>

### MAKELINE

<table class="table--plain" style="width: 100%;">
                    <colgroup><col style="width: 20%;">
                    <col>
                    </colgroup><tbody>
                        <tr>
                            <td>Syntax</td>
                            <td><code>MAKELINE(SpatialPoint1, SpatialPoint2)</code>
                            </td>
                        </tr>
                        <tr>
                            <td>Output</td>
                            <td>Geometry (line)</td>
                        </tr>
                        <tr>
                            <td>Definition</td>
                            <td>Generates a line mark between two points</td>
                        </tr>
                        <tr>
                            <td>Example</td>
                            <td><pre>MAKELINE(MAKEPOINT(47.59, -122.32), MAKEPOINT(48.5, -123.1))</pre>
                            </td>
                        </tr>
                        <tr>
                            <td>Notes</td>
                            <td>Useful for building origin-destination maps.</td>
                        </tr>
                    </tbody>
                </table>

### MAKEPOINT

<table class="table--plain" style="width: 100%;">
                    <colgroup><col style="width: 20%;">
                    <col>
                    </colgroup><tbody>
                        <tr>
                            <td>Syntax</td>
                            <td><code>MAKEPOINT(latitude, longitude, [SRID])</code>
                            </td>
                        </tr>
                        <tr>
                            <td>Output</td>
                            <td>Geometry (point)</td>
                        </tr>
                        <tr>
                            <td>Definition</td>
                            <td>
                                <p>Converts data from <code>&lt;latitude&gt;</code> and <code>&lt;longitude&gt;</code> columns into spatial objects.</p>
                                <p>If the optional <code>&lt;SRID&gt;</code> argument is added, the inputs can be other projected geographic coordinates. </p>
                            </td>
                        </tr>
                        <tr>
                            <td>Example</td>
                            <td><pre>MAKEPOINT(48.5, -123.1)</pre><pre>MAKEPOINT([AirportLatitude], [AirportLongitude])</pre><pre>MAKEPOINT([Xcoord],[Ycoord], 3493)</pre>
                            </td>
                        </tr>
                        <tr>
                            <td>Notes</td>
                            <td>
                                <p><code>MAKEPOINT</code> can't use the automatically generated latitude and longitude fields. The data source must contain the  coordinates natively. </p>
                                <p>SRID is a spatial reference identifier that uses <a href="https://epsg.io/" target="_blank">ESPG reference system codes</a> to specify coordinate systems. If SRID is not specified, WGS84 is assumed and parameters are treated as latitude/longitude in degrees.</p>
                                <p>You can use <code>MAKEPOINT</code> to spatially-enable a data source so that it can be joined with a spatial file using a spatial join. For more information, see <a href="https://help.tableau.com/current/pro/desktop/en-us/maps_spatial_join.htm" target="_blank">Join Spatial Files in Tableau</a>.</p>
                            </td>
                        </tr>
                    </tbody>
                </table>

### MAKETIME

<table class="table--plain" style="width: 100%;">
                    <colgroup><col style="width: 20%;">
                    <col>
                    </colgroup><tbody>
                        <tr>
                            <td>Syntax</td>
                            <td><code>MAKETIME(hour, minute, second)</code>
                            </td>
                        </tr>
                        <tr>
                            <td>Output</td>
                            <td>Datetime</td>
                        </tr>
                        <tr>
                            <td>Definition</td>
                            <td>Returns a date value constructed from the specified <code>&lt;hour&gt;</code>, <code>&lt;minute&gt;</code>, and <code>&lt;second&gt;</code>.</td>
                        </tr>
                        <tr>
                            <td>Example</td>
                            <td><pre>MAKETIME(14, 52, 40) = #1/1/1899 14:52:40#</pre>
                            </td>
                        </tr>
                        <tr>
                            <td>Notes</td>
                            <td>
                                <p>Because Tableau does not support a time data type, only datetime, the output is a datetime. The date portion of the field will be 1/1/1899.</p>
                                <p>Similar function to <code><a href="#MAKEDATETIME" class="xref">MAKEDATETIME</a></code>, which is only available for MYSQL-compatible connections.</p>
                            </td>
                        </tr>
                    </tbody>
                </table>

### MAX

<table class="table--plain" style="width: 100%;">
                    <colgroup><col style="width: 20%;">
                    <col>
                    </colgroup><tbody>
                        <tr>
                            <td>Syntax</td>
                            <td><code>MAX(expression)</code> or <code>MAX(expr1, expr2)</code></td>
                        </tr>
                        <tr>
                            <td>Output</td>
                            <td>Same data type as the argument, or <code>NULL&nbsp;</code>if any part of the argument is null. </td>
                        </tr>
                        <tr>
                            <td>Definition</td>
                            <td>
                                <p>Returns the maximum of the two arguments, which must be of the same data type. </p>
                                <p><code>MAX</code> can also be applied to a single field as an aggregation.</p>
                            </td>
                        </tr>
                        <tr>
                            <td>Example</td>
                            <td><pre>MAX(4,7) = 7<br>MAX(#3/25/1986#, #2/20/2021#) = #2/20/2021# <br>MAX([Name]) = "Zander"</pre>
                            </td>
                        </tr>
                        <tr>
                            <td>Notes</td>
                            <td>
                                <p><b>For strings</b>
                                </p>
                                <p><code>MAX</code> is usually the value that comes last in alphabetical order. </p>
                                <p class="note">For database data sources, the <code>MAX</code> string value is highest in the sort sequence defined by the database for that column.</p>
                                <p><b>For dates</b>
                                </p>
                                <p>For dates, the <code>MAX</code> is the most recent date. If <code>MAX</code> is an aggregation, the result will not have a date hierarchy. If <code>MAX</code> is a comparison, the result will retain the date hierarchy. </p>
                                <p><b>As an aggregation</b>
                                </p>
                                <p><code>MAX(expression)</code> is an aggregate function and returns a single aggregated result. This displays as <code>AGG(expression)</code> in the viz. </p>
                                <p><b>As a comparison</b>
                                </p>
                                <p><code>MAX(expr1, expr2)</code> compares the two values and returns a row-level value.</p>
                                <p>See also <code><a href="#MIN" class="xref">MIN</a></code>.</p>
                            </td>
                        </tr>
                    </tbody>
                </table>

### MEDIAN

<table class="table--plain" style="width: 100%;">
                    <colgroup><col style="width: 20%;">
                    <col>
                    </colgroup><tbody>
                        <tr>
                            <td>Syntax</td>
                            <td><code>MEDIAN(expression)</code>
                            </td>
                        </tr>
                        <tr>
                            <td>Definition</td>
                            <td>Returns the median of an expression across all records. Null values are ignored.</td>
                        </tr>
                        <tr>
                            <td>Notes</td>
                            <td><code>MEDIAN</code> can only be used with numeric fields. </td>
                        </tr>
                        <tr>
                            <td>Database limitations</td>
                            <td>
                                <p><code>MEDIAN</code> is <b>not</b> available for the following data sources: Access, Amazon Redshift, Cloudera Hadoop, HP Vertica, IBM DB2, IBM PDA (Netezza), Microsoft SQL Server, MySQL, SAP HANA, Teradata.</p>
                                <p>For other data source types, you can extract your data into an extract file to use this function. See <a href="https://help.tableau.com/current/pro/desktop/en-us/extracting_data.htm" target="_blank">Extract Your Data</a>.</p>
                            </td>
                        </tr>
                    </tbody>
                </table>

### MID

<table class="table--plain" style="width: 100%;">
                    <colgroup><col style="width: 20%;">
                    <col>
                    </colgroup><tbody>
                        <tr>
                            <td>Syntax</td>
                            <td><code>(MID(string, start, [length])</code>
                            </td>
                        </tr>
                        <tr>
                            <td>Output</td>
                            <td>String</td>
                        </tr>
                        <tr>
                            <td>Definition</td>
                            <td>
                                <p>Returns a string starting at the specified <code>&lt;start&gt;</code> position. The first character in the string is position 1. </p>
                                <p>If the optional numeric argument <code>&lt;length&gt;</code> is added, the returned string includes only that number of characters.</p>
                            </td>
                        </tr>
                        <tr>
                            <td>Example</td>
                            <td><pre>MID("Calculation", 2) = "alculation"</pre><pre>MID("Calculation", 2, 5) ="alcul"</pre>
                            </td>
                        </tr>
                        <tr>
                            <td>Notes</td>
                            <td>See also the supported RegEx in the <a href="https://help.tableau.com/current/pro/desktop/en-us/functions_functions_additional.htm" target="_blank">additional functions documentation</a>. </td>
                        </tr>
                    </tbody>
                </table>

### MIN

<table class="table--plain" style="width: 100%;">
                    <colgroup><col style="width: 20%;">
                    <col>
                    </colgroup><tbody>
                        <tr>
                            <td>Syntax</td>
                            <td><code>MIN(expression)</code> or <code>MIN(expr1, expr2)</code></td>
                        </tr>
                        <tr>
                            <td>Output</td>
                            <td>Same data type as the argument, or <code>NULL&nbsp;</code>if any part of the argument is null. </td>
                        </tr>
                        <tr>
                            <td>Definition</td>
                            <td>
                                <p>Returns the minimum of the two arguments, which must be of the same data type. </p>
                                <p><code>MIN </code>can also be applied to a single field as an aggregation.</p>
                            </td>
                        </tr>
                        <tr>
                            <td>Example</td>
                            <td><pre>MIN(4,7) = 4<br>MIN(#3/25/1986#, #2/20/2021#) = #3/25/1986#<br>MIN([Name]) = "Abebi"</pre>
                            </td>
                        </tr>
                        <tr>
                            <td>Notes</td>
                            <td>
                                <p><b>For strings</b>
                                </p>
                                <p><code>MIN</code> is usually the value that comes first in alphabetical order. </p>
                                <p class="note">For database data sources, the <code>MIN</code> string value is lowest in the sort sequence defined by the database for that column.</p>
                                <p><b>For dates</b>
                                </p>
                                <p>For dates, the <code>MIN</code> is the earliest date. If <code>MIN</code> is an aggregation, the result will not have a date hierarchy. If <code>MIN</code> is a comparison, the result will retain the date hierarchy. </p>
                                <p><b>As an aggregation</b>
                                </p>
                                <p><code>MIN(expression)</code> is an aggregate function and returns a single aggregated result. This displays as <code>AGG(expression)</code> in the viz. </p>
                                <p><b>As a comparison</b>
                                </p>
                                <p><code>MIN(expr1, expr2)</code> compares the two values and returns a row-level value.</p>
                                <p>See also <code><a href="#MAX" class="xref">MAX</a></code>.</p>
                            </td>
                        </tr>
                    </tbody>
                </table>

### Model Extensions

For more information, see [Table Calculation Functions](https://help.tableau.com/current/pro/desktop/en-us/functions_functions_tablecalculation.htm).

- MODEL\_EXTENSION\_BOOL
- MODEL\_EXTENSION\_INT
- MODEL\_EXTENSION\_REAL
- MODEL\_EXTENSION\_STR

### MODEL\_PERCENTILE

<table class="table--plain" style="width: 100%;">
                    <colgroup><col style="width: 20%;">
                    <col>
                    </colgroup><tbody>
                        <tr>
                            <td>Syntax</td>
                            <td><code>MODEL_PERCENTILE(
							<br>model_specification (optional),
							<br>target_expression,
						<br>predictor_expression(s))</code>
                            </td>
                        </tr>
                        <tr>
                            <td>Definition</td>
                            <td>Returns the probability (between 0 and 1) of the expected value being less than or equal to the observed mark, defined by the target expression and other predictors. This is the Posterior Predictive Distribution Function, also known as the Cumulative Distribution Function (CDF).</td>
                        </tr>
                        <tr>
                            <td>Example</td>
                            <td><pre>MODEL_PERCENTILE( SUM([Sales]),COUNT([Orders]))</pre>
                            </td>
                        </tr>
                    </tbody>
                </table>

### MODEL\_QUANTILE

<table class="table--plain" style="width: 100%;">
                    <colgroup><col style="width: 20%;">
                    <col>
                    </colgroup><tbody>
                        <tr>
                            <td>Syntax</td>
                            <td><code>MODEL_QUANTILE(
							<br>model_specification (optional), 
							<br>quantile, 
							<br>target_expression,
						<br>predictor_expression(s))</code>
                            </td>
                        </tr>
                        <tr>
                            <td>Definition</td>
                            <td>Returns a target numeric value within the probable range defined by the target expression and other predictors, at a specified quantile. This is the Posterior Predictive Quantile.
					</td>
                        </tr>
                        <tr>
                            <td>Example</td>
                            <td><pre>MODEL_QUANTILE(0.5, SUM([Sales]), COUNT([Orders]))</pre>
                            </td>
                        </tr>
                    </tbody>
                </table>

### MONTH

<table class="table--plain" style="width: 100%;">
                    <colgroup><col style="width: 20%;">
                    <col>
                    </colgroup><tbody>
                        <tr>
                            <td>Syntax</td>
                            <td><code>MONTH(date)</code>
                            </td>
                        </tr>
                        <tr>
                            <td>Output</td>
                            <td>Integer</td>
                        </tr>
                        <tr>
                            <td>Definition</td>
                            <td>Returns the month of the given <code>&lt;date&gt;</code> as an integer.</td>
                        </tr>
                        <tr>
                            <td>Example</td>
                            <td><pre>MONTH(#1986-03-25#) = 3</pre>
                            </td>
                        </tr>
                        <tr>
                            <td>Notes</td>
                            <td>See also <code><a href="#DAY" class="xref">DAY</a></code>, <code><a href="#WEEK" class="xref">WEEK</a></code>, <code><a href="#QUARTER" class="xref">Quarter</a></code>, <code><a href="#YEAR" class="xref">YEAR</a></code>, and the ISO equivalents</td>
                        </tr>
                    </tbody>
                </table>

[back to top](#top)

## N

### NOT

<table class="table--plain" style="width: 100%;">
                    <colgroup><col style="width: 20%;">
                    <col>
                    </colgroup><tbody>
                        <tr>
                            <td>Syntax</td>
                            <td><code>NOT&nbsp;&lt;expression&gt;</code>
                            </td>
                        </tr>
                        <tr>
                            <td>Output</td>
                            <td>Boolean (true or false)</td>
                        </tr>
                        <tr>
                            <td>Definition</td>
                            <td>Performs logical negation on an expression.</td>
                        </tr>
                        <tr>
                            <td>Example</td>
                            <td><pre>IF <b>NOT</b> [Season] = "Summer" <br>THEN 'Don't wear sandals' <br>ELSE&nbsp;'Wear sandals'&nbsp;<br><b>END</b></pre>
                                <p><i>"If Season doesn't equal Summer, then return </i>Don't wear sandals<i>. If not,  return </i>Wear sandals<i>."</i></p>
                            </td>
                        </tr>
                        <tr>
                            <td>Notes</td>
                            <td>
                                <p>Often used with <a href="#IF" class="xref">IF</a> and <a href="#IIF" class="xref">IIF</a>. See also <a href="#top" class="xref">The Tableau functions in this reference are organized alphabetically. Click a letter to jump to that location in the list. You can also use Ctrl+F (Command-F on a Mac) to open a search box to look for a specific function.</a> and <a href="#OR" class="xref">OR</a>.</p>
                            </td>
                        </tr>
                    </tbody>
                </table>

### NOW

<table class="table--plain" style="width: 100%;">
                    <colgroup><col style="width: 20%;">
                    <col>
                    </colgroup><tbody>
                        <tr>
                            <td>Syntax</td>
                            <td><code>NOW()</code>
                            </td>
                        </tr>
                        <tr>
                            <td>Output</td>
                            <td>Datetime</td>
                        </tr>
                        <tr>
                            <td>Definition</td>
                            <td>Returns the current local system date and time. </td>
                        </tr>
                        <tr>
                            <td>Example</td>
                            <td><pre>NOW() = 1986-03-25 1:08:21 PM</pre>
                            </td>
                        </tr>
                        <tr>
                            <td>Notes</td>
                            <td>
                                <p><code>NOW</code> does not take an argument. </p>
                                <p>See also <code><a href="#TODAY" class="xref">TODAY</a></code>, a similar calculation that returns a date instead of a datetime. 
						</p>
                                <p>
						If the data source is a live connection, the system date and time could be in another timezone. For more information on how to address this, see <a href="https://kb.tableau.com/articles/issue/now-function-returns-utc-time">the Knowledge Base</a>. </p>
                            </td>
                        </tr>
                    </tbody>
                </table>

[back to top](#top)

## O

### OR

<table class="table--plain" style="width: 100%;">
                    <colgroup><col style="width: 20%;">
                    <col>
                    </colgroup><tbody>
                        <tr>
                            <td>Syntax</td>
                            <td><code>&lt;expr1&gt; OR &lt;expr2&gt;</code>
                            </td>
                        </tr>
                        <tr>
                            <td>Output</td>
                            <td>Boolean (true or false)</td>
                        </tr>
                        <tr>
                            <td>Definition</td>
                            <td>Performs a logical disjunction on two expressions.</td>
                        </tr>
                        <tr>
                            <td>Example</td>
                            <td><pre>IF [Season] = "Spring"&nbsp;<b>OR</b>&nbsp;[Season] = "Fall" <br>THEN&nbsp;"Sneakers" <br>END</pre>
                                <p><i>"If either (Season = Spring)&nbsp;or (Season = Fall)&nbsp;is true, then return Sneakers."</i>
                                </p>
                            </td>
                        </tr>
                        <tr>
                            <td>Notes</td>
                            <td>
                                <p>Often used with <a href="#IF" class="xref">IF</a> and <a href="#IIF" class="xref">IIF</a>. See also <a href="#top" class="xref">The Tableau functions in this reference are organized alphabetically. Click a letter to jump to that location in the list. You can also use Ctrl+F (Command-F on a Mac) to open a search box to look for a specific function.</a> and <a href="#NOT" class="xref">NOT</a>.</p>
                                <p>If either expression
							is <code>TRUE</code>, then the result is <code>TRUE</code>.
							If both expressions are <code>FALSE</code>, then the result
							is <code>FALSE</code>. If both expressions are <code>NULL</code>,
						then the result is <code>NULL</code>. </p>
                                <p>If you create
							a calculation which displays the result of an <code>OR</code> comparison
							on a worksheet, Tableau displays <code>TRUE</code>and <code>FALSE</code>. If
							you would like to change this, use the Format area in the format
						dialog. </p>
                                <p class="note"><b>Note</b>:&nbsp;The <code>OR</code> operator employs <em>short circuit
							evaluation.</em> This means that if the first expression is evaluated
							to be <code>TRUE</code>, then the second expression is not evaluated
							at all. This can be helpful if the second expression results in
							an error when the first expression is <code>TRUE</code>, because
						the second expression in this case is never evaluated.</p>
                            </td>
                        </tr>
                    </tbody>
                </table>

### OUTLINE

<table class="table--plain" style="width: 100%;">
                    <colgroup><col style="width: 20%;">
                    <col>
                    </colgroup><tbody>
                        <tr>
                            <td>Syntax</td>
                            <td><code>OUTLINE(&lt;spatial polygon&gt;)</code>
                            </td>
                        </tr>
                        <tr>
                            <td>Output</td>
                            <td>Geometry</td>
                        </tr>
                        <tr>
                            <td>Definition</td>
                            <td>Converts a polygon geometry into linestrings. </td>
                        </tr>
                        <tr>
                            <td>Notes</td>
                            <td>
                                <p>Useful for creating a separate layer for an outline that can be styled differently than the fill.</p>
                                <p>Supports polygons within multipolygons.</p>
                            </td>
                        </tr>
                    </tbody>
                </table>

[back to top](#top)

## P

### PARSE\_URL

`PARSE_URL(string, url_part)`

Only supported when connected to Cloudera Impala. For more information, see [Additional Functions](https://help.tableau.com/current/pro/desktop/en-us/functions_functions_additional.htm).

### PARSE\_URL\_QUERY

`PARSE_URL_QUERY(string, key)`

Only supported when connected to Cloudera Impala. For more information, see [Additional Functions](https://help.tableau.com/current/pro/desktop/en-us/functions_functions_additional.htm).

### PERCENTILE

<table class="table--plain" style="width: 100%;">
                    <colgroup><col style="width: 20%;">
                    <col>
                    </colgroup><tbody>
                        <tr>
                            <td>Syntax</td>
                            <td><code>PERCENTILE(expression, number)</code>
                            </td>
                        </tr>
                        <tr>
                            <td>Definition</td>
                            <td>Returns the percentile value from the given <code>&lt;expression&gt;</code> corresponding to the specified <code>&lt;number&gt;</code>. The <code>&lt;number&gt;</code> must be between 0 and 1 (inclusive) and must be a numeric constant.</td>
                        </tr>
                        <tr>
                            <td>Example</td>
                            <td><pre>PERCENTILE([Score], 0.9)</pre>
                            </td>
                        </tr>
                        <tr>
                            <td>Database limitations</td>
                            <td>
                                <p>This function is available for the following data sources:&nbsp;Non-legacy Microsoft Excel and Text File connections, Extracts and extract-only data source types (for example, Google Analytics, OData, or Salesforce), Sybase IQ 15.1 and later data sources, Oracle 10 and later data sources, Cloudera Hive and Hortonworks Hadoop Hive data sources, EXASolution 4.2 and later data sources.</p>
                                <p>For other data source types, you can extract your data into an extract file to use this function. See <a href="https://help.tableau.com/current/pro/desktop/en-us/extracting_data.htm" target="_blank">Extract Your Data</a>.</p>
                            </td>
                        </tr>
                    </tbody>
                </table>

### PI

<table class="table--plain" style="width: 100%;">
                    <colgroup><col style="width: 20%;">
                    <col>
                    </colgroup><tbody>
                        <tr>
                            <td>Syntax</td>
                            <td><code>PI()</code>
                            </td>
                        </tr>
                        <tr>
                            <td>Output</td>
                            <td>Number</td>
                        </tr>
                        <tr>
                            <td>Definition</td>
                            <td>Returns the numeric constant pi: 3.14159...</td>
                        </tr>
                        <tr>
                            <td>Example</td>
                            <td><pre>PI()&nbsp;= 3.14159</pre>
                            </td>
                        </tr>
                        <tr>
                            <td>Notes</td>
                            <td>Useful for trig functions that take their input in radians. </td>
                        </tr>
                    </tbody>
                </table>

### POWER

<table class="table--plain" style="width: 100%;">
                    <colgroup><col style="width: 20%;">
                    <col>
                    </colgroup><tbody>
                        <tr>
                            <td>Syntax</td>
                            <td><code>POWER(number, power)</code>
                            </td>
                        </tr>
                        <tr>
                            <td>Output</td>
                            <td>Number</td>
                        </tr>
                        <tr>
                            <td>Definition</td>
                            <td>Raises the <code>&lt;number&gt;</code> to the specified <code>&lt;power&gt;</code>.</td>
                        </tr>
                        <tr>
                            <td>Example</td>
                            <td><pre>POWER(5,3) = 125<br>POWER([Temperature], 2)</pre>
                            </td>
                        </tr>
                        <tr>
                            <td>Notes</td>
                            <td>You can also use the ^ symbol, such as <code>5^3 = POWER(5,3) = 125</code><p>See also <code><a href="#EXP" class="xref">EXP</a></code>, <code><a href="#LOG" class="xref">LOG</a></code>, and <code><a href="#SQUARE" class="xref">SQUARE</a></code>.</p></td>
                        </tr>
                    </tbody>
                </table>

### PREVIOUS\_VALUE

`PREVIOUS_VALUE(expression)`

For more information, see [Table Calculation Functions](https://help.tableau.com/current/pro/desktop/en-us/functions_functions_tablecalculation.htm).

### PROPER

<table class="table--plain" style="width: 100%;">
                    <colgroup><col style="width: 20%;">
                    <col>
                    </colgroup><tbody>
                        <tr>
                            <td>Syntax</td>
                            <td><code>PROPER(string)</code>
                            </td>
                        </tr>
                        <tr>
                            <td>Output</td>
                            <td>String</td>
                        </tr>
                        <tr>
                            <td>Definition</td>
                            <td>
                                <p>Returns the provided <code>&lt;string&gt;</code> with the first letter of each word is capitalized and the remaining letters are in lowercase. </p>
                            </td>
                        </tr>
                        <tr>
                            <td>Example</td>
                            <td><pre>PROPER("PRODUCT name") = "Product Name"</pre><pre>PROPER("darcy-mae") = "Darcy-Mae"</pre>
                            </td>
                        </tr>
                        <tr>
                            <td>Notes</td>
                            <td>
                                <p>Spaces and non-alphanumeric characters such as punctuation are treated as separators.</p>
                                <p>See also <a href="#LOWER" class="xref">LOWER</a> and <a href="#UPPER" class="xref">UPPER</a>.</p>
                            </td>
                        </tr>
                    </tbody>
                </table>

[back to top](#top)

## Q

### Quarter

<table class="table--plain" style="width: 100%;">
                    <colgroup><col style="width: 20%;">
                    <col>
                    </colgroup><tbody>
                        <tr>
                            <td>Syntax</td>
                            <td><code>QUARTER(date)</code>
                            </td>
                        </tr>
                        <tr>
                            <td>Output</td>
                            <td>Integer</td>
                        </tr>
                        <tr>
                            <td>Definition</td>
                            <td>Returns the quarter of the given <code>&lt;date&gt;</code> as an integer.</td>
                        </tr>
                        <tr>
                            <td>Example</td>
                            <td><pre>QUARTER(#1986-03-25#) = 1</pre>
                            </td>
                        </tr>
                        <tr>
                            <td>Notes</td>
                            <td>See also <code><a href="#DAY" class="xref">DAY</a></code>, 
					<code><a href="#WEEK" class="xref">WEEK</a></code>, <code><a href="#MONTH" class="xref">MONTH</a></code>, <code><a href="#YEAR" class="xref">YEAR</a></code>, and the ISO equivalents</td>
                        </tr>
                    </tbody>
                </table>

[back to top](#top)

## R

### RADIANS

<table class="table--plain" style="width: 100%;">
                    <colgroup><col style="width: 20%;">
                    <col>
                    </colgroup><tbody>
                        <tr>
                            <td>Syntax</td>
                            <td><code>RADIANS(number)</code>
                            </td>
                        </tr>
                        <tr>
                            <td>Output</td>
                            <td>Number (angle in radians)</td>
                        </tr>
                        <tr>
                            <td>Definition</td>
                            <td>Converts the given <code>&lt;number&gt;</code> from degrees to radians.</td>
                        </tr>
                        <tr>
                            <td>Example</td>
                            <td><pre>RADIANS(180) = 3.14159</pre>
                            </td>
                        </tr>
                        <tr>
                            <td>Notes</td>
                            <td>The inverse function, <code><a href="#DEGREES" class="xref">DEGREES</a></code>, takes an angle in radians and returns the angle in degrees.</td>
                        </tr>
                    </tbody>
                </table>

### RANK Table Calculation functions

For more information, see [Table Calculation Functions](https://help.tableau.com/current/pro/desktop/en-us/functions_functions_tablecalculation.htm).

- `RANK(expression, ['asc' | 'desc'])`
- `RANK_DENSE(expression, ['asc' | 'desc'])`
- `RANK_MODIFIED(expression, ['asc' | 'desc'])`
- `RANK_PERCENTILE(expression, ['asc' | 'desc'])`
- `RANK_UNIQUE(expression, ['asc' | 'desc'])`

### RAWSQL functions

For more information, see [Pass-Through Functions (RAWSQL)](https://help.tableau.com/current/pro/desktop/en-us/functions_functions_passthrough.htm).

- `RAWSQL_BOOL("sql_expr", [arg1], … [argN])`
- `RAWSQL_DATE("sql_expr", [arg1], … [argN])`
- `RAWSQL_DATETIME("sql_expr", [arg1], … [argN])`
- `RAWSQL_INT("sql_expr", [arg1], … [argN])`
- `RAWSQL_REAL("sql_expr", [arg1], … [argN])`
- `RAWSQL_SPATIAL`
- `RAWSQL_STR("sql_expr", [arg1], … [argN])`
- `RAWSQLAGG_BOOL("sql_expr", [arg1], … [argN])`
- `RAWSQLAGG_DATE("sql_expr", [arg1], … [argN])`
- `RAWSQLAGG_DATETIME("sql_expr", [arg1], … [argN])`
- `RAWSQLAGG_INT("sql_expr", [arg1], … [argN])`
- `RAWSQLAGG_REAL("sql_expr", [arg1], … [argN])`
- `RAWSQLAGG_STR("sql_expr", [arg1], … [argN])`

### REGEXP functions

For more information, see [Additional Functions](https://help.tableau.com/current/pro/desktop/en-us/functions_functions_additional.htm).

- `REGEXP_EXTRACT(string, pattern)`
- `REGEXP_EXTRACT_NTH(string, pattern, index)`
- `REGEXP_EXTRACT_NTH(string, pattern, index)`
- `REGEXP_MATCH(string, pattern)`
- `REGEXP_REPLACE(string, pattern, replacement)`

### REPLACE

<table class="table--plain" style="width: 100%;">
                    <colgroup><col style="width: 20%;">
                    <col>
                    </colgroup><tbody>
                        <tr>
                            <td>Syntax</td>
                            <td><code>REPLACE(string, substring, replacement</code>
                            </td>
                        </tr>
                        <tr>
                            <td>Output</td>
                            <td>String</td>
                        </tr>
                        <tr>
                            <td>Definition</td>
                            <td>Searches <code>&lt;string&gt;</code> for <code>&lt;substring&gt;</code> and replaces it with <code>&lt;replacement&gt;</code>. If <code>&lt;substring&gt;</code> is not found, the string is not changed.</td>
                        </tr>
                        <tr>
                            <td>Example</td>
                            <td><pre>REPLACE("Version 3.8", "3.8", "4x") = "Version 4x"</pre>
                            </td>
                        </tr>
                        <tr>
                            <td>Notes</td>
                            <td>See also <code>REGEXP_REPLACE</code> in the <a href="https://help.tableau.com/current/pro/desktop/en-us/functions_functions_additional.htm" target="_blank">additional functions documentation</a>. </td>
                        </tr>
                    </tbody>
                </table>

### RIGHT

<table class="table--plain" style="width: 100%;">
                    <colgroup><col style="width: 20%;">
                    <col>
                    </colgroup><tbody>
                        <tr>
                            <td>Syntax</td>
                            <td><code>RIGHT(string, number)</code>
                            </td>
                        </tr>
                        <tr>
                            <td>Output</td>
                            <td>String</td>
                        </tr>
                        <tr>
                            <td>Definition</td>
                            <td>Returns the right-most <code>&lt;number&gt;</code> of characters in the string.</td>
                        </tr>
                        <tr>
                            <td>Example</td>
                            <td><pre>RIGHT("Calculation", 4) = "tion"</pre>
                            </td>
                        </tr>
                        <tr>
                            <td>Notes</td>
                            <td>See also <a href="#LEFT" class="xref">LEFT</a> and <a href="#MID" class="xref">MID</a>.</td>
                        </tr>
                    </tbody>
                </table>

### ROUND

<table class="table--plain" style="width: 100%;">
                    <colgroup><col style="width: 20%;">
                    <col>
                    </colgroup><tbody>
                        <tr>
                            <td>Syntax</td>
                            <td><code>ROUND(number, [decimals])</code>
                            </td>
                        </tr>
                        <tr>
                            <td>Output</td>
                            <td>Number</td>
                        </tr>
                        <tr>
                            <td>Definition</td>
                            <td>
                                <p>Rounds the <code>&lt;number&gt;</code> to a specified number of digits. </p>
                                <p>The optional <code>decimals</code> argument specifies how many decimal points of precision to include in the final result. If <code>decimals</code> is omitted, number is rounded to the nearest integer.</p>
                            </td>
                        </tr>
                        <tr>
                            <td>Example</td>
                            <td><pre>ROUND(1/3, 2) = 0.33</pre>
                            </td>
                        </tr>
                        <tr>
                            <td>Notes</td>
                            <td>
                                <p>Some databases, such as SQL Server, allow specification of a negative length, where -1 rounds number to the tens place, -2 rounds to the hundreds place, and so on. This is not true of all databases. For example, it is not true of Excel or Access.</p>
                                <blockquote><p>[!TIP]</p><p>Because ROUND may run into issues due to the underlying floating point representation of numbers—such as 9.405 rounding to 9.40—it may be preferable to <a href="https://help.tableau.com/current/pro/desktop/en-us/formatting_specific_numbers.htm">format the number</a> to the desired number of decimal points rather than rounding. Formatting 9.405 to two decimal places will yield the expected 9.41.</p></blockquote>
                                <p>See also <code><a href="#CEILING" class="xref">CEILING</a></code> and <code><a href="#FLOOR" class="xref">FLOOR</a></code>.</p>
                            </td>
                        </tr>
                    </tbody>
                </table>

### RTRIM

<table class="table--plain" style="width: 100%;">
                    <colgroup><col style="width: 20%;">
                    <col>
                    </colgroup><tbody>
                        <tr>
                            <td>Syntax</td>
                            <td><code>RTRIM(string)</code>
                            </td>
                        </tr>
                        <tr>
                            <td>Output</td>
                            <td>String</td>
                        </tr>
                        <tr>
                            <td>Definition</td>
                            <td>Returns the provided <code>&lt;string&gt;</code> with any trailing spaces removed.</td>
                        </tr>
                        <tr>
                            <td>Example</td>
                            <td><pre>RTRIM(" Calculation ") = " Calculation"</pre>
                            </td>
                        </tr>
                        <tr>
                            <td>Notes</td>
                            <td>See also <a href="#LTRIM" class="xref">LTRIM</a> and <a href="#TRIM" class="xref">TRIM</a>.</td>
                        </tr>
                    </tbody>
                </table>

### RTRIM\_THIS

`RTRIM_THIS(string, string)`

Only supported when connected to Google BigQuery. For more information, see [Additional Functions](https://help.tableau.com/current/pro/desktop/en-us/functions_functions_additional.htm).

### RUNNING Table Calculation functions

For more information, see [Table Calculation Functions](https://help.tableau.com/current/pro/desktop/en-us/functions_functions_tablecalculation.htm).

- `RUNNING_AVG(expression)`
- `RUNNING_COUNT(expression)`
- `RUNNING_MAX(expression)`
- `RUNNING_MIN(expression)`
- `RUNNING_SUM(expression)`

[back to top](#top)

## S

### SCRIPT Analytics Extensions

For more information, see [Table Calculation Functions](https://help.tableau.com/current/pro/desktop/en-us/functions_functions_tablecalculation.htm).

- `SCRIPT_BOOL`
- `SCRIPT_INT`
- `SCRIPT_REAL`
- `SCRIPT_STR`

### SHAPETYPE

<table class="table--plain" style="width: 100%;">
                    <colgroup><col style="width: 20%;">
                    <col>
                    </colgroup><tbody>
                        <tr>
                            <td>Syntax</td>
                            <td><code>SHAPETYPE(&lt;geometry&gt;)</code>
                            </td>
                        </tr>
                        <tr>
                            <td>Output</td>
                            <td>String</td>
                        </tr>
                        <tr>
                            <td>Definition</td>
                            <td>Returns a string describing the structure of the spatial geometry, such as Empty, Point, MultiPoint, LineString, MultiLinestring, Polygon, MultiPolygon, Mixed, and unsupported</td>
                        </tr>
                        <tr>
                            <td>Example</td>
                            <td><pre>SHAPETYPE(MAKEPOINT(48.5, -123.1)) = "Point"</pre>
                            </td>
                        </tr>
                    </tbody>
                </table>

### SIGN

<table class="table--plain" style="width: 100%;">
                    <colgroup><col style="width: 20%;">
                    <col>
                    </colgroup><tbody>
                        <tr>
                            <td>Syntax</td>
                            <td><code>SIGN(number)</code>
                            </td>
                        </tr>
                        <tr>
                            <td>Output</td>
                            <td>-1, 0, or 1</td>
                        </tr>
                        <tr>
                            <td>Definition</td>
                            <td>Returns the sign of a <code>&lt;number&gt;</code>: The possible return values are -1 if the number is negative, 0 if the number is zero, or 1 if the number is positive.</td>
                        </tr>
                        <tr>
                            <td>Example</td>
                            <td><pre>SIGN(AVG(Profit)) = -1</pre>
                            </td>
                        </tr>
                        <tr>
                            <td>Notes</td>
                            <td>See also <code><a href="#ABS" class="xref">ABS</a></code>.</td>
                        </tr>
                    </tbody>
                </table>

### SIN

<table class="table--plain" style="width: 100%;">
                    <colgroup><col style="width: 20%;">
                    <col>
                    </colgroup><tbody>
                        <tr>
                            <td>Syntax</td>
                            <td><code>SIN(number)</code>
                            </td>
                        </tr>
                        <tr>
                            <td>Output</td>
                            <td>Number</td>
                        </tr>
                        <tr>
                            <td>Definition</td>
                            <td>Returns the sine of an angle  in radians.</td>
                        </tr>
                        <tr>
                            <td>Example</td>
                            <td><pre>SIN(0) = 1.0<br>SIN(PI( )/4) = 0.707106781186548</pre>
                            </td>
                        </tr>
                        <tr>
                            <td>Notes</td>
                            <td>
                                <p>The inverse function, <code><a href="#ASIN" class="xref">ASIN</a></code>, takes the sine as the argument and returns the angle in radians. </p>
                                <p>See also <code><a href="#PI" class="xref">PI</a></code>. To convert an angle from degrees to radians, use <code><a href="#RADIANS" class="xref">RADIANS</a></code>.</p>
                            </td>
                        </tr>
                    </tbody>
                </table>

### SIZE

`SIZE()`

For more information, see [Table Calculation Functions](https://help.tableau.com/current/pro/desktop/en-us/functions_functions_tablecalculation.htm).

### SPACE

<table class="table--plain" style="width: 100%;">
                    <colgroup><col style="width: 20%;">
                    <col>
                    </colgroup><tbody>
                        <tr>
                            <td>Syntax</td>
                            <td><code>SPACE(number)</code>
                            </td>
                        </tr>
                        <tr>
                            <td>Output</td>
                            <td>String (specifically, just spaces)</td>
                        </tr>
                        <tr>
                            <td>Definition</td>
                            <td>Returns a string that is composed of the specified number of repeated spaces.</td>
                        </tr>
                        <tr>
                            <td>Example</td>
                            <td><pre>SPACE(2) = "  "</pre>
                            </td>
                        </tr>
                    </tbody>
                </table>

### SPLIT

<table class="table--plain" style="width: 100%;">
                    <colgroup><col style="width: 20%;">
                    <col>
                    </colgroup><tbody>
                        <tr>
                            <td>Syntax</td>
                            <td><code>SPLIT(string, delimiter, token number)</code>
                            </td>
                        </tr>
                        <tr>
                            <td>Output</td>
                            <td>String</td>
                        </tr>
                        <tr>
                            <td>Definition</td>
                            <td>Returns a substring from a <code>&lt;string&gt;</code>, using a <code>&lt;delimiter&gt;</code> character to divide the string into a sequence of <code>&lt;tokens&gt;</code>.</td>
                        </tr>
                        <tr>
                            <td>Example</td>
                            <td><pre>SPLIT ("a-b-c-d", "-", 2) = "b"</pre><pre>SPLIT ("a|b|c|d", "|", -2) = "c"</pre>
                            </td>
                        </tr>
                        <tr>
                            <td>Notes</td>
                            <td>
                                <p>The string is interpreted as an alternating sequence of delimiters and tokens. So for the string <code>abc-defgh-i-jkl</code>, where the delimiter character is '<code>-</code>', the tokens are (1) <code>abc</code>, (2) <code>defgh</code>, (3) <code>i</code>, and (4) <code>jlk</code>.</p>
                                <p><code>SPLIT</code> returns the token corresponding to the token number. When the token number is positive, tokens are counted starting from the left end of the string; when the token number is negative, tokens are counted starting from the right.</p>
                                <p>See also supported REGEX in the <a href="https://help.tableau.com/current/pro/desktop/en-us/functions_functions_additional.htm" target="_blank">additional functions documentation</a>. </p>
                            </td>
                        </tr>
                        <tr>
                            <td>Database limitations</td>
                            <td>
                                <p>The split and custom split commands are available for the following data sources types: Tableau data extracts, Microsoft Excel, Text File, PDF File, Salesforce, OData, Microsoft Azure Market Place, Google Analytics, Vertica, Oracle, MySQL, PostgreSQL, Teradata, Amazon Redshift, Aster Data, Google Big Query, Cloudera Hadoop Hive, Hortonworks Hive, and Microsoft SQL Server.</p>
                                <p>Some data sources impose limits on splitting strings. See SPLIT&nbsp;function limitations later in this topic. </p>
                            </td>
                        </tr>
                    </tbody>
                </table>

### SQRT

<table class="table--plain" style="width: 100%;">
                    <colgroup><col style="width: 20%;">
                    <col>
                    </colgroup><tbody>
                        <tr>
                            <td>Syntax</td>
                            <td><code>SQRT(number)</code>
                            </td>
                        </tr>
                        <tr>
                            <td>Output</td>
                            <td>Number</td>
                        </tr>
                        <tr>
                            <td>Definition</td>
                            <td>Returns the square root of a <code>&lt;number&gt;</code>.</td>
                        </tr>
                        <tr>
                            <td>Example</td>
                            <td><pre>SQRT(25) = 5</pre>
                            </td>
                        </tr>
                        <tr>
                            <td>Notes</td>
                            <td>See also <code><a href="#SQUARE" class="xref">SQUARE</a></code>.</td>
                        </tr>
                    </tbody>
                </table>

### SQUARE

<table class="table--plain" style="width: 100%;">
                    <colgroup><col style="width: 20%;">
                    <col>
                    </colgroup><tbody>
                        <tr>
                            <td>Syntax</td>
                            <td><code>SQUARE(number)</code>
                            </td>
                        </tr>
                        <tr>
                            <td>Output</td>
                            <td>Number</td>
                        </tr>
                        <tr>
                            <td>Definition</td>
                            <td>Returns the square of a <code>&lt;number&gt;</code>. </td>
                        </tr>
                        <tr>
                            <td>Example</td>
                            <td><pre>SQUARE(5) = 25</pre>
                            </td>
                        </tr>
                        <tr>
                            <td>Notes</td>
                            <td>See also <code><a href="#SQRT" class="xref">SQRT</a></code> and <code><a href="#POWER" class="xref">POWER</a></code>.</td>
                        </tr>
                    </tbody>
                </table>

### STARTSWITH

<table class="table--plain" style="width: 100%;">
                    <colgroup><col style="width: 20%;">
                    <col>
                    </colgroup><tbody>
                        <tr>
                            <td>Syntax</td>
                            <td><code>STARTSWITH(string, substring)</code>
                            </td>
                        </tr>
                        <tr>
                            <td>Output</td>
                            <td>Boolean</td>
                        </tr>
                        <tr>
                            <td>Definition</td>
                            <td>Returns true if <code>string</code> starts with <code>substring</code>. Leading white spaces are ignored.</td>
                        </tr>
                        <tr>
                            <td>Example</td>
                            <td><pre xml:space="preserve">STARTSWITH("Matador, "Ma") = TRUE</pre>
                            </td>
                        </tr>
                        <tr>
                            <td>Notes</td>
                            <td>See also <a href="#CONTAINS" class="xref">CONTAINS</a>, as well as supported REGEX in the <a href="https://help.tableau.com/current/pro/desktop/en-us/functions_functions_additional.htm" target="_blank">additional functions documentation</a>. </td>
                        </tr>
                    </tbody>
                </table>

### STDEV

<table class="table--plain" style="width: 100%;"><colgroup><col style="width: 20%;"> <col></colgroup><tbody><tr><td>Syntax</td><td><code>STDEV(expression)</code></td></tr><tr><td>Definition</td><td>Returns the statistical standard deviation of all values in the given <code>&lt;expression&gt;</code> based on a sample of the population.</td></tr></tbody></table>

### STDEVP

<table class="table--plain" style="width: 100%;"><colgroup><col style="width: 20%;"> <col></colgroup><tbody><tr><td>Syntax</td><td><code>STDEVP(expression)</code></td></tr><tr><td>Definition</td><td>Returns the statistical standard deviation of all values in the given <code>&lt;expression&gt;</code> based on a biased population.</td></tr></tbody></table>

### STR

<table class="table--plain" style="width: 100%;">
                    <colgroup><col style="width: 20%;">
                    <col>
                    </colgroup><tbody>
                        <tr>
                            <td>Syntax</td>
                            <td><code>STR(expression)</code>
                            </td>
                        </tr>
                        <tr>
                            <td>Output</td>
                            <td>String</td>
                        </tr>
                        <tr>
                            <td>Definition</td>
                            <td>Casts its argument as a string.</td>
                        </tr>
                        <tr>
                            <td>Example</td>
                            <td><pre>STR([ID])</pre>
                            </td>
                        </tr>
                    </tbody>
                </table>

### SUM

<table class="table--plain" style="width: 100%;"><colgroup><col style="width: 20%;"> <col></colgroup><tbody><tr><td>Syntax</td><td><code>SUM(expression)</code></td></tr><tr><td>Definition</td><td>Returns the sum of all values in the <code>&lt;expression&gt;</code>. Null values are ignored.</td></tr><tr><td>Notes</td><td><code>SUM</code> can only be used with numeric fields.</td></tr></tbody></table>

[back to top](#top)

## T

### TAN

<table class="table--plain" style="width: 100%;">
                    <colgroup><col style="width: 20%;">
                    <col>
                    </colgroup><tbody>
                        <tr>
                            <td>Syntax</td>
                            <td><code>TAN(number)</code>
                                <p>The <code>&lt;number&gt;</code> argument is the angle in radians.</p>
                            </td>
                        </tr>
                        <tr>
                            <td>Output</td>
                            <td>Number</td>
                        </tr>
                        <tr>
                            <td>Definition</td>
                            <td>Returns the tangent of an angle. </td>
                        </tr>
                        <tr>
                            <td>Example</td>
                            <td><pre>TAN(PI ( )/4) = 1.0</pre>
                            </td>
                        </tr>
                        <tr>
                            <td>Notes</td>
                            <td>See also <code><a href="#ATAN" class="xref">ATAN</a></code>, <code><a href="#ATAN2" class="xref">ATAN2</a></code>,<code><a href="#COT" class="xref">COT</a></code>, and <code><a href="#PI" class="xref">PI</a></code>. To convert an angle from degrees to radians, use <code><a href="#RADIANS" class="xref">RADIANS</a></code>.</td>
                        </tr>
                    </tbody>
                </table>

### THEN

<table class="table--plain" style="width: 100%;">
                    <colgroup><col style="width: 20%;">
                    <col>
                    </colgroup><tbody>
                        <tr>
                            <td>Syntax</td>
                            <td><code>IF &lt;test1&gt; <b>THEN</b> &lt;then1&gt; 
							<br>[ELSEIF &lt;test2&gt; <b>THEN</b> &lt;then2&gt;...]
							<br>[ELSE &lt;default&gt;] 
						<br>END</code>
                            </td>
                        </tr>
                        <tr>
                            <td>Definition</td>
                            <td>A required part of an <code>IF</code>, <code>ELSEIF</code>, or <code>CASE</code> expression, used to define what result to return if a specific value or test is true. </td>
                        </tr>
                        <tr>
                            <td>Example</td>
                            <td><pre>IF [Season] = "Summer"&nbsp;<b>THEN</b>&nbsp;'Sandals' <br>ELSEIF&nbsp;[Season] = "Winter"&nbsp;<b>THEN</b>&nbsp;'Boots' <br>ELSE&nbsp;'Sneakers'&nbsp;<br>END</pre>
                                <p><i>"If Season = Summer, then return Sandals. If not, look at the next expression. If Season = Winter, then return Boots. If neither of the expressions are true, return Sneakers."</i> </p><pre>CASE [Season] <br>WHEN 'Summer' <b>THEN</b> 'Sandals' <br>WHEN 'Winter' <b>THEN</b> 'Boots' <br>ELSE 'Sneakers' <br>END</pre>
                                <p><i>"Look at the Season field. If the value is Summer, then return Sandals. If the value is Winter, then return Boots. If none of the options in the calculation match what is in the Season field, return a Sneakers."</i>
                                </p>
                            </td>
                        </tr>
                        <tr>
                            <td>Notes</td>
                            <td>
                                <p>Used with <a href="#CASE" class="xref">CASE</a>, <a href="#WHEN" class="xref">WHEN</a>, <a href="#IF" class="xref">IF</a>, <a href="#ELSEIF" class="xref">ELSEIF</a>, <a href="#THEN" class="xref">THEN</a>, <a href="#ELSE" class="xref">ELSE</a>, and <a href="#END" class="xref">END</a></p>
                            </td>
                        </tr>
                    </tbody>
                </table>

### TIMESTAMP\_TO\_USEC

`TIMESTAMP_TO_USEC(expression)`

Only supported when connected to Google BigQuery. For more information, see [Additional Functions](https://help.tableau.com/current/pro/desktop/en-us/functions_functions_additional.htm).

### TLD

`TLD(string_url)`

Only supported when connected to Google BigQuery. For more information, see [Additional Functions](https://help.tableau.com/current/pro/desktop/en-us/functions_functions_additional.htm).

### TODAY

<table class="table--plain" style="width: 100%;">
                    <colgroup><col style="width: 20%;">
                    <col>
                    </colgroup><tbody>
                        <tr>
                            <td>Syntax</td>
                            <td><code>TODAY()</code>
                            </td>
                        </tr>
                        <tr>
                            <td>Output</td>
                            <td>Date</td>
                        </tr>
                        <tr>
                            <td>Definition</td>
                            <td>Returns the current local system date.</td>
                        </tr>
                        <tr>
                            <td>Example</td>
                            <td><pre>TODAY() = 1986-03-25</pre>
                            </td>
                        </tr>
                        <tr>
                            <td>Notes</td>
                            <td>
                                <p><code>TODAY</code> does not take an argument. </p>
                                <p>See also <code><a href="#NOW" class="xref">NOW</a></code>, a similar calculation that returns a datetime instead of a date.</p>
                                <p>If the data source is a live connection, the system date could be in another timezone. For more information on how to address this, see <a href="https://kb.tableau.com/articles/issue/now-function-returns-utc-time">the Knowledge Base</a>. </p>
                            </td>
                        </tr>
                    </tbody>
                </table>

### TOTAL

`TOTAL(expression)`

For more information, see [Table Calculation Functions](https://help.tableau.com/current/pro/desktop/en-us/functions_functions_tablecalculation.htm).

### TRIM

<table class="table--plain" style="width: 100%;">
                    <colgroup><col style="width: 20%;">
                    <col>
                    </colgroup><tbody>
                        <tr>
                            <td>Syntax</td>
                            <td><code>TRIM(string)</code>
                            </td>
                        </tr>
                        <tr>
                            <td>Output</td>
                            <td>String</td>
                        </tr>
                        <tr>
                            <td>Definition</td>
                            <td>Returns the provided <code>&lt;string&gt;</code> with leading and trailing spaces removed.</td>
                        </tr>
                        <tr>
                            <td>Example</td>
                            <td><pre>TRIM(" Calculation ") = "Calculation"</pre>
                            </td>
                        </tr>
                        <tr>
                            <td>Notes</td>
                            <td>See also <a href="#LTRIM" class="xref">LTRIM</a> and <a href="#RTRIM" class="xref">RTRIM</a>. </td>
                        </tr>
                    </tbody>
                </table>

[back to top](#top)

## U

### UPPER

<table class="table--plain" style="width: 100%;">
                    <colgroup><col style="width: 20%;">
                    <col>
                    </colgroup><tbody>
                        <tr>
                            <td>Syntax</td>
                            <td><code>UPPER(string)</code>
                            </td>
                        </tr>
                        <tr>
                            <td>Output</td>
                            <td>String</td>
                        </tr>
                        <tr>
                            <td>Definition</td>
                            <td>Returns the provided <code>&lt;string&gt;</code> in all uppercase characters.</td>
                        </tr>
                        <tr>
                            <td>Example</td>
                            <td><pre>UPPER("Calculation") = "CALCULATION"</pre>
                            </td>
                        </tr>
                        <tr>
                            <td>Notes</td>
                            <td>See also <a href="#PROPER" class="xref">PROPER</a> and <a href="#LOWER" class="xref">LOWER</a>.</td>
                        </tr>
                    </tbody>
                </table>

### USEC\_TO\_TIMESTAMP

`USEC_TO_TIMESTAMP(expression)`

Only supported when connected to Google BigQuery. For more information, see [Additional Functions](https://help.tableau.com/current/pro/desktop/en-us/functions_functions_additional.htm).

### USERDOMAIN

<table class="table--plain" style="width: 100%;">
                    <colgroup><col style="width: 20%;">
                    <col>
                    </colgroup><tbody>
                        <tr>
                            <td>Syntax</td>
                            <td><code>USERDOMAIN(&nbsp;)</code>
                            </td>
                        </tr>
                        <tr>
                            <td>Output</td>
                            <td>String</td>
                        </tr>
                        <tr>
                            <td>Definition</td>
                            <td>Returns the domain for the current user.</td>
                        </tr>
                        <tr>
                            <td>Notes</td>
                            <td>
                                <p>This function checks:</p>
                                <ul>
                                    <li><span class="mc-variable Variables.TabsProductOnline variable">Tableau Cloud</span> and <span class="mc-variable Variables.TabsProductServer variable">Tableau Server</span>:&nbsp;the user domain of the signed-in user</li>
                                    <li><span class="mc-variable Variables.TabsProductDesktop variable">Tableau Desktop</span>: the local domain if the user is on a domain</li>
                                </ul>
                            </td>
                        </tr>
                    </tbody>
                </table>

### USERNAME

<table class="table--plain" style="width: 100%;">
                    <colgroup><col style="width: 20%;">
                    <col>
                    </colgroup><tbody>
                        <tr>
                            <td>Syntax</td>
                            <td><code>USERNAME( )</code>
                            </td>
                        </tr>
                        <tr>
                            <td>Output</td>
                            <td>String</td>
                        </tr>
                        <tr>
                            <td>Definition</td>
                            <td>Returns the username for the current user.</td>
                        </tr>
                        <tr>
                            <td>Example</td>
                            <td><pre xml:space="preserve">USERNAME( )</pre>
                                <p>This returns the username of the signed in user, such as "hmyrer".</p><pre xml:space="preserve">[Manager] = USERNAME( )</pre>
                                <p>If manager "hmyrer" is signed in, this example returns TRUE only if the Manager field in the view contains "hmyrer". </p>
                            </td>
                        </tr>
                        <tr>
                            <td>Notes</td>
                            <td>
                                <p>This function checks:</p>
                                <ul>
                                    <li><span class="mc-variable Variables.TabsProductOnline variable">Tableau Cloud</span> and <span class="mc-variable Variables.TabsProductServer variable">Tableau Server</span>:&nbsp;the username of the signed-in user</li>
                                    <li><span class="mc-variable Variables.TabsProductDesktop variable">Tableau Desktop</span>: the local or network username for the user</li>
                                </ul>
                                <p><b>User filters</b>
                                </p>
                                <p>When used as a filter, a calculated field such as <code>[Username field] = USERNAME( )</code> can be used to create a user filter that only shows data that is relevant to the person signed in to the server.</p>
                            </td>
                        </tr>
                    </tbody>
                </table>

### USER ATTRIBUTE JSON web token functions

- `USERATTRIBUTE('attribute_name')`
- `USERATTRIBUTEINCLUDES('attribute_name', 'expected_value')`

For more information, see [User Functions](https://help.tableau.com/current/pro/desktop/en-us/functions_functions_user.htm).

[back to top](#top)

## V

### VAR

<table class="table--plain" style="width: 100%;"><colgroup><col style="width: 20%;"> <col></colgroup><tbody><tr><td>Syntax</td><td><code>VAR(expression)</code></td></tr><tr><td>Definition</td><td>Returns the statistical variance of all values in the given expression based on a sample of the population.</td></tr></tbody></table>

### VARP

<table class="table--plain" style="width: 100%;"><colgroup><col style="width: 20%;"> <col></colgroup><tbody><tr><td>Syntax</td><td><code>VARP(expression)</code></td></tr><tr><td>Definition</td><td>Returns the statistical variance of all values in the given expression on the entire population.</td></tr></tbody></table>

[back to top](#top)

## W

### WEEK

<table class="table--plain" style="width: 100%;">
                    <colgroup><col style="width: 20%;">
                    <col>
                    </colgroup><tbody>
                        <tr>
                            <td>Syntax</td>
                            <td><code>WEEK(date)</code>
                            </td>
                        </tr>
                        <tr>
                            <td>Output</td>
                            <td>Integer</td>
                        </tr>
                        <tr>
                            <td>Definition</td>
                            <td>Returns the week of the given <code>&lt;date&gt;</code> as an integer.</td>
                        </tr>
                        <tr>
                            <td>Example</td>
                            <td><pre>WEEK(#1986-03-25#) = 13</pre>
                            </td>
                        </tr>
                        <tr>
                            <td>Notes</td>
                            <td>See also <code><a href="#DAY" class="xref">DAY</a></code>, <code><a href="#MONTH" class="xref">MONTH</a></code>, <code><a href="#QUARTER" class="xref">Quarter</a></code>, <code><a href="#YEAR" class="xref">YEAR</a></code>, and the ISO equivalents</td>
                        </tr>
                    </tbody>
                </table>

### WHEN

<table class="table--plain" style="width: 100%;">
                    <colgroup><col style="width: 20%;">
                    <col>
                    </colgroup><tbody>
                        <tr>
                            <td>Syntax</td>
                            <td><code>CASE &lt;expression&gt;<br><b>WHEN</b> &lt;value1&gt; THEN &lt;then1&gt;<br><b>WHEN</b> &lt;value2&gt; THEN &lt;then2&gt;<br>...<br>[ELSE &lt;default&gt;]<br>END</code>
                            </td>
                        </tr>
                        <tr>
                            <td>Definition</td>
                            <td>A required part of a <code>CASE</code> expression. Finds the first <code>&lt;value&gt;</code> that matches <code>&lt;expression&gt;</code> and returns the corresponding <code>&lt;then&gt;</code>.</td>
                        </tr>
                        <tr>
                            <td>Example</td>
                            <td><pre>CASE [Season] <br><b>WHEN</b> 'Summer' THEN 'Sandals' <br><b>WHEN</b> 'Winter' THEN 'Boots' <br>ELSE 'Sneakers' <br>END</pre>
                                <p><i>"Look at the Season field. If the value is Summer, then return Sandals. If the value is Winter, then return Boots. If none of the options in the calculation match what is in the Season field, return a Sneakers."</i>
                                </p>
                            </td>
                        </tr>
                        <tr>
                            <td>Notes</td>
                            <td>
                                <p>Used with <a href="#CASE" class="xref">CASE</a>, <a href="#THEN" class="xref">THEN</a>, <a href="#ELSE" class="xref">ELSE</a>, and <a href="#END" class="xref">END</a>. </p>
                                <p><code>CASE</code> also supports <code>WHEN IN</code> construction, such as:</p><pre xml:space="preserve">CASE &lt;expression&gt; <br><b>WHEN IN</b> &lt;set1&gt; THEN &lt;then1&gt; <br><b>WHEN IN</b> &lt;combinedfield&gt; THEN &lt;then2&gt; <br>... <br>ELSE &lt;default&gt; <br>END</pre>
                                <p>The values that <code>WHEN IN</code> compare to must be a set, list of literal values, or combined field. See also <a href="#IN" class="xref">IN</a>.</p>
                            </td>
                        </tr>
                    </tbody>
                </table>

### Window Table Calcs

For more information, see [Table Calculation Functions](https://help.tableau.com/current/pro/desktop/en-us/functions_functions_tablecalculation.htm).

- `WINDOW_AVG(expression, [start, end])`
- `WINDOW_CORR(expression1, expression2, [start, end])`
- `WINDOW_COUNT(expression, [start, end])`
- `WINDOW_COVAR(expression1, expression2, [start, end])`
- `WINDOW_COVARP(expression1, expression2, [start, end])`
- `WINDOW_MAX(expression, [start, end])`
- `WINDOW_MEDIAN(expression, [start, end])`
- `WINDOW_MIN(expression, [start, end])`
- `WINDOW_PERCENTILE(expression, number, [start, end])`
- `WINDOW_STDEV(expression, [start, end])`
- `WINDOW_STDEVP(expression, [start, end])`
- `WINDOW_SUM(expression, [start, end])`
- `WINDOW_VAR(expression, [start, end])`
- `WINDOW_VARP(expression, [start, end])`

[back to top](#top)

## X

### XPATH functions.

Only supported when connected to Hadoop Hive. For more information, see [Pass-Through Functions (RAWSQL)](https://help.tableau.com/current/pro/desktop/en-us/functions_functions_passthrough.htm).

- `XPATH_BOOLEAN(XML string, XPath expression string)`
- `XPATH_DOUBLE(XML string, XPath expression string)`
- `XPATH_FLOAT(XML string, XPath expression string)`
- `XPATH_INT(XML string, XPath expression string)`
- `XPATH_LONG(XML string, XPath expression string)`
- `XPATH_SHORT(XML string, XPath expression string)`
- `XPATH_STRING(XML string, XPath expression string)`

[back to top](#top)

## Y

### YEAR

<table class="table--plain" style="width: 100%;">
                    <colgroup><col style="width: 20%;">
                    <col>
                    </colgroup><tbody>
                        <tr>
                            <td>Syntax</td>
                            <td><code>YEAR(date)</code>
                            </td>
                        </tr>
                        <tr>
                            <td>Output</td>
                            <td>Integer</td>
                        </tr>
                        <tr>
                            <td>Definition</td>
                            <td>Returns the year of the given <code>&lt;date&gt;</code> as an integer.</td>
                        </tr>
                        <tr>
                            <td>Example</td>
                            <td><pre xml:space="preserve">YEAR(#1986-03-25#) = 1,986</pre>
                            </td>
                        </tr>
                        <tr>
                            <td>Notes</td>
                            <td>See also <code><a href="#DAY" class="xref">DAY</a></code>, <code><a href="#WEEK" class="xref">WEEK</a></code>, <code><a href="#MONTH" class="xref">MONTH</a></code>, <code><a href="#QUARTER" class="xref">Quarter</a></code>, and the ISO equivalents</td>
                        </tr>
                    </tbody>
                </table>

[back to top](#top)

## Z

### ZN

<table class="table--plain" style="width: 100%;">
                    <colgroup><col style="width: 20%;">
                    <col>
                    </colgroup><tbody>
                        <tr>
                            <td>Syntax</td>
                            <td><code>ZN(expression)</code>
                            </td>
                        </tr>
                        <tr>
                            <td>Output</td>
                            <td>Depends on the data type of the <code>&lt;expression&gt;</code>, or 0.</td>
                        </tr>
                        <tr>
                            <td>Definition</td>
                            <td>Returns <code>&lt;expression&gt;</code> if it isn't null, otherwise returns zero.</td>
                        </tr>
                        <tr>
                            <td>Example</td>
                            <td><pre xml:space="preserve">ZN([Test Grade])</pre>
                                <p><i>"If the test grade isn't null, return its value. If the test grade is null, return 0."</i>
                                </p>
                            </td>
                        </tr>
                        <tr>
                            <td>Notes</td>
                            <td>
                                <p><code>ZN</code> is a specialized case of <a href="#IFNULL" class="xref">IFNULL</a> where alternative if the expression is null is always 0 rather than being specified in the calculation. </p>
                                <p><code>ZN</code> is especially useful when performing additional calculations and a null would render the entire calculation null. However, use caution interpreting these results as null is not always synonymous with 0 and could represent missing data. </p>
                                <p>See also <a href="#ISNULL" class="xref">ISNULL</a>. </p>
                            </td>
                        </tr>
                    </tbody>
                </table>

[back to top](#top)

## See also

[Tableau Functions (by Category)](https://help.tableau.com/v0.0/pro/desktop/en-us/functions_all_categories.htm)

[Functions in Tableau](https://help.tableau.com/v0.0/pro/desktop/en-us/functions.htm)