EDUCBA

EDUCBA

MENUMENU
  • Free Tutorials
  • Free Courses
  • Certification Courses
  • 360+ Courses All in One Bundle
  • Login

Tableau Table Calculation

Home » Data Science » Data Science Tutorials » Tableau Tutorial » Tableau Table Calculation

tableau table calculation

Overview of Tableau Table Calculation

Tableau is one of the best BI tools in the market and it can handle large amounts of data sets. In this article, we would see Table Calculation which simplifies in various operations. In this topic, we are going to learn about Tableau Table Calculation.

Table calculations are computations that are applied to the values in the table and it is dependent on the table structure or rather the dimensions that are in the viz or the visualization level of detail. So, whenever you want to extend the values present in your table or your view, these calculations can be used.

Start Your Free Data Science Course

Hadoop, Data Science, Statistics & others

An important point to remember is that the table calculations are dependent on the dimensions in the VIS level of detail. So, what exactly is this level of detail? The level of detail includes all those dimensions that are present in the shelves or the cards as indicated here within the red boxes.

These are the below topics which we would cover today

  1. Tableau Table Calculations
  2. Tableau Calculation Fields
  3. Difference between Tableau table calculations and Tableau calculated Fields
  4. Tableau Calculation Function

Tableau Table Calculations

Table Calculation comes are running several types like total, percentage, total percentage, average, total average in the table and so on. These are predefined calculations and called a Tableau table calculation.

The benefits of Table Calculation

  • The fastest way to calculate the values for the tables like total, average or percent, etc.,
  • It can also be saved and use as calculated fields
  • Efficient result for calculating values

Tableau Calculation Fields

Before begin with this topic start your Tableau desktop and download the given dataset to male this practice.

Steps to download Tableau Desktop: Click here

Download Bank Customer Dataset: Click here

Open a new workbook in tableau desktop and connect the data sources using the .xls file dataset

Tableau Calculation Fields 1

The data sources look like

Tableau Calculation Fields 2

Using this data source we can create a table based on customer name and total balance

Tableau Calculation Fields 3

Table calculation would add the measures in the view. The easiest way to make the calculation is to explore the Quick Table Calculation option when we select the dropdown like below

option

After running the total, the table will look like below

running the total

The calculation can rely on these two types

  • Addressing field – It says the direction of the calculation
  • Partitioning fields – The data can be partition into various types and then act as a calculation

Note

  • In this example, we have seen the running total is being from top to bottom based on the addressing field “name”. The calculation by default taken as the name category field.
  • When we add the region into the field, it is easy to change the addressing field

Let’s do this, drag the region in the column and click the measure table calculation again. Now we can identify the data symbol Compute using and change how we want the calculation to be computed.

measure table calculation

We can also change the partitioning in different ways based on the needs

Difference Between Table Calculation and Calculated Fields

Both table calculation and calculated fields are the same using the compute the result. But we will see the difference how the compute talks place and how it can be reused in more worksheets

1. Tableau Table Calculation

  • It is created as locally and lives in tableau view
  • When we say it would create as locally and can’t be reused to the data source
  • If we want to reuse, we need to save in the pane by dragging it

2. Tableau Calculated Field

  • It will be created as a separated column in the data source
  • The source can’t be changed, so we can use the calculated field in any of the worksheets
  • It would be computed with the data sources and view as a new column and can be re-use

When we compare to table calculation and calculated field, the calculation has a limited scope then calculated field. A calculated field can be enabled for deeper analysis.

Tableau Calculation Function

Let’s see few Tableau Calculation Functions

Lookup()

Lookup value returns the values of the expression for the selected target and pointing the relative offset in the current row. It will also return the NULL values if the target values don’t contain anything.

Syntax for lookup(): LOOKUP(expression,[offset])

Example: LOOKUP(SUM([BALANCE])), +1)

Index()

The index which returns a value from the given array range. When we take a simple example in excel by indexing A1: B12 and returning the value by using the MATCH function. In the tableau, it will partition and returns the current row value

Example: INDEX() = 5

Last()

It will return the no. of rows in the current row with the partition of the last row

Example: Current row index is 7 of 10 LAST() = 8

First()

It will return the no. of rows in the current row with the partition of the first row

Popular Course in this category
Tableau Training (4 Courses, 6+ Projects)4 Online Courses | 6 Hands-on Projects | 39+ Hours | Verifiable Certificate of Completion | Lifetime Access
4.5 (5,734 ratings)
Course Price

View Course

Related Courses
Business Intelligence Training (12 Courses, 6+ Projects)Data Visualization Training (15 Courses, 5+ Projects)

Example: Current row index is 7 FIRST() = -5

Previous_Value()

It will return the values from the previous row which has been calculated. Also, return the expression when the current row is the first row in the table

Syntax for Previous_Value(): PREVIOUS_VALUE(expression)

Example: SUM([BALANCE]) * PREVIOUS_VALUE (2)

Rank()

In the viz, we can see the rank for every row or pane in the table calculation. It will return the rank for the current partition. The NULL Value can be ignored in the rank function.

Running_Max()

It will return the maximum for the given row from the first-row partition.

Example: RUNNING_MAX (SUM[BALANCE])

Running_Min()

It will return the minimum for the given row from the first-row partition.

Example: RUNNING_MIN (SUM[BALANCE])

Running_Avg()

It will return the Average value for the given row from the first-row partition.

Example: RUNNING_AVG (SUM[BALANCE])

Running_Count()

It will return the count of value for the given row from the first-row partition.

Example: RUNNING_COUNT (SUM[BALANCE])

Running_Sum()

It will return the sum of the value for the given row from the first-row partition

Example: RUNNING_SUM (SUM[BALANCE])

Size()

It will say the no. of rows in the partition.

Example: SIZE() = 10 , When the partition have 10 rows

Total()

It will return the total of a given row by ROW/COLUMN.

Conclusion

Now in this article, we have learned what is about table calculation, calculated field difference between these two and how to use table calculations.

Recommended Articles

This is a guide to Tableau Table Calculation. Here we discuss overview of tableau table calculation, table calculation field, calculated field and how to use table calculations. You may also have a look at the following articles to learn more –

  1. Tableau Charts
  2. Tableau Architecture
  3. Tableau Alternatives
  4. How to Use Tableau?

Tableau Training (4 Courses, 6+ Projects)

4 Online Courses

6 Hands-on Projects

39+ Hours

Verifiable Certificate of Completion

Lifetime Access

Learn More

3 Shares
Share
Tweet
Share
Primary Sidebar
Tableau Tutorial
  • Advanced
    • Tableau Reporting
    • Tableau Reporting Tool
    • Conditional Formatting in Tableau
    • Data Blending in Tableau
    • Parameters in Tableau
    • Tableau Data Sets
    • Tableau Drill Down
    • Tableau Dynamic Parameters
    • Tableau Table Calculation
    • Tableau Visualization
    • Tableau Joins
    • Pivot in Tableau
    • Data Visualization With Tableau
    • Forecast in Tableau
    • Map Layers in Tableau
    • Group in Tableau
    • Tableau Group by
    • Hierarchy in Tableau
    • Sets in Tableau
    • How to create a Set in Tableau
    • Tableau Order of Operations
    • Tableau User Group
    • Tableau Calculated Field
    • Custom SQL in Tableau
  • Basic
    • What is Tableau
    • What is Tableau Dashboard
    • What is Tableau Server
    • Uses of Tableau
    • Tableau Versions
    • Tableau Architecture
    • Is Tableau Free
    • Tableau New Features
    • How To Install Tableau
    • How to Use Tableau?
    • Install Tableau Server
    • Tableau Commands
  • Charts
    • Tableau Charts
    • Tableau Chart Types
    • Donut Chart in Tableau
    • Funnel Chart in Tableau
    • Gantt Chart in Tableau
    • Bubble Chart in Tableau
    • Pareto Chart in Tableau
    • Sankey Chart In Tableau
    • Stacked Bar Chart in Tableau
    • Tableau Bullet Chart
    • Waterfall Chart in Tableau
    • Line Chart in Tableau
    • Heat Map in Tableau
    • Histogram in Tableau
    • CrossTab in Tableau
    • Treemap in Tableau
    • Trend Lines in Tableau
    • Tableau Reference Lines
    • Tableau Dual Axis
    • Legend in Tableau
    • Pie Chart in Tableau
    • Tableau Storyline
  • Statement
    • Tableau IF Statement
    • Case Statement in Tableau
  • Functions
    • Tableau Functions
    • Tableau String Functions
    • Concatenate in Tableau
    • Rank Function in Tableau
    • Tableau Aggregate Functions
    • Tableau Date Functions
    • Window Sum Tableau
    • LOD Expressions in Tableau
    • LOOKUP Function in Tableau
    • Tableau Fixed Function
    • Tableau Count Distinct
    • Tableau Window Functions
  • Sort/Filters
    • Sorting in Tableau
    • Filters in Tableau
    • Types of Filters in Tableau
    • Tableau Action Filter
    • Context Filter in Tableau
    • Tableau Parameter Filter
    • Adding Filters in Tableau Dashboard
    • Tableau Context Filter
  • Tableau Dashboard
    • Dashboard in Tableau
    • Tableau Dashboard Creation
    • Tableau Dashboard Design
    • Tableau Workbook
  • Interview Questions
    • Tableau Interview Questions

Related Courses

Tableau Certification Course

Business Intelligence Courses

Data Visualization Courses

Footer
About Us
  • Blog
  • Who is EDUCBA?
  • Sign Up
  • Corporate Training
  • Certificate from Top Institutions
  • Contact Us
  • Verifiable Certificate
  • Reviews
  • Terms and Conditions
  • Privacy Policy
  •  
Apps
  • iPhone & iPad
  • Android
Resources
  • Free Courses
  • Database Management
  • Machine Learning
  • All Tutorials
Certification Courses
  • All Courses
  • Data Science Course - All in One Bundle
  • Machine Learning Course
  • Hadoop Certification Training
  • Cloud Computing Training Course
  • R Programming Course
  • AWS Training Course
  • SAS Training Course

© 2020 - EDUCBA. ALL RIGHTS RESERVED. THE CERTIFICATION NAMES ARE THE TRADEMARKS OF THEIR RESPECTIVE OWNERS.

EDUCBA
Free Data Science Course

Hadoop, Data Science, Statistics & others

*Please provide your correct email id. Login details for this Free course will be emailed to you
Book Your One Instructor : One Learner Free Class

Let’s Get Started

This website or its third-party tools use cookies, which are necessary to its functioning and required to achieve the purposes illustrated in the cookie policy. By closing this banner, scrolling this page, clicking a link or continuing to browse otherwise, you agree to our Privacy Policy

EDUCBA

*Please provide your correct email id. Login details for this Free course will be emailed to you
EDUCBA Login

Forgot Password?

EDUCBA
Free Data Science Course

Hadoop, Data Science, Statistics & others

*Please provide your correct email id. Login details for this Free course will be emailed to you

Special Offer - Tableau Training (4 Courses, 6+ Projects) Learn More