Code360 powered by Coding Ninjas X Naukri.com. Code360 powered by Coding Ninjas X Naukri.com
Table of contents
1.
Introduction
2.
A Perfect Table in Tableau
3.
Creating Tables in Tableau
4.
Performing Calculation in Table
4.1.
Handling Blank Values
4.2.
Adding a Grand Total
4.3.
Arithmetic Operations on Table
4.4.
Quick Table Calculation in Tableau
5.
Importance of Tables in Tableau
6.
Frequently Asked Questions
6.1.
What is a dimension in Tableau?
6.2.
What is a measure in Tableau?
6.3.
How can you change fields in Tableau?
6.4.
What are measures names and measure values in Tableau?
6.5.
What are Longitude and Latitude in Tableau?
7.
Conclusion
Last Updated: Mar 27, 2024
Easy

Implementing Tables in Tableau

Author Sohail Ali
1 upvote
Create a resume that lands you SDE interviews at MAANG
Speaker
Anubhav Sinha
SDE-2 @
12 Jun, 2024 @ 01:30 PM

Introduction

Hii Ninjas! Tables are the tools that we use on a regular basis. A lot of data analysts use tables in their decision-making. Tableau typically provides features to create a text table or a pivot table. In this type of table, one dimension is placed on the row shelf and another on the columns shelf. 

implementing tables in tableau

In this blog, we will implement tables in Tableau and will learn to perform calculations on those tables. So buckle up your seatbelts, and let’s start learning.

A Perfect Table in Tableau

Tables are the first building block in the field of data analysis. It serves the total data using which an analyst extracts only the needed data. Thus, it becomes crucial to create a perfect table that will provide us with useful insights easily and quickly.

Below are some features a table should have to be called 'A Perfect Table'.

  • A table should be highly flexible and adaptive to the changes. A user should be able to perform various actions on the table, such as adding, removing, and sorting the table.
     
  • Tables should have a fixed height as scrolling throughout the table becomes a tiresome process.
     
  • A table should enable the user to perform bulk actions on multiple rows and columns.
     
  • Tables should provide the context of the data to the targeted audience at the global level.
     
  • A table should be formatted in such a way that it provides maximum readability to the users.
Get the tech career you deserve, faster!
Connect with our expert counsellors to understand how to hack your way to success
User rating 4.7/5
1:1 doubt support
95% placement record
Akash Pal
Senior Software Engineer
326% Hike After Job Bootcamp
Himanshu Gusain
Programmer Analyst
32 LPA After Job Bootcamp
After Job
Bootcamp

Creating Tables in Tableau

As we know, Tableau’s primary purpose is data visualization, not data creation or modeling. However, sometimes we may need to perform pseudo-analysis for some parts of our data. Thus, we should know how can we create a table to perform those tasks. Now, let’s learn to create our custom table from the source data.

Follow the below steps in order to create your custom table in Tableau.

Step 1: Connect your source data to Tableau.
 

Step 2: Drag the Actor name, Actor country, Movie id, Movie name, and Genre to the Rows field.

creating table in tableau

Whenever we add the first row or column, Tableau will put an Abc value at the intersection point. This happens because Tableau does not know which value to add at those points, and it expects the user to specify them later.

Now, Tableau calculates some fields based on the data type of our respective sheets.

In our example, Tableau calculates the count of Actors, Movies, Profit, and Genre of the data table. 
 

You can add the calculated fields in your table as per your need. In order to add the field, double-click on the field and Tableau will add them to the table for you. Or you can drag them and put them in the table manually as well.

automatic measure values in tableau

In the above image, we added two measured values, Actor count and Movie count, in our table.

Step 3: Drag or double-click the profit field in order to add it to our table.

Final output table

From the above image, we can observe that Tableau calculated the sum of the Profit field as aggregation.

Note: Tableau adds a Measure Names field in the column section in order to separate the names of various measures and form the table.

Congratulations! You have successfully created your custom table in Tableau.

Performing Calculation in Table

Now, we will look at some essential and useful operations which we can perform on our table. For this, we will be using the same custom data set with some added fields like Total team members and Shot length.

After placing all the fields in the rows and columns, our table will look like the one below.

table calculation in tableau

Now that we have our table ready, let’s perform a few operations to get to know more about Tableau features.

Handling Blank Values

In our table, we have a blank entry for the Movie id 110. This entry later may create problems in our data analysis part. Thus, it is wise to fill such entries with some values. Here, we will fill those entries with a 0 value.

In order to replace those entries, we need to create a custom field that will replace those values for us.

Follow the below steps to create a custom field in Tableau.

  • Go to the Analysis > Create custom field and then write the name of the field. In our example, we will write it as a New Profit field.
     
  • Write the given syntax in the text area, and if it is a valid operation, Tableau will display a valid statement at the bottom.
custom field in tableau

All the fields in Tableau must be aggregated. In our formula, the sum() function is used along with the lookup function for the aggregation. The lookup() function returns desired value in the target row, and the ZN() function will return 0 whenever it encounters a null entry.

  • Click on the OK button, and our new field will be created.
     
  • Drag the New profit field on the sum of the profit field to replace it with the new field.
replacing fields in tableau

After that, our New profit field without blank entry will get added to our table.

blank removed output image

Adding a Grand Total

Now let us look at how we can add the total of fields in the Tableau.

  • Go to the Analysis > Totals > Show Column Grand Totals. After that, a Grand Total gets added to our table, as shown below.
adding grand total in tableau

Note: You can add the Grand Total of rows and sub-columns using the same process.

Arithmetic Operations on Table

Tableau enables us to perform arithmetic operations on tables. These operations are done using the regular arithmetic operators we normally use. Let’s perform the addition and multiplication operations on some fields in our table.

Follow the same previous process in order to create a custom field.

First, let’s add the Shot length and Total team members column of our table and name it Addition.

Syntax to add both columns 

[Shot length] + [Total team members]

 

After dragging it to the table, it will get added to our table, as shown below.

addition operation in tableau

Now, suppose we want to double the team member column; for that, we can use the below syntax.

[Total team members] * 2

 

After adding the field to our table, it would look like the one shown below.

multiplication in tableau

Great! Similarly, we can perform the rest of the arithmetic operations on the table.

Quick Table Calculation in Tableau

Instead of creating a new field for calculations, Tableau provides a quick way to perform table calculations. We can access this feature by right-clicking on the measured values of our table. Suppose we want to find a percentage value instead of a numeric value for the Shot length field of our table. 

We can perform that task as shown below.

quick table calculation steps

After this, our table’s Shot length field will change, as shown below.

quick table calculation result

Similarly, there are various other options available in table calculations for you to explore.

Importance of Tables in Tableau

Now that we know so much about Tables in Tableau. Let us look at the importance of using tables in Tableau.

  • Tableau tables enable us to organize the data in a proper structure, thus providing us a great data visualization.
     
  • Tableau provides the feature to import and export data in multiple formats such as JSON, CSV, Excel, etc. Thus analysis and report sharing become easier for the user.
     
  • Tableau tables allow users to analyze the data at a granular level. Thus it becomes easier to identify patterns and gain insights from the data.
     

Overall, Tableau tables are a flexible way to structure, analyze and explore the data source.

Frequently Asked Questions

What is a dimension in Tableau?

In Tableau, the dimension field contains the qualitative value that cannot be measured. Tableau treats any field containing qualitative, categorical data as a dimension.

What is a measure in Tableau?

In Tableau, the measurer contains the numeric and quantitative values that you can measure. A field containing a numeric value is placed under the measure.

How can you change fields in Tableau?

You can change a field from continuous to discrete and vice versa by right-clicking on them and selecting the desired option.

What are measures names and measure values in Tableau?

The measure names and values are the automatically generated fields that are used to express different measures present in our dataset.

What are Longitude and Latitude in Tableau?

The Longitude and Latitude are the automatically generated fields in Tableau. These fields are added if your data includes standard geographic fields like country, state, province, city, etc.

Conclusion

This article discusses the Table implementation in Tableau with proper examples. We discussed the process of creating and modifying the tables in Tableau as per our needs. We hope this blog has helped you enhance your knowledge of implementing tables in Tableau. If you want to learn more, then check out our articles.

And many more on our platform Coding Ninjas Studio.

Refer to our Guided Path to upskill yourself in DSACompetitive ProgrammingJavaScriptSystem Design, and many more! If you want to test your coding ability, you may check out the mock test series and participate in the contests hosted on Coding Ninjas Studio!

But suppose you have just started your learning process and are looking for questions from tech giants like Amazon, Microsoft, Uber, etc. In that case, you must look at the problemsinterview experiences, and interview bundles for placement preparations.

However, you may consider our paid courses to give your career an edge over others!

Happy Learning!

Previous article
Introduction to Extract Filter
Next article
Introduction to Context Filter
Live masterclass