Hiring Partners
Segilola Resources Operating LimitedTaviatech TechnologiesFCMBMTN NigeriaAdvans La Fayette Microfinance BankAboki AfricaFirst Bank of NigeriaOPay
← Introduction to Tableau · Lesson 6 of 9

Module Five

📖 Every lesson in this course is free to read right here, no account needed. Create a free account to track your progress, take the exam, and earn your certificate.
6
Module 5: Working with Calculations and Data Analysis Beginner Level Designed for 13-year-olds ``` Module 5: Working with Calculations and Data Analysis

Module 5: Working with Calculations and Data Analysis

Introduction

Welcome to Module 5! In the previous module, you learned how to create charts such as bar charts, line charts, pie charts and scatter plots in Tableau.

In this module, you will learn how to use calculations to understand your data better.

Imagine that you own a small supermarket in Ibadan. You sell rice, bread, milk and other products. At the end of the week, you want to know:

  • How much money did the supermarket make?
  • Which product made the most money?
  • What was the average daily sales amount?
  • How many products were sold?

Instead of calculating everything with a calculator, Tableau can help you analyse the information.

1. What Are Calculations in Tableau?

A calculation is a mathematical operation that helps you get useful information from your data.

For example, imagine you have these sales records:

Product Quantity Sold Price per Item
Rice 10 ₦5,000
Bread 20 ₦1,000
Milk 15 ₦2,000

To calculate the total sales for each product, multiply the quantity sold by the price per item.

Formula:

Total Sales = Quantity Sold × Price per Item

Example: Calculating Rice Sales

Quantity sold = 10 bags

Price per bag = ₦5,000

Total sales = 10 × ₦5,000

Total sales = ₦50,000

Tableau allows you to create calculations like this using calculated fields.

2. Understanding Calculated Fields

A calculated field is a new field you create in Tableau using a formula.

For example, your dataset may contain Quantity and Price, but it does not contain Total Sales.

You can create a calculated field called Total Sales and ask Tableau to calculate it automatically.

How to Create a Calculated Field

  1. Open your Tableau workbook.
  2. Connect to your sales dataset.
  3. Go to the Data pane on the left side.
  4. Right-click in an empty area of the Data pane.
  5. Select Create Calculated Field.
  6. Enter a name for the calculation, such as Total Sales.
  7. Type your formula.
  8. Click OK.

Use this formula:

[Quantity] * [Price]

Tableau will create a new field that calculates the sales value for each row.

Important: The names inside square brackets must match the field names in your own dataset. If your columns are called Units Sold and Unit Price, use those names instead.

3. Understanding Basic Tableau Functions

Tableau provides functions that help you calculate and understand information quickly.

A. SUM()

The SUM function adds numbers together.

Example:

SUM([Sales])

This adds all the values in the Sales field.

If your sales records are ₦10,000, ₦20,000 and ₦30,000, the result is ₦60,000.

B. AVG()

The AVG function calculates the average of a group of numbers.

Example:

AVG([Score])

If three students score 60, 70 and 80, their average score is:

(60 + 70 + 80) ÷ 3 = 70

C. COUNT()

The COUNT function counts the number of non-empty values in a field.

Example:

COUNT([Student Name])

If your dataset contains 50 student names, COUNT can return 50.

D. MIN()

The MIN function finds the smallest value.

Example:

MIN([Sales])

If your sales values are ₦5,000, ₦10,000 and ₦15,000, the smallest value is ₦5,000.

E. MAX()

The MAX function finds the largest value.

Example:

MAX([Sales])

If your sales values are ₦5,000, ₦10,000 and ₦15,000, the largest value is ₦15,000.

Function What It Does
SUM() Adds values together
AVG() Finds the average
COUNT() Counts non-empty values
MIN() Finds the smallest value
MAX() Finds the largest value

4. Understanding Aggregation

Aggregation means combining many values into one result.

For example, imagine a supermarket sells rice on five different days:

Day Rice Sales
Monday ₦20,000
Tuesday ₦15,000
Wednesday ₦25,000
Thursday ₦10,000
Friday ₦30,000

When Tableau uses SUM(Sales), it combines the sales values to show the total.

Total sales = ₦100,000.

When Tableau uses AVG(Sales), it calculates the average daily sales.

Average = ₦100,000 ÷ 5 = ₦20,000.

Tableau often displays measures using aggregations such as SUM or AVG. You can change the aggregation depending on the question you want to answer.

5. Using Calculations to Analyse Student Results

Imagine a school in Lagos wants to understand the performance of its students.

The school has collected these examination results:

Student Mathematics English Science
Ada 80 75 90
John 65 70 75
Mary 90 85 95

You can create a calculated field called Total Score.

Formula:

[Mathematics] + [English] + [Science]

You can also create another calculated field called Average Score.

Formula:

([Mathematics] + [English] + [Science]) / 3

Tableau can calculate these values for every student in the dataset.

6. Creating Conditional Calculations with IF

Sometimes, you want Tableau to make a decision based on a condition.

For example, a school may want to classify students who score 50 or above as Pass and those who score below 50 as Needs Improvement.

You can use an IF statement.

Example formula:

IF [Score] >= 50 THEN "Pass" ELSE "Needs Improvement" END

This means:

  • If the student's score is 50 or above, show Pass.
  • If the score is below 50, show Needs Improvement.

Example Results

Student Score Result
Ada 80 Pass
John 45 Needs Improvement
Mary 90 Pass

7. Using Calculations in Charts

After creating a calculated field, you can use it in your charts just like other fields.

For example, if you create a Total Sales field, you can:

  • Drag Product to the Columns shelf.
  • Drag Total Sales to the Rows shelf.
  • Use a bar chart to compare product sales.
  • Sort the bars to see which product made the most money.

You can also drag Average Score into a chart to compare student performance.

This makes it easier to understand your information without reading hundreds of numbers.

8. Practical Activity: Analyse a Supermarket Dataset

Now it is your turn to become a data analyst!

Imagine you work for a supermarket in Ibadan. The manager gives you the following information:

Product Quantity Sold Price per Item
Rice 10 ₦5,000
Bread 20 ₦1,000
Milk 15 ₦2,000
Noodles 30 ₦500
Soft Drinks 25 ₦800

Your Tasks

  1. Enter the information into an Excel spreadsheet.
  2. Connect the spreadsheet to Tableau.
  3. Create a calculated field called Total Sales.
  4. Use the formula [Quantity Sold] * [Price per Item].
  5. Create a bar chart showing each product's total sales.
  6. Use SUM to calculate the total sales for all products.
  7. Use MAX to find the product with the highest sales value.
  8. Use AVG to calculate the average sales value per product.

Challenge Question

Which product made the most money for the supermarket?

Can you explain how your Tableau chart helped you find the answer?

9. Key Terms to Remember

  • Calculation: A mathematical operation performed on data.
  • Calculated Field: A new field created using a formula.
  • SUM: Adds values together.
  • AVG: Calculates the average.
  • COUNT: Counts non-empty values.
  • MIN: Finds the smallest value.
  • MAX: Finds the largest value.
  • Aggregation: Combining values to produce a summary.
  • IF Statement: Makes a decision based on a condition.
  • Data Analysis: Studying data to discover useful information.

10. Knowledge Check

Answer these questions to test what you have learned.

Question 1

What is a calculated field in Tableau?

  1. A new field created using a formula
  2. A picture
  3. A computer game
  4. A website

Question 2

Which Tableau function adds values together?

  1. MIN()
  2. SUM()
  3. MAX()
  4. COUNT()

Question 3

Which function calculates the average?

  1. COUNT()
  2. MAX()
  3. AVG()
  4. MIN()

Question 4

What does MAX() do?

  1. Finds the smallest value
  2. Finds the largest value
  3. Counts names
  4. Deletes data

Question 5

Which function finds the smallest value?

  1. SUM()
  2. AVG()
  3. MIN()
  4. COUNT()

Question 6

What is the result of adding 10, 20 and 30 using SUM?

  1. 30
  2. 40
  3. 60
  4. 100

Question 7

Which formula calculates total sales?

  1. [Quantity] + [Price]
  2. [Quantity] * [Price]
  3. [Quantity] - [Price]
  4. [Quantity] / [Price]

Question 8

What is the purpose of an IF statement?

  1. To make a decision based on a condition
  2. To delete a worksheet
  3. To close Tableau
  4. To change a computer password

Question 9

What does COUNT() count?

  1. Only the largest numbers
  2. Non-empty values in a field
  3. Only pictures
  4. Only charts

Question 10

What can you do with a calculated field after creating it?

  1. Use it in a chart
  2. Use it in data analysis
  3. Use it to create summaries
  4. All of the above

Module 5 Summary

Well done! You have completed Module 5.

In this module, you learned how to:

  • Understand calculations in Tableau.
  • Create calculated fields.
  • Use SUM, AVG, COUNT, MIN and MAX.
  • Understand aggregation.
  • Calculate student scores and supermarket sales.
  • Use IF statements to classify information.
  • Use calculated fields in charts.

Remember, Tableau is not just for drawing charts. It also helps you calculate, compare and understand information.

Coming Up in Module 6

Building Interactive Dashboards

In the next module, you will learn how to combine different charts into one interactive dashboard. You will also learn how to use dashboard filters and actions to explore information easily.

Keep practising. You are becoming a data analyst!

🏆 Get Certified

🔒

Earn this certificate

Every lesson is already free to read. Sign up, finish the lessons, pass the exam (₦2,000 or 20,000 coins), and get a verified certificate with your name on it.

🎓 Sign Up to Get Certified
🛠️ Practice Tools
Hands-on simulators & labs - subscription required.
→
🎯 Internship Tasks
Real-world tasks to build your portfolio - unlock them with a subscription.
→