Table Calculation Functions (2024)

Table of Contents
Why use table calculation functions Table calculation functions available in Tableau FIRST( ) INDEX( ) LAST( ) LOOKUP(expression, [offset]) MODEL_EXTENSION_BOOL (model_name, arguments, expression) MODEL_EXTENSION_INT (model_name, arguments, expression) MODEL_EXTENSION_REAL (model_name, arguments, expression) MODEL_EXTENSION_STRING (model_name, arguments, expression) MODEL_PERCENTILE(target_expression, predictor_expression(s)) MODEL_QUANTILE(quantile, target_expression, predictor_expression(s)) PREVIOUS_VALUE(expression) RANK(expression, ['asc' | 'desc']) RANK_DENSE(expression, ['asc' | 'desc']) RANK_MODIFIED(expression, ['asc' | 'desc']) RANK_PERCENTILE(expression, ['asc' | 'desc']) RANK_UNIQUE(expression, ['asc' | 'desc']) RUNNING_AVG(expression) RUNNING_COUNT(expression) RUNNING_MAX(expression) RUNNING_MIN(expression) RUNNING_SUM(expression) SIZE() SCRIPT_BOOL SCRIPT_INT SCRIPT_REAL SCRIPT_STR TOTAL(expression) 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_MEDIAN(expression, [start, end]) WINDOW_MAX(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]) Create a table calculation using the calculation editor Step 1: Create the visualization Step 2: Create the table calculation Step 3: Use the table calculation in the visualization Step 4: Edit the table calculation See Also

This article introduces table calculation functions and their uses in Tableau. It also demonstrates how to create a table calculation using the calculation editor.

Why use table calculation functions

Table calculation functions allow you to perform computations on values in a table.

For example, you can calculate the percent of total an individual sale is for the year, or for several years.

Table calculation functions available in Tableau

FIRST( )

Returns the number of rows fromthe current row to the first row in the partition. For example,the view below shows quarterly sales. When FIRST() is computed withinthe Date partition, the offset of the first row from the secondrow is -1.

Table Calculation Functions (1)

Example

When the current row index is 3, FIRST()= -2.

INDEX( )

Returns the index of the currentrow in the partition, without any sorting with regard to value. The first row index starts at 1. For example,the table below shows quarterly sales. When INDEX() is computedwithin the Date partition, the index of each row is 1, 2, 3, 4..., etc.

Table Calculation Functions (2)

Example

For the third row in the partition, INDEX() = 3.

LAST( )

Returns the number of rows fromthe current row to the last row in the partition. For example, thetable below shows quarterly sales. When LAST() is computed withinthe Date partition, the offset of the last row from the second rowis 5.

Table Calculation Functions (3)

Example

When the current row index is 3of 7, LAST() = 4.

LOOKUP(expression, [offset])

Returns thevalue of the expression in a target row, specified as a relativeoffset from the current row. Use FIRST() + n and LAST() - n as part of your offset definition fora target relative to the first/last rows in the partition. If offset is omitted, the row to compare to can be set on the field menu. This function returnsNULL if the target row cannot be determined.

The view below shows quarterly sales. When LOOKUP (SUM(Sales), 2)is computed within the Date partition, each row shows the salesvalue from 2 quarters into the future.

Table Calculation Functions (4)

Example

LOOKUP(SUM([Profit]),FIRST()+2) computes the SUM(Profit) in the third row of the partition.

MODEL_EXTENSION_BOOL (model_name, arguments, expression)

Returns the boolean result of an expression as calculated by a named model deployed on a TabPy external service.

Model_name is the name of the deployed analytics model you want to use.

Each argument is a single string that sets the input values that the deployed model accepts, and is defined by the analytics model.

Use expressions to define the values that are sent from Tableau to the analytics model. Be sure to use aggregation functions (SUM, AVG, etc.) to aggregate the results.

When using the function, the data types and order of the expressions must match that of the input arguments.

Example

MODEL_EXTENSION_BOOL ("isProfitable","inputSales", "inputCosts", SUM([Sales]), SUM([Costs]))

MODEL_EXTENSION_INT (model_name, arguments, expression)

Returns an integer result of an expression as calculated by a named model deployed on a TabPy external service.

Model_name is the name of the deployed analytics model you want to use.

Each argument is a single string that sets the input values that the deployed model accepts, and is defined by the analytics model.

Use expressions to define the values that are sent from Tableau to the analytics model. Be sure to use aggregation functions (SUM, AVG, etc.) to aggregate the results.

When using the function, the data types and order of the expressions must match that of the input arguments.

Example

MODEL_EXTENSION_INT ("getPopulation", "inputCity", "inputState", MAX([City]), MAX ([State]))

MODEL_EXTENSION_REAL (model_name, arguments, expression)

Returns a real result of an expression as calculated by a named model deployed on a TabPy external service.

Model_name is the name of the deployed analytics model you want to use.

Each argument is a single string that sets the input values that the deployed model accepts, and is defined by the analytics model.

Use expressions to define the values that are sent from Tableau to the analytics model. Be sure to use aggregation functions (SUM, AVG, etc.) to aggregate the results.

When using the function, the data types and order of the expressions must match that of the input arguments.

Example

MODEL_EXTENSION_REAL ("profitRatio", "inputSales", "inputCosts", SUM([Sales]), SUM([Costs]))

MODEL_EXTENSION_STRING (model_name, arguments, expression)

Returns the string result of an expression as calculated by a named model deployed on a TabPy external service.

Model_name is the name of the deployed analytics model you want to use.

Each argument is a single string that sets the input values that the deployed model accepts, and is defined by the analytics model.

Use expressions to define the values that are sent from Tableau to the analytics model. Be sure to use aggregation functions (SUM, AVG, etc.) to aggregate the results.

When using the function, the data types and order of the expressions must match that of the input arguments.

Example

MODEL_EXTENSION_STR ("mostPopulatedCity", "inputCountry", "inputYear", MAX ([Country]), MAX([Year]))

MODEL_PERCENTILE(target_expression, predictor_expression(s))

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

This function is the inverse of MODEL_QUANTILE. For information on predictive modeling functions, see How Predictive Modeling Functions Work in Tableau.

Example

The following formula returns the quantile of the mark for sum of sales, adjusted for count of orders.

MODEL_PERCENTILE(SUM([Sales]), COUNT([Orders]))

MODEL_QUANTILE(quantile, target_expression, predictor_expression(s))

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.

This function is the inverse of MODEL_PERCENTILE. For information on predictive modeling functions, see How Predictive Modeling Functions Work in Tableau.

Example

The following formula returns the median (0.5) predicted sum of sales, adjusted for count of orders.

MODEL_QUANTILE(0.5, SUM([Sales]), COUNT([Orders]))

PREVIOUS_VALUE(expression)

Returns thevalue of this calculation in the previous row. Returns the givenexpression if the current row is the first row of the partition.

Example

SUM([Profit]) * PREVIOUS_VALUE(1) computes the running product of SUM(Profit).

RANK(expression, ['asc' | 'desc'])

Returns the standard competition rank for the current row in the partition. Identical values are assigned an identical rank. Use the optional 'asc' | 'desc' argument to specify ascending or descending order. The default is descending.

With this function, the set of values (6, 9, 9, 14) would be ranked (4, 2, 2, 1).

Nulls are ignored in ranking functions. They are not numbered and they do not count against the total number of records in percentile rank calculations.

For information on different ranking options, see Rank calculation.

Example

The following image shows the effect of the various ranking functions (RANK, RANK_DENSE, RANK_MODIFIED, RANK_PERCENTILE, andRANK_UNIQUE) on a set of values. The data set contains information on 14 students (StudentA through StudentN); the Age column shows the current age of each student (all students are between 17 and 20 years of age). The remaining columns show the effect of each rank function on the set of age values, always assuming the default order (ascending or descending) for the function.

Table Calculation Functions (5)

RANK_DENSE(expression, ['asc' | 'desc'])

Returns the dense rank for the current row in the partition. Identical values are assigned an identical rank, but no gaps are inserted into the number sequence. Use the optional 'asc' | 'desc' argument to specify ascending or descending order. The default is descending.

With this function, the set of values (6, 9, 9, 14) would be ranked (3, 2, 2, 1).

Nulls are ignored in ranking functions. They are not numbered and they do not count against the total number of records in percentile rank calculations.

For information on different ranking options, see Rank calculation.

RANK_MODIFIED(expression, ['asc' | 'desc'])

Returns the modified competition rank for the current row in the partition. Identical values are assigned an identical rank. Use the optional 'asc' | 'desc' argument to specify ascending or descending order. The default is descending.

With this function, the set of values (6, 9, 9, 14) would be ranked (4, 3, 3, 1).

Nulls are ignored in ranking functions. They are not numbered and they do not count against the total number of records in percentile rank calculations.

For information on different ranking options, see Rank calculation.

RANK_PERCENTILE(expression, ['asc' | 'desc'])

Returns the percentile rank for the current row in the partition. Use the optional 'asc' | 'desc' argument to specify ascending or descending order. The default is ascending.

With this function, the set of values (6, 9, 9, 14) would be ranked (0.00, 0.67, 0.67, 1.00).

Nulls are ignored in ranking functions. They are not numbered and they do not count against the total number of records in percentile rank calculations.

For information on different ranking options, see Rank calculation.

RANK_UNIQUE(expression, ['asc' | 'desc'])

Returns the unique rank for the current row in the partition. Identical values are assigned different ranks. Use the optional 'asc' | 'desc' argument to specify ascending or descending order. The default is descending.

With this function, the set of values (6, 9, 9, 14) would be ranked (4, 2, 3, 1).

Nulls are ignored in ranking functions. They are not numbered and they do not count against the total number of records in percentile rank calculations.

For information on different ranking options, see Rank calculation.

RUNNING_AVG(expression)

Returns the runningaverage of the given expression, from the first row in the partition tothe current row.

The view below shows quarterlysales. When RUNNING_AVG(SUM([Sales]) is computed within the Datepartition, the result is a running average of the sales values foreach quarter.

Table Calculation Functions (6)

Example

RUNNING_AVG(SUM([Profit]))computes the running average of SUM(Profit).

RUNNING_COUNT(expression)

Returns therunning count of the given expression, from the first row in thepartition to the current row.

Example

RUNNING_COUNT(SUM([Profit])) computes the running count of SUM(Profit).

RUNNING_MAX(expression)

Returns the runningmaximum of the given expression, from the first row in the partition tothe current row.

Table Calculation Functions (7)

Example

RUNNING_MAX(SUM([Profit])) computes the running maximum of SUM(Profit).

RUNNING_MIN(expression)

Returns the runningminimum of the given expression, from the first row in the partition tothe current row.

Table Calculation Functions (8)

Example

RUNNING_MIN(SUM([Profit]))computes the running minimum of SUM(Profit).

RUNNING_SUM(expression)

Returns the runningsum of the given expression, from the first row in the partition tothe current row.

Table Calculation Functions (9)

Example

RUNNING_SUM(SUM([Profit])) computes the running sum of SUM(Profit)

SIZE()

Returns the number of rows in thepartition. For example, the view below shows quarterly sales. Withinthe Date partition, there are seven rows so the Size() of the Datepartition is 7.

Table Calculation Functions (10)

Example

SIZE() = 5 when the current partition contains five rows.

SCRIPT_BOOL

Returns a Boolean result from the specified expression. The expression is passed directly to a running analytics extension service instance.

In R expressions, use .argn (with a leading period) to reference parameters (.arg1, .arg2, etc.).

In Python expressions, use _argn (with a leading underscore).

Examples

In this R example, .arg1 is equal to SUM([Profit]):

SCRIPT_BOOL("is.finite(.arg1)", SUM([Profit]))

The next example returns True for store IDs in Washington state, and False otherwise. This example could be the definition for a calculated field titled IsStoreInWA.

SCRIPT_BOOL('grepl(".*_WA", .arg1, perl=TRUE)',ATTR([Store ID]))

A command for Python would take this form:

SCRIPT_BOOL("return map(lambda x : x > 0, _arg1)", SUM([Profit]))

SCRIPT_INT

Returns an integer result from the specified expression. The expression is passed directly to a running analytics extension service instance.

In R expressions, use .argn (with a leading period) to reference parameters (.arg1, .arg2, etc.)

In Python expressions, use _argn (with a leading underscore).

Examples

In this R example, .arg1 is equal to SUM([Profit]):

SCRIPT_INT("is.finite(.arg1)", SUM([Profit]))

In the next example, k-means clustering is used to create three clusters:

SCRIPT_INT('result <- kmeans(data.frame(.arg1,.arg2,.arg3,.arg4), 3);result$cluster;', SUM([Petal length]), SUM([Petal width]),SUM([Sepal length]),SUM([Sepal width]))

A command for Python would take this form:

SCRIPT_INT("return map(lambda x : int(x * 5), _arg1)", SUM([Profit]))

SCRIPT_REAL

Returns a real result from the specified expression. The expression is passed directly to a running analytics extension service instance. In

R expressions, use .argn (with a leading period) to reference parameters (.arg1, .arg2, etc.)

In Python expressions, use _argn (with a leading underscore).

Examples

In this R example, .arg1 is equal to SUM([Profit]):

SCRIPT_REAL("is.finite(.arg1)", SUM([Profit]))

The next example converts temperature values from Celsius to Fahrenheit.

SCRIPT_REAL('library(udunits2);ud.convert(.arg1, "celsius", "degree_fahrenheit")',AVG([Temperature]))

A command for Python would take this form:

SCRIPT_REAL("return map(lambda x : x * 0.5, _arg1)", SUM([Profit]))

SCRIPT_STR

Returns a string result from the specified expression. The expression is passed directly to a running analytics extension service instance.

In R expressions, use .argn (with a leading period) to reference parameters (.arg1, .arg2, etc.)

In Python expressions, use _argn (with a leading underscore).

Examples

In this R example, .arg1 is equal to SUM([Profit]):

SCRIPT_STR("is.finite(.arg1)", SUM([Profit]))

The next example extracts a state abbreviation from a more complicated string (in the original form 13XSL_CA, A13_WA):

SCRIPT_STR('gsub(".*_", "", .arg1)',ATTR([Store ID]))

A command for Python would take this form:

SCRIPT_STR("return map(lambda x : x[:2], _arg1)", ATTR([Region]))

TOTAL(expression)

Returns the total forthe given expression in a table calculation partition.

Example

Assume you are starting with this view:

Table Calculation Functions (11)

You open the calculation editor and create a new field which you name Totality:

Table Calculation Functions (12)

You then drop Totality on Text, to replace SUM(Sales). Your view changes such that it sums values based on the default Compute Using value:

Table Calculation Functions (13)

This raises the question, What is the default Compute Using value? If you right-click (Control-click on a Mac) Totality in the Data pane and choose Edit, there is now an additional bit of information available:

Table Calculation Functions (14)

The default Compute Using value is Table (Across). The result is that Totality is summing the values across each row of your table. Thus, the value that you see across each row is the sum of the values from the original version of the table.

The values in the 2011/Q1 row in the original table were $8601, $6579, $44262, and $15006. The values in the table after Totality replaces SUM(Sales) are all $74,448, which is the sum of the four original values.

Notice the triangle next to Totality after you drop it on Text:

Table Calculation Functions (15)

This indicates that this field is using a table calculation. You can right-click the field and choose Edit Table Calculation to redirect your function to a different Compute Using value. For example, you could set it to Table (Down). In that case, your table would look like this:

Table Calculation Functions (16)

WINDOW_AVG(expression, [start, end])

Returnsthe average of the expression within the window. The window is definedby means of offsets from the current row. Use FIRST()+n and LAST()-n foroffsets from the first or last row in the partition. If the startand end are omitted, the entire partition is used.

For example,the view below shows quarterly sales. A window average within theDate partition returns the average sales across all dates.

Table Calculation Functions (17)

Example

WINDOW_AVG(SUM([Profit]), FIRST()+1, 0) computes the average ofSUM(Profit) from the second row to the current row.

WINDOW_CORR(expression1, expression2, [start, end])

Returns the Pearson correlation coefficient of two expressions within the window. The window is defined as offsets from the current row. Use FIRST()+n and LAST()-n for offsets from the first or last row in the partition. If start and end are omitted, the entire partition is used.

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, as when a positive change in one variable implies a positive change of corresponding magnitude in the other, 0 denotes no linear relationship between the variance, and −1 is an exact negative relationship.

There is an equivalent aggregation fuction: CORR. See Tableau Functions (Alphabetical)(Link opens in a new window).

Example

The following formula returns the Pearson correlation of SUM(Profit) and SUM(Sales) from the five previous rows to the current row.

WINDOW_CORR(SUM[Profit]), SUM([Sales]), -5, 0)

WINDOW_COUNT(expression, [start, end])

Returnsthe count of the expression within the window. The window is definedby means of offsets from the current row. Use FIRST()+n and LAST()-n foroffsets from the first or last row in the partition. If the startand end are omitted, the entire partition is used.

Example

WINDOW_COUNT(SUM([Profit]), FIRST()+1, 0) computes the count of SUM(Profit)from the second row to the current row

WINDOW_COVAR(expression1, expression2, [start, end])

Returns the sample covariance of two expressions within the window. The window is defined as offsets from the current row. Use FIRST()+n and LAST()-n for offsets from the first or last row in the partition. If the start and end arguments are omitted, the window is the entire partition.

Sample covariance 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 (with the WINDOW_COVARP 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.

There is an equivalent aggregation fuction: COVAR. See Tableau Functions (Alphabetical)(Link opens in a new window).

Example

The following formula returns the sample covariance of SUM(Profit) and SUM(Sales) from the two previous rows to the current row.

WINDOW_COVAR(SUM([Profit]), SUM([Sales]), -2, 0)

WINDOW_COVARP(expression1, expression2, [start, end])

Returns the population covariance of two expressions within the window. The window is defined as offsets from the current row. Use FIRST()+n and LAST()-n for offsets from the first or last row in the partition. If start and end are omitted, the entire partition is used.

Population covariance 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 WINDOW_COVAR function) is appropriate.

There is an equivalent aggregation fuction: COVARP. Tableau Functions (Alphabetical)(Link opens in a new window).

Example

The following formula returns the population covariance of SUM(Profit) and SUM(Sales) from the two previous rows to the current row.

WINDOW_COVARP(SUM([Profit]), SUM([Sales]), -2, 0)

WINDOW_MEDIAN(expression, [start, end])

Returnsthe median of the expression within the window. The window is definedby means of offsets from the current row. Use FIRST()+n and LAST()-n foroffsets from the first or last row in the partition. If the startand end are omitted, the entire partition is used.

For example,the view below shows quarterly profit. A window median within theDate partition returns the median profit across all dates.

Table Calculation Functions (18)

Example

WINDOW_MEDIAN(SUM([Profit]), FIRST()+1, 0) computes the medianof SUM(Profit) from the second row to the current row.

WINDOW_MAX(expression, [start, end])

Returnsthe maximum of the expression within the window. The window is definedby means of offsets from the current row. Use FIRST()+n and LAST()-n foroffsets from the first or last row in the partition. If the startand end are omitted, the entire partition is used.

For example,the view below shows quarterly sales. A window maximum within theDate partition returns the maximum sales across all dates.

Table Calculation Functions (19)

Example

WINDOW_MAX(SUM([Profit]), FIRST()+1, 0) computes the maximum ofSUM(Profit) from the second row to the current row.

WINDOW_MIN(expression, [start, end])

Returnsthe minimum of the expression within the window. The window is definedby means of offsets from the current row. Use FIRST()+n and LAST()-n foroffsets from the first or last row in the partition. If the startand end are omitted, the entire partition is used.

For example,the view below shows quarterly sales. A window minimum within theDate partition returns the minimum sales across all dates.

Table Calculation Functions (20)

Example

WINDOW_MIN(SUM([Profit]), FIRST()+1, 0) computes the minimum ofSUM(Profit) from the second row to the current row.

WINDOW_PERCENTILE(expression, number, [start, end])

Returns the value corresponding to the specified percentile within the window. The window is definedby means of offsets from the current row. Use FIRST()+n and LAST()-n foroffsets from the first or last row in the partition. If the startand end are omitted, the entire partition is used.

Example

WINDOW_PERCENTILE(SUM([Profit]), 0.75, -2, 0) returns the 75th percentile for SUM(Profit) from the two previous rows to the current row.

WINDOW_STDEV(expression, [start, end])

Returnsthe sample standard deviation of the expression within the window.The window is defined by means of offsets from the current row. Use FIRST()+nand LAST()-n for offsets from the first or last row in the partition.If the start and end are omitted, the entire partition is used.

Example

WINDOW_STDEV(SUM([Profit]), FIRST()+1, 0) computes the standard deviation of SUM(Profit)from the second row to the current row.

WINDOW_STDEVP(expression, [start, end])

Returnsthe biased standard deviation of the expression within the window.The window is defined by means of offsets from the current row. Use FIRST()+nand LAST()-n for offsets from the first or last row in the partition.If the start and end are omitted, the entire partition is used.

Example

WINDOW_STDEVP(SUM([Profit]), FIRST()+1, 0) computes the standard deviation of SUM(Profit)from the second row to the current row.

WINDOW_SUM(expression, [start, end])

Returnsthe sum of the expression within the window. The window isdefined by means of offsets from the current row. Use FIRST()+n and LAST()-nfor offsets from the first or last row in the partition. If thestart and end are omitted, the entire partition is used.

Forexample, the view below shows quarterly sales. A window sum computedwithin the Date partition returns the summation of sales acrossall quarters.

Table Calculation Functions (21)

Example

WINDOW_SUM(SUM([Profit]), FIRST()+1, 0) computes the sum of SUM(Profit) from the second row tothe current row.

WINDOW_VAR(expression, [start, end])

Returnsthe sample variance of the expression within the window. The windowis defined by means of offsets from the current row. Use FIRST()+n and LAST()-nfor offsets from the first or last row in the partition. If thestart and end are omitted, the entire partition is used.

Example

WINDOW_VAR((SUM([Profit])), FIRST()+1, 0) computes the variance of SUM(Profit)from the second row to the current row.

WINDOW_VARP(expression, [start, end])

Returnsthe biased variance of the expression within the window. The windowis defined by means of offsets from the current row. Use FIRST()+n and LAST()-nfor offsets from the first or last row in the partition. If thestart and end are omitted, the entire partition is used.

Example

WINDOW_VARP(SUM([Profit]), FIRST()+1, 0) computes the variance of SUM(Profit)from the second row to the current row.

Create a table calculation using the calculation editor

Follow along with the steps below to learn how to create a table calculation using the calculation editor.

Note: There are several ways to create table calculations in Tableau. This example demonstrates only one of those ways. For more information, see Transform Values with Table Calculations(Link opens in a new window).

Step 1: Create the visualization

  1. In Tableau Desktop, connect to the Sample-Superstore saved data source, which comes with Tableau.

  2. Navigate to a worksheet.

  3. From the Data pane, under Dimensions, drag Order Date to the Columns shelf.

  4. From the Data pane, under Dimensions, drag Sub-Category to the Rows shelf.

  5. From the Data pane, under Measures, drag Sales to Text on the Marks card.

    Your visualization updates to a text table.

    Table Calculation Functions (22)

Step 2: Create the table calculation

  1. Select Analysis > Create Calculated Field.

  2. In the calculation editor that opens, do the following:

  • Name the calculated field, Running Sum of Profit.
  • Enter the following formula:

    RUNNING_SUM(SUM([Profit]))

    This formula calculates the running sum of profit sales. It is computed across the entire table.

  • When finished, click OK.

    The new table calculation field appears under Measures in the Data pane. Just like your other fields, you can use it in one or more visualizations.

Step 3: Use the table calculation in the visualization

  1. From the Data pane, under Measures, drag Running Sum of Profit to Color on the Marks card.

  2. On the Marks card, click the Mark Type drop-down and select Square.

    The visualization updates to a highlight table:

    Table Calculation Functions (23)

Step 4: Edit the table calculation

  1. On the Marks card, right-click Running Sum of Profit and select Edit Table Calculation.
  2. In the Table Calculation dialog box that opens, under Compute Using, select Table (down).

    The visualization updates to the following:

    Table Calculation Functions (24)

See Also

Create a table calculation(Link opens in a new window)

Table Calculation Types

Customize Table Calculations(Link opens in a new window)

Quick Table Calculations

Functions in Tableau

Tableau Functions (by Category)

Tableau Functions (Alphabetical)

Table Calculation Functions (2024)
Top Articles
Latest Posts
Article information

Author: Prof. Nancy Dach

Last Updated:

Views: 6045

Rating: 4.7 / 5 (57 voted)

Reviews: 88% of readers found this page helpful

Author information

Name: Prof. Nancy Dach

Birthday: 1993-08-23

Address: 569 Waelchi Ports, South Blainebury, LA 11589

Phone: +9958996486049

Job: Sales Manager

Hobby: Web surfing, Scuba diving, Mountaineering, Writing, Sailing, Dance, Blacksmithing

Introduction: My name is Prof. Nancy Dach, I am a lively, joyous, courageous, lovely, tender, charming, open person who loves writing and wants to share my knowledge and understanding with you.