Transcripts
1. Course Introduction: Welcome to this very unique
course to Master Tableau. My name is Bar Zal kine, and I'm currently leading
big data projects at Marcie Pence with over a decade of experience in big data, data visualizations and
business intelligence projects. And I'm very excited to be your instructor for this course. In this 20 1 hour course, I'm going to be sharing
everything that I know about one of the most in demand skill in data science and data visualizations Tableau. So that by the end
of the course, you're going to
be able to create amazing dashboard and
visualizations in Tableau, like I do in the real projects. I designed this course to
take you from zero to hero. So if you are a beginner,
don't worry about it. I'm going to explain
everything from the scratch, step by step. So that means this
course assumes that you don't have any skills
in data visualizations. And as well, all the skills that you can learn in
this tablea course, like data moduling and so on, could be used in any other
tools like Power BI and click. Now, of course, you might
ask yourself what makes this tablea course different and unique from all other
online courses. This is the only course
that breaks down the complex concepts of
Tableau into animated visuals, because visuals are
very powerful to make complex concepts easy to
understand and to follow. And in this tableau course, we're going to present over
250 animated sketchnes of tableau concepts. Understanding the
concepts and how Tableau work can make you a professional and expert in data visualizations and tableau. And in this course,
I'm going to provide you with tons of free materials. Like for example, I've prepared three different data
sources for this course. We can use in all our tasks and examples through the course. And as well, I'm
going to provide you with three tableau sheet sheets. One sheet sheet for
all tableau concepts, another one for all
tableau calculations, and we have one more
sheet sheet for all the visuals to help you
choosing the right chart. So having those
three sheet sheets, you don't have to
memorize everything. You have a quick reference and access to tableau concepts. As well, you have access
to all Tableau files and dashboard that is created
during the course, and as well, all the skechns of each
section are available to you to download so you can
use it later as a reference. And in this course,
I've prepared more than 250 quizzes in order to challenge your
new skills in Tableau. As well, special about this
course, that is taught by me. I'm not just another
online instructor. I worked and still working in big data projects in major companies in Germany,
like Marcid Spence. So that means I'm teaching
real life skills. I'm going to provide you
with tons of best practices, tips and tricks that I have collected in the last ten years, working in real life projects. But don't take it from me,
here it from my students. So now let's have sneak pick
about the table course. We will start with the basics? What is business intelligence,
data visualizations? What is tableau, and
then you're going to learn the table
product suites. And after that, we're
going to do deep dive into different tableau concepts
like the table architecture, dimensions, measures,
discretes, and continuous data? After that, we're
going to deep dive in table calculations
and functions. You're going to learn more
than 60 different functions in Tableau to
manipulate your data. And after that, we're
going to go and cover more than 63 different
types of charts in Tableau. And then at the end, we're
going to go and implement table projects similar to the one that I do in
real life projects. Now the question is, how is this course If you
are someone that has never build any
data visualizations using tools like Tableau or BPI. I will be with you in
this course in each step, starting from the fundamentals, and we're going to end up
having the advanced topics. And this course is
as well for you if you are already a
tableau developer. So I would suggest for you
that to take a look to the course curriculum and start at the level
that suits you. I have covered a lot of
advanced topics and you're going to have a lot of best
practices in this course. And this course is
suitable for you if you have experience
in any other tools like BPI and you would like to pick up a new
skill in Tableau. And now, what are you
still waiting for? Roll now and join me in this very amazing
tableau journey. So let's jump in
and get started.
2. Course roadmap: Now we're going to have a quick overview of
the Tableau course. I have splitted this course
into 15 different sections. For example, we're going to learn what is business
intelligence? What is data visualizations? What is Tableau and the
history of Tableau. And why Tableau is a
very powerful tool for data visualizations. After that, we're going
to go and deep dive into the Tableau product suites. We don't have Tableau
only one products. We have eight
different products, so I'm going to go and introduce
you to those products. And we're going to go
and compare them side by side for you to understand
the differences between them, and I'm going to
help you to choose the right products
for your project. Moving on, we're going to go and deep dive into the
tableau architecture. Here we're going to learn
many different concepts like what is live and
extract connections? What are the different
types of tableau files? And then we're going
to deep dive into the tableau architecture in
order for you to understand the main components of the architecture and how
Tableau internally works. After all those theory, we're going to start
preparing your environment in order for you to practice
with me in this course. So we'll go and
download and install Tableau for free
of course at PC. We're going to go and create
a free public accounts. We're going to download
the training datasets, and we're going to publish
our first visualization. And the end the ends, I'm
going to take you on a tour in order to make you familiar
with the Tableau interface. After we have repaired
your environment, we're going to start
with the first how to create a data
source in Tableau. And here you go to gain skills
about the data moduling we're going to go
through the basics of data moduling and as well, how to do moduling in Tableau, and then we're going
to go and learn four different methods on how to combine tables in
Tableau using joints, union, relationships,
and data blending. Of course, we're going
to go and compare them side by side for you in order to understand the
differences between them and when to
use which method. And at the end of this section, we're going to go and
create two data sources. Moving on, we're going to
start talking about the metadata. Here, you're going to learn very important
concepts in Tableau. The data types,
dimensions and measures, discrete and continuous values. Once you understand
those concepts, you can understand how to create visualizations
in Tableau. After this section, we
have a small section about renaming. So here we're going
to talk about the naming conventions
that each developer should Then we can learn the
different techniques on how to name columns and
tables in Tableau. And at the end, we can learn how to give elias to the values. Moving on to the next section, you can learn how to organize
your data in tableau. And here we have
different methods, like grouping up the dimensions, using hierarchies,
grouping up the values, using groups and clusters. And then after that,
we're going to learn sets in Tableau. At the end, we can learn
how to create pens in Tableau in order to
create histograms. Now in the next section,
we're going to learn how to filter our
data in tableau. And here, you're going to
learn the different types and concepts of filters in Tableau, how to create them, and
how to customize them, and I'm going to give
you ten tips and tricks about filters in Tableau. And we will learn as
well in this section, how to sort our data. After that, we can learn very important
concept in tableau, which is the tableau parameters. Table parameters are
great in order to add dynamic to your
visualizations. So you're going to learn
the concepts of parameters, Then you can learn different
use cases for that, how to make dynamic
calculations, dynamic reference line, filters, how to swap measures
and dimensions, and to make as
well, dynamic pens. Moving on to the next section, we can learn as well
something about dynamic. So we're going to learn
the tableau actions in order to make your
dashboards interactive. As usual, first, you're going to understand the concepts
of tableau actions, and then we're
going to go through all tableau actions types. For example, how to go to URL how to go to sheets, how to
filter data using actions, and then how to make
highlights using actions and how to change the values
of sets and parameters. After this section,
we're going to have the table calculations. This section is very huge. You're going to learn how
to transform and manipulate your data using four different
table calculations types. We have the role
level calculations, aggregate calculation, table calculation, and
the LOD expressions. In this section, you can learn more than 60 different
table functions in order to
manipulate your data. Moving on to the next section,
we have another big one. We have the Tableau charts. Here we're going to
go and build together more than 63 different
charts in Tableau. So we'll start with the basic
charts like the bar charts, and we're going to
end up building very advanced charts in Tableau. And at the end, I'm
going to help you to choose the right charts
for your requirements. Moving on to the next
one, we're going to learn the Tableau dashboards. We're gonna go step by
step on how to create. Clean dashboards in
Tableau using containers. And now in the last section, we have a table projects. Here in this section,
we're going to go together and implement the projects exactly like I do it in my real
life projects. So first, we're going to
learn the different phases of each tableau projects. Then we're going to start
with the requirements, so you're going to learn how I analyze the requirements
of Tableau, and then we start with the implementations
of the projects. So we're going to go and
build the data sources, the charts, and two
different dashboards. So with that, you're going
to get familiar on how to implement projects and
companies using Tableau. So once you go through
all those sections, you're going to have a solid
knowledge about tableau.
3. #1 Section Introduction | Tableau Basics: Tau basics. Before you start learning how
to use any tools, it's very important
to understand the principles and the
theory behind them. Which can help your career to be a professional developer
and as well an expert. That's why we're going to cover
now the following topics, the bazzords of the big data, what is business intelligence, and what is data visualizations, and why it's very powerful. And at the end, we're going
to talk about what is Tableau and why Tableau is a leader
in data visualizations. So let's start with
the first topic. We're going to go and
learn the main bazzords of the big data.
So now, let's go.
4. Data Buzzwords: BIG Data, IoT, Data Science and More: If you are new to
the world of data, you might start hearing a lot of buzzwords from big data to IOT, data science, data engineering, and phrases like
data is the new oil. In this tutorial, I will be covering some important
buzzwords about the data and what they really
mean. So let's dive in. We are living now in
the data driven age and data is generated
everywhere. We people, we generate massive amount of
data as we speak. Each click on the Internet, each search, e mail, or even if we are
ordering something online, we generate data. We spend hours every day on the social media liking,
commenting, searching, Our smartphone is just all time uploading data about
where you are, how fast you are moving, and everything we do online is now stored and tracked as data. Not only our smartphones
and computers are connected to the
Internet and generates data, but also we have something
called Smart Home. We can connect any device at
our home to the Internet. Just put the word
smart before it. We have Smart mower,
smart lightning, smart fitness, voice
devices, security systems. All those devices could be connected to the
Internet and start generating massive
amounts of data and this is what we call
Internet of Things IOT. IOT is the concept of
connecting any device, anything to the Internet in order to generate
and exchange data. Not only we have IOT at our
home, but also everywhere. We are living in the
digital transformation. In the industry
and manufacturing, you might heard of the
concept industry 4.0, the first industrial revolution
introduced in Germany. It's all about spot factories, connecting machines
and devices to the Internet in order
to exchange data. And now we can find
IOTs in the cities. We are trying to implement
those smart cities where we're going to connect everything
in order to reduce waste, saving money, improving quality. We have as well
IOTs in our cars. Our cars are loaded with
sensors and devices that are connected to exchange data for many reasons like
driver assistance, object recognition,
self driving systems. The list is just so long. In 2022, we have around 14
billions of physical devices, things from small household
cooking devices to the sophisticated
industrial machines that are connected
to the Internet, generating and exchanging data. The amount of generated
data every day from IT, social media websites, machines
is truly mind blowing. They are currently
over 44 zetabytes of data in the entire
digital universe. That is 2010. That's means we are no longer dealing with normal
traditional data. We are dealing now
with the big data. So what big data means? There's three indicators
that help us to understand whether our data is big and they are defined
by the three. The first v is v Well,
big data is big. With the growth of the Internet, mobile devices,
social media ITs. The amount of
generated data from those sources has
grown dramatically. The second V is velocity. In normal data processing, we use to process slow data, or we call it patch data
once a day or something, and then we store
it in the disc. But in big data words, the sources are generating streams of data with
very high speeds. That means we have
to process and analyze the data in
real time fashion, and then we store it in
memory instead of disc. And the third v is variety. In traditional systems, most
data types could be captured in raw unstructured tables
like database or Excels, but in the big data Awards, data often comes in semi
structured format, for example, several logs in XML or websites, or the data comes in
unstructured format like videos, audios, images, free text. So I big data, we have not only to deal with
structured data, but also with semi structured
and unstructured data. The big data terms means how we can efficiently store, process, and analyze our data
when it has huge volume, high speed and
different types in order to reveal significant
values for the business. But we still have a problem that all those generated
data are raw data. Raw data are just
unprocessed rows and rows of numbers that are
really hard to understand, hard to read badly structured
and almost has no value to the Almost 70% of the
words data are unused. Raw data if left
without processing and refining is just worthless. Waste of money, waste of space, and it generate
digital waste stores in very expensive data centers. And that's why we have
the very famous phrase of the famous British
mathematician Clive Hamby. Data is the new oil. Well, it means that
we have to extract the raw data like we
are extracting oil. We have to refine
it, process it, transform it into something useful and has
valued the business. Well, what this really
means is that most of the companies are sitting on
very big field of new oil, raw data, and most
of them understood that data is their
most valuable asset. They have to extract
it, they have to analyze it in order to reveal insight that could help them in order to make faster
and better decisions. That's why most of
the companies are hiring army of data workers, as we know that demand
for data scientists is increasing rapidly
and the supply is low. Now what we can do
with all those chaos, all those generated
unprocessed raw data. Well, we can do the
following stuff. So what we can do, we can design or build a data architecture. Data architecture
is the process of creating a blueprint
on how we organize, process, and store our data into different layers
for different purposes. So that architecture makes
it easier to manage, protect and access our data. Another thing that
we can do with the raw data is
data engineering. Data engineering is a very
complex process of designing and building data pipelines
and data storages. In data engineering,
we usually build ETL processes to extract the raw data from
multiple sources, then transform it,
and then load it to the target storage
in order to make it highly available and usable for the data scientist or
any other enduser. Another thing that we
can do is data modeling. Data modeling is the process
of connecting the dots. So what we're going to
do is we're going to put all the data into
entities and objects. Then we describe
the relationship between those
entities in order to help us and help the programs to understand how the data
are related to each other. Another thing that
we can do with the raw data is we
can do data mining. Data mining is the
process of analyzing massive amount of raw
data in order to discover knowledge to discover
business intelligence like patterns and trends to solve problems and
to mitigate risks. Another use of the raw data is that we can use it
in machine learning. In machine learning, we are providing the commuters
with two things. First, the raw and
historical data, together with the mathematical
models and algorithms. Once the commuter has
those two things, it's going to start
training and practicing in order to perform
tasks like predictions. So it's like human, the more the machine
practice and train, the better and accurate
the results can be. And next, we can
do data science. Data science is the
scientific study of data, and it compines
three major powers, the power of
programming languages, together with the
mathematics and statistics and the knowledge of specific domain in
order to uncover valuable knowledge and
insights from our raw data. One more thing that we
can use on the raw data, and my favorite one is that we can use data visualizations. Data visualization
is the process of converting numbers
and raw data, which is normally hard
to understand and to read into visuals and
charts like bars, by tree plots in order to make it easier to understand
and easier to read, which really helps in
the decision making. There are many other things and processes that we can
apply on the road data, but these are the major fields of work that we can
use in order to convert the useless
road data into knowledge that has
significant impact of value to the business. All right, guys. So that was an introduction to
big data terms. Next, we will quickly
learn what is business intelligence PI
using very simple example.
5. What is Business Intelligence (BI): Alright, let me tell
you this story. We have shops in three
different cities in Germany. In Stuttgart, we have
shop, Berlin and Hamburg, and our three shops
are generating every business day a lot
of raw data on sales, inventory levels, products,
staff, costs, and so on. And now we have a group
of people that are the decision makers
like managers, HR, finance, and they have many questions
and decisions to make. So they might have questions, for example, what happens. And another questions
about what will happen. Now, if the managers try to find the answers
from the row data, they might find nothing and no answers because
the road data are usually very complex and badly structured and they are
really hard to understand. And that's why
they're going to go and hire some data analysts, for example, in order to help them finding the answers
from the raw data. So the data analyst is
going to go and start analyzing the raw data
by doing some magic, for example, cleaning
up the data, connecting objects together, and aggregating the data
in different levels, and at the end, the result
will be communicated as, for example, spreadsheet
to the decision makers. And in the other hand,
the managers can hire data scientist in order to help them finding
answers about what's going to happen or uncover unknown
facts and insights. So the data science
is going as well go and start analyzing
the raw data. But this time, using
different methods, like, for example, data mining,
machine learning, or train model in order
to find new insights, new knowledge, and
answers the questions. At the end, the output is going to be communicated as well to the managers as
numbers and spreadsheets. Now, both of the data scientist
and the data analyst did amazing job working on the raw data and
analyzing those stuff. But the problem here is that the output might be
hard to understand and read because those
managers are usually people that don't work directly
with the data every day, so this could lead to a big gap between those
managers and the results. And now, in order to bridge this gap and make
everything easier, we can use the power of
data visualizations, and the results presented from the data scientist and the
data analyst should be converted from this
poring numbers and spreadsheets to visuals,
graphs and charts. The visual representations
of the data will just do the magic by making
everything clear and easy. And it's going to
bring very easily the WOW effect once you are
presenting your result. So it's going to
help the managers to immediately find
their answers, and they're going
to start making decisions using the data. This process, we call it a business intelligence
or as a shortcut BI. Alright, so now I
hope you have better understanding what is
business intelligence. Next, we will understand
why visualization is so powerful and what
is data visualization.
6. The Power of Data Visualization: Okay. So now the question is why visualizations
is so powerful, with the symbol of
visual communications, you can make a huge difference since the start of the humanity thousands years ago and early human use visuals
in order to tell a story. And until now in the modern age, the human still uses visuals
in order to tell any story. Because we humans are visual creatures we think in
pictures and individuals. If we see history,
our brain can to it as a visual as an
image in our brain. Study see that's 90% of the information transmitted
to our brain, is visual. But if we read the word tree, our brain has failed
to transform it to a visual before storing
it, which is waistlower. In fact, the human
brain processes visual 60,000 times
faster than a text. More facts about
our brain that we remember most of what we
see and interact with. It's proving that the
human remember only 10% of things we hear and 20%
about what we read, and it's also proven
that we remember about 80% of what we
see and interact with. That's why we have
the famous phrases of a picture is worth 1,000 words. And seeing is believing. Having all those facts, no wonder that in
digital channels, the visual content
is taking over. Posts, tweets, articles, news,
presentations, dashboards. You can find visuals everywhere. So now the question is, what is data visualizations or
sometimes we call it data vis. Data visualizations
is the process of converting boring numbers and raw data into interesting graphical
elements like parts, by three, blots, and so on. Data visualization
brings the data to life, makes you the master of storytelling of the insights
hidden within your numbers. So it's like an art of
converting highly complex, massive amount of datasets, into something very simple, something very easy to
understand and to interact with. Imagine yourself to be one of the managers and you
have two data analysts. One of them is
presenting the result in spreadsheet
filled with numbers, and the other data analyst is
presenting the result with visuals filled with graphic
representations of the data, and both are presenting
the same facts, which report you will prefer. I would go with the
right one because the left one is just dry numbers pouring and unlikely you'll be able to spot any
trends and patterns. The main benefit of
data visualizations is telling a story, which arms you with
tools in order to make the right decision
at the right time. There are many other benefits like seeing the big picture, tracking trends, making
smarter and faster decisions, discovering unknown
facts, patterns, trends, and getting as well
more engagement from the end users by asking
more and better questions. All right. So with that
we have learned what is data visualizations and why it is very powerful
and important. Next, we will compare
Excel to be tools like Tau and why you need
to use Tau instead of
7. Excel vs Tableau: Over and over again, I'm asked the same question. Why I should bother
learning and using Tableau or Bar BI for data
visualizations. If we have Excel. In this video, I'm going
to explain for you my six reasons why we should use a modern BI tool
like Tableau and RBI and not use Excel for
data visualizations. And we start right now. There is around 1 billion users globally are using
Microsoft Excel. I worked in many companies, and I can tell you people are just addicted to
Excel. They love it. They use it for everything
as planning tool, data entry, data analyses,
and data visualizations. But the main problem here is that the more a company grows, the more it generates data. And because everyone is
familiar with Excels, they're going to keep using
them in big data use cases, and they're going to face
really hard time managing those spreadsheets and dealing with the limitations in Excel. In these situations, it's
really time to switch to a modern BI tool or
data visualization tool like Tableau or Bar BI. Now, let me show you how
BI is done with Excel. We usually have
different source systems and data analyst that's
going to go and start exporting manually the data from those systems and
import them in Excel. And then some calculation
is going to be done, and at the end, a report
will be generated. The Excel files then will be axis from different
business users. In the other hand, we can do BI with a modern
tool like Tableau. So what we're going to do,
we're going to connect Tableau directly to
those source systems, and the data analysts can start developing a report or
dashboards in Tableau. And at the end, the
business users will access Tableau in order
to see those dashboards. So far, you can say, Okay, both look really similar. So now let's dive
in in order to show you what is the real
benefit of having a modern BI tool
like Tableau or RBI and the limitations that we have in spreadsheets like Excel. The first benefit is automation. If you are using Excel and
we made some nice reports, it's time now to
update the data, and how we do that in Excel, we update data manually. So some employees have to
sit down every dig and go through the process
of extracting data from those source systems, importing them in Excel, do calculations, and at the end, prepare the reports
over and over again, which is very time consuming. But if you are working with
the modern BI two table, we can automate
this poring task by creating schedule to
referse the data. For example, we can create
a schedule in Tableau. Every day at 7:00 morning. Tableau should automatically
connect to the data sources, pull the data, and
prepare the reports. There's two benefits
of doing that. First, we eliminate
the human errors, which is very common
thing in Excel, and sometimes those mistakes can lead to wrong decisions
and to finance loss. And the second
benefit, of course, we no longer need employees
that is dedicated only for this poring task of exporting and importing data
manually to Excel. Another benefit here
is the capacity. If you are working with Excel and one of our source systems start producing engenerating
massive amount of data. Here we have problem
in Excel because we can handle around only
1 million records. So our Excel file garner breaks, and we're going to start
getting error messages like the data set is too large. So what we usually do in Excel, we're going to go and start
splitting the main file into small multiple files in order to manage the
huge volume of data, which is really hard to manage. In the other hand, if you
are working with Tableau, we don't have to worry
about all those stuff. We have no problem
in Tableau because Tableau is made for
big data use cases. And can very easily handle
massive amount of data. So we might just change
the connection type from Extract to live
in order to handle it. Another benefit is security. If you are working with Excel, it's really hard to
hack into Excel. Even if you are using password
protected spreadsheets, it still can easily
hacked nowadays. And then the users are really used to share their
Excels in e mails, copy TSB, or store it
locally at their commuters, which is not secure at all. All those staffs could cost
the companies a lot if sensitive and confidential data is accessed by competitors. But if you are working with
modern BI two like Tableau, it's going to provide us with
superior security features like advanced access control, data security, network security. Plus, if you're
working with Tableau, we don't have to
export the data. We can just share the
dashboards and reports between employees and only if we
grant them access rights, they can see the data. Another benefit is the
role level security. In many companies, they have a lot of
confidential sources, and they start to
understand how important it is to apply the
principle need to know. The principles
needs to know says, user shall only have access to the informations that their
job functions requires. That means we cannot go and
share all data to all users. We have to have some
data restrictions. For example, a sales employee should not see all
data like manager, and finance employees
should not see all personal information
like HR and so on. That means if you are
working with Excels, we have here again to split the main files into specific
reports for specific rule. But in the other hand, most
of the modern BI tools, they offer a feature called
Row level security RLS. Row level security refers to
restricting the rows of data a certain users can see based on the policies
that we define. Using this technique
going to enforce the need to know
principle and going to make our life easier
by just having one dashboard accessed by
different types of users, and then based on the rule, they're going to
see the data and the informations that
their job requires. Another benefit is
reducing chaos. Let me tell you how we
usually work with Excel. A data science will start exporting data from
one source system, and you're going
to make a report called version one report. And then for other requirements, here going to make a
version two reports. And eventually, we're going
to have a final report. And we have another data and is working in different
source system, and the same thing going to keep happening a few times
back and forth. And eventually, we're
going to end up having different six
versions of the reports. And if we scale this impact, you'll notice that you are slowly poisoning
your business. And the end user is
going to have to access different
versions of the reports. And now if we ask how old
is the data in our reports, we will get different answers. One version is going
to be ten days ago, another one, eight,
four, and three days. That's means we don't have single point of
truth for our data. And that's why having modern by tools can help
us to eliminate such a chaos and go to help us building a single point
of truth for our data. One last benefit that I would like to talk about is visuals. Although Excel offers
visualizations, but it is sometimes very limited when we are producing
complex visuals. In Excel as well, creating visualizations
is very time consuming, including a lot of manual steps, and those visuals are going to be static and
not interactive. But in the other hand,
if we are using Tableau, everything is going to be
automated and super fast. We can create new reports and views very quickly by
just drag and drop, and they offer way more interactive and
cooler visuals than Excel. All right. The main
reasons why I prefer working with modern BI
tools like Tableau and Power BI and not Excel for data analyses and data
visualizations are automations, security, big data use cases,
and interactive visuals. It's not about Excel
versus Tableau. It's all about using
the right tool for the right use cases and
not to misuse a tool. Excel is a great tool that
is used by billions of people because it's
very easy to use sheet, professional spreadsheet for data entry and
complex calculations. But when it comes to data analysis and data
visualizations, we have way better tool than
Excel like Power BI and Tau. You can still use them together. For example, you can do your complex calculations in Excel, and the final result can be imported in Tableau in order to do better visualizations and to get more insight
about the results. The thing is the word is
changing very fast and the companies are generating
massive amount of data. So instead of using traditional
spreadsheets like Excel, we have to use more
powerful tools in business intelligence to help
us quickly find insights, trends, patterns in order to make faster and
better decisions. All right, guys. So with that, you will no longer have
to rely on Excel for data visualizations and
can start using BI tools. Next, I will show you quickly the top three BI tools
for data visualizations, and what is my favorite BI tool?
8. Best 3 Tools for Data Visualization: So now the question is, what are the best tools
for data visualizations? A leading research
company called Gardner published every year the Gartner Magic
quadrants to show who are the leading product
in specific domain. And if you check the
magic quadrants for analytics and business
intelligence platforms, for the last ten years, you can almost see
always the same leaders. We have Tablo
PowerBI and cliVew. Since 2012, and I'm working with a lot of data
visualization tools, And I can say that although three tools are
really great tools. They have the advantages
and disadvantages. But by just checking the
data visualizations aspects, I can say that Tableau is here a winner because data
visualizations in Tableau is a core concept and really the best tool for data scientists
and for pig data. All right. So with
that you have learned, what are the three top BI tools? And you know by now
that Tableau is my favorite data
visualization tool. Our next step is to
introduce you to Tableau. We will cover what is Tableau, its history, and its mission.
9. What is Tableau?: The first question
is, what is Tableau? A quick answer could be
Tableau Helvs to convert this do this without any
technical or programming skills. Tableau converts complex
and boring raw numbers into beautiful
visuals and chart, which is really
easy to understand. The key features in
Tableau is interactivity, easy to build, and to use
and fast performance. We can call Tableau with many names like a data
visualization tool, a business intelligence
or BI tool, or sometimes we call
it a reporting tool. Well, Tableau is all of them, but I choose to call a Tableau a data visualization
tool because data visualizations is the
core concept of tableau. Now, let's have a quick
history about Tableau. In 2003, Tableau was
founded by three guys, Pat, Christian and Chris,
as a result of computer science project
at Stanford University. They focused in
visualization technique to analyze data
inside databases. And then in 2019, Tableau was acquired by Salesforce in a deal
worth over 15 billion. And for the last ten years, Tau was named as a leader in Gardner Magic Quardans for
Business Intelligence. Tableau has a clear
mission to help people to see and
understand their data. They really focus on keeping Tableau intuitive
and easy to use. That's why Tableau
does not require any technical or
programming skills in order to build amazing
dashboards and insights. That means the target
audience of Tableau is not only for technical users
like IT, data analyst, data scientist, but also for all other non technical
users like a business user, and end user, a
teacher and so on. This aspect is a game changer of changing the old
mindset of having only IT and technical
people working with data and building
visualizations. But now we have modern data visualization tools
like Tableau, which opens the door for everybody to start
working with data. That's why tools
like Tableau helps organizations to be data driven. And now Tableau is widely used. You can find Tableau almost in all organizations,
industries, sectors, in all departments because
most of those organizations want to empower their employees
with tools like Tableau, in order to make better, faster and smarter
decisions using data. All right. So with that, I
hope you have now better understanding what is
Tableau and its mission. Next, I will show you
my top four reasons why I think Tableau is a
leader in data visualization.
10. Why Tableau?: Tableau is not the
only leader in business intelligence and
data visualization market. There are many other
tools that are available like PPI,
click view, and so on. But now if you ask me what
makes Tableau so special? Why Tableau is so widely used, I would give you four reasons. The first reason is performance. The sources now are generating
massive amount of data, and Tableau is designed
and optimized to handle huge volumes of data without embarking the
performance in the dashboards. And that's because Tau is using high performance in memory
data engine to help analyze large datasets
where the data can be stored inside
columns instead of rows, which can boost the
performance in dashboards. Tableau has no
limitations or whatever to the number of data points
in the visualization. For example, on this view, we have over 1 million data
points without any problem. This allows us to analyze large datasets in
order to find trends, patterns with great performance, and all other tools still enforce row size data
point limitations, which is not really
helpful for data analyses. The second reason is quick and interactive
visualizations. Compared to the other
tools with Tableau, we can create rich and
beautiful visualizations in just a few seconds. I'm going to show you
now quick example how to cluster my data and how to
calculate the forecast. In order to do such a
complex job in Tableau, we will just use drag and drop. Let's see how simple
it is. All right. So we're going to
go to the orders, take the sales, put it
in the columns, profit, and the rows, and take the
order IDs and the details, and I want to see all of
my members over here. And now we go to
the analytics pan and then double click
on that clausurs. With that, I have very nice
four clusters of my data. The next step, I will create
a forecast of my data. I'm going to take the order ID, put it on the columns, and then we're going
to take the sales. I would like to change
the visual 2 bars, so I have now here
around five years. What we're going to
do, we're going to go to analytics and just click on the
forecast, and that's it. I have a forecast of
two years of my sales. Now, I'm just going
to go and put them together in one dashboard. I'm going to create
a new dashboard, drag and drop the clusters, drag and drop the forecasts, I'm going to link
them together with the filter. That's it. So now we have both of them, and if I click around, I will have an
interactive dashboard for the forecast and
for that clusters. The third reason, Tableau
is user friendly. As you can see, we have done
very complex analysis with just dragon drop without
writing any code, and this is exactly
what Tableau wants. It's very intuitive
and user friendly, and this is the major
strings of Tableau. It just opens the door for all non technical users
to have a chance to work and play with data to solve their daily problems
without the need of IT. But in the other hand,
Tableau is integrated with programming languages
like Python and R, which opens another door for advanced data
visualizations, which might be used
from data scientists. And the last reason
is community. If you are working with Tableau, well, you are not alone. You have a huge
Tableau community. In the community, we have around 2 million students and teachers, and in Tableau Public, we have around 5 million data visualizations
that are published, and there's around 200,000
questions and ideas. That are shared in
Tableau forums. Having such a huge community
is a big plus for any tool. It's very important
because while you are working with data, you might face some problems
or you have questions. It's very important
that you have a place where you can go and ask your questions and get advice from other developers
all over the world. And not only that, you
can as well get inspired from the shared visualizations
from other developers. You can find the important links about the tableau community in the video description
below. All right. So my four reasons
why Tableau is one of the best tools for data
visualizations are. Tableau can handle
massive amount of data very suitable for
big data use cases. It offers beautiful, quick,
interactive visualizations. Tableau is intuitive
and user friendly, no coding or technical
skills are required. And the last reason, Tableau
community is very huge. One more thing that I
would like to add that data visualizations is really one skill that you
have to master. As a data sentist
or data analyst. And tableau is an amazing
tool for data visualizations. That's why I highly recommend to learn or to
get familiar with Tableau. It's going to be like
a huge advantage for your career.
All right, guys. So with that, you know,
my reasons why I think Tableau is a leader in data
visualization, and with that, we have finished the
first chapter of Tableau, where we have covered a lot of important terms of
data and tableau. And in the next chapter, we will have an overview of
the Tableau product suite, where I will introduce you to eight different
tableau products.
11. #2 Section Introduction | Tableau Products: Table products. In tableau, we have eight
different products, and it's really
important to understand them and understand the
differences between them. So that's why I'm going
to go and give you a quick overview of all
eight tableau products, and then we're going
to go and compare them side by side in order to understand the
differences between them and add the end canon, the decision making
process that I usually follow to choose the right
product for your requirements. So now let's start
with the first topic where we can have an overview of the development process and products. So now, let's go.
12. Tableau Development Products & Process: All right, guys.
In this chapter, I will introduce you to
Tableau product suite to understand the
differences between the eight tableau products. And we will start with the
Tableau development products. All right. If you think Tableau is only one software,
then you are wrong. If you visit the
homepage of tableau, you will find many
different table products like Tableau disco, public server,
cloud prep reader. I can say other starts, it might be confusing having
all those tableau products. But don't worry about it. I'm going to explain
them one by one. So you can choose the
right combinations of tableau products for you
or for your organizations. It's really important
to understand the differences between them, the functionalities
and the limitations of each tableau products. And let's dive in. So Tableau product suite contains eight
different products. We have Tableau disktop,
Tableau Public disktop, rep server, cloud, Public Cloud, reader and Tableau mobile. All right, the first thing
to understand is that we can split those products into
two main categories. Developer tools
and sharing tools. Tableau developer tools,
as the name implies, there are tools that
are going to help you to build data visualizations, by creating and designing
dashboards, charts, reports, or to do data preparations
or data engineering, by preparing the data
for data analysis. Under this category, we can
find three ta products, Ta disktop public disctop and Tableau Now in the other category, we
have the sharing tools. Those tools can help you
to share and collaborate your work that you have done and created using the
developer tools. Under this category, we can
find five table products, Tableau server, Tableau cloud, Public Cloud, reader,
and Table mobile. Alright, so now,
first, let's focus on the table products under the
category developer tools. And now we can go
and as well split the developer tools into two groups based
on their purposes. We have data xlizations
and data engineering. Nunderneth data vixlization,
we find two table products, Tableau distop and
Tableau Public distop and underneath data engineering, we have only one table products, and that's Tableau prep. Alright, so now
after we understood the main categories and the main purposes
of table products, we will go now and talk about the development
process in Tableau. All right, so basically, we have three very simple steps in the development
process in Tableau. The first step, we connect
our data to Tableau. Then in the next step, we start building our data
visualizations to do data analysis by creating report,
chart, and dashboards. And in the third step, we share our work
by publishing it. The two products to
do these three steps are Tableau distop and
Tableau Public distop. In many cases, the quality of our data is bad and not
ready for analysis. That's why we add one
more pre processing step to prepare our data before we
start building our visuals, and we can use for this step
the product Tableau prep. Alright, so now let's do deep dives into Tableau
developers products one by one in order to understand the key
features and as well, the limitations for
each one of them. All right. So with that,
we have an overview of the development
process and the products. And next, we will
have a quick overview of the tableau disc top.
13. Tableau Desktop: To Disk Top is a software you download and
install at your PC. With tabletop, you can connect to many
different source types. There are over 90
data connectors. You can connect to Tableau
server or to connect to files like
Excel, text, Jason, or to Prem servers
like MySQL and Oracle, or to cloud like Amazon
Google and Microsoft Azure. Once you connect
Tableau to your data, you can start building
your data visualizations. In Tableau dicto, you will find many tools and functions to help you creating charts reports
with just drag and drop, and then you can combine those different reports into
interactive dashboards. After you've done building
your views and dashboards, then you have three
options to share your data by either publishing
them to Tableau server, Tableau cloud, or to
Tableau Public Cloud, or even you can store your
workbooks locally at your PC. All right, Tableu distob is the backbone product of Tableau. As tableau developer,
you're going to spend 90% of your time
using this tool. Tableau Discob is
a developer tool to build data visualizations, where you connect your data, build dashboards and
then publish them. Oddly Tableau distob is not a free tool like
Power BI distob. In order to work
with Tableau distob you have to buy a license. I think they offer some
kind of trial phase, or if you are a student, you get one free year. Don't
take my words. It's better to check
the current offering from Tableau in their home page. With Tableau distob
you can connect over 90 different data sources. You can publish as well your work everywhere
to Tableau Server, Tableau Cloud and
Tableau Public. And since Tableau distob
requires a license, you don't have any
limitations or whatever on how many roads and data
you can store and process. Tableau distob is meant for data analysts, data scientists, PI developers who work professionally in companies
in data analytical projects. All right, so that's
just a quick overview of the Tableau discTop. Next, we will check the
Tableau Public disktop.
14. Tableau Public Desktop: Table Public is the free
version of Tableau distob. It is very similar to it. It's a developer
tool in order to build and publish
data visualizations, and since it's free and
requires no license, it comes with feel limitations. In Table Public, we have
around ten data connectors. You can connect only
to local fights at PC. Another limitation of
that you can store and process only 15 million
rows of your data. And you can publish only
to Tableau Public Cloud. So that means you cannot
publish your work in Tableau server or
Tableau Private Cloud, and the last limitation
is that you cannot store your workbooks
at your local PC. But here, I have to be fair
that the most important part of that all functions
and tools in order to build visuals and dashboards are completely available
in Tableau Public like tableau dictob
which makes really Tableau Public as a
great alternative and tool for beginners in
order to practice and to learn Tableau before
they go and buy licenses. To be honest, that's
why I decided to go with Tableau Public
in all my tutorials so that anyone can
follow and practice with me without having
you buying any licenses. All right. So with that, we have a quick overview of the
Tableau Public Disktop. And next, we will check the data engineering
tool Tableau Prep.
15. Tableau PREP: To prep builder is a software you download and
install at your BC, and you can use it to prepare your data before you
start analyzing it. Same as Tableau disktop you can connect to many
different source types. There are over 90 data
connectors like Tableau server, files, prime, cloud, and so on. Once you connect
Tableau to your data, you can start building data
flows where you have access to tools and functions to help you to
transform your data. For example, combining data, cleaning, filtering,
aggregating, and all other art of data engineering tasks to prepare your data for
data visualizations. At the end of your data flow, you can store the
new prepared data in three different places, either as a file at
your local PC or publish it as a data source
in Tableau server or Cloud. And the last option,
you can write the output directly
in databases. And after you are done
building the data flows, then you can publish them in Table server or ta
online for automations. In table prep you have
the option to store your data flows locally
at your PC. All right. Table Prep is a data
engineering tool to prepare our data to get
ready for analyses. Sometimes the data that we are connecting to
Tableau disctop has bad quality and we cannot use it immediately
in our dashboard. That's why we spend hours
and hours of cleaning up, organizing, combining,
preparing our data, and that could be
really time consuming. So for this situation, we could use trip to help
us with this process. The table Brib is a
developer tool for data engineering where
we connect to our data, build data flows, and
then publish them. And it's not free tool. It requires a license. In table rib, we have over 90
different data connectors, The output of the data flows
could be stored locally at your PC or as a tableau data source or
directly in the databases, and we can publish
the data flow either to Tableau server or
to Tableau Cloud. To Prep is not like
table disktop. We don't have any
free version of Tablea prep so there is
no Tableau Public prep. All right, so that's was a
quick overview of the ta prep. And next, we will compare all the three tableau development
products side by side. And I will work you through my decision making process to choose the right
product for you.
16. Tableau Desktop vs Public vs PREP: All right, so now let's
go and have a summary of the three products where we're going to compare
them side by side. The main purpose of
table distob and public is to generate
data visualizations, but the main task of To Prep
is for data engineering. Now, if you are talking
about the costs, both distob and Prep
requires licenses, but to Public is free to use. Now, about the security
aspect of the data, Tableau disto and
prep are secure, since you can publish
them to private servers. At Tableau Public, you have
to publish your work to public platforms where
everyone can see your data. So you cannot secure your
data in Tableau Public. And the next point, data limits. Since public is free, it comes with the limitations
of 15 million rows. But disktop and Prep, you will got no limitations. The next point is connectors. In both disktop and Prep, you have over 90
different data connectors like files, API, servers, Cloud, and so on, where in Tableau Public, you can connect only to files. And if we talk about the
live connections aspect, the only tool offers a live connections to your data sources
is Tableau disktop. You cannot make live connections in Tableau Public
and in Tablea Prep. You have always to work
with extract data. The next point is about
storing your files locally. Both Tableau distob and
Prep allows you to do that by storing your
work locally at your PC. But in Tableau Public,
you cannot do that. Instead, you have always to publish your work to
Tableau Public Cloud. The last aspect is about
the target audience. Tableau distob is made for data scientists
and data analysts. But tableapublic is
made for anybody who wants to work with
data visualizations, and Tableau prep is made
for data engineers. All right, so now with this, we have good overview of the three to products
for development, and now comes the question
when to use which product. So now, let me guide you in my decision making process using the following flu charts. First, we asked the
question for which purpose. If we need a product for data engineering,
then it's easy. We have only one to product, and that is Now, if we need products for
data visualizations, then we can ask more questions. The next question, do we
need to connect to server, ABI databases or to Cloud? If the answer is yes, then we have to
use Tableau dctop and if the answer is no, then we ask the next question. Can our data be public? If the answer is no, our
data is confidential, then we have to use
Tableau disctop. But if the answer is
Our data can be public, then we jump to
the next question. Do our data sources contain
more than 15 million rows? If yes, then we have to
choose Tableau distob. But if the answer is
no, our data sources have less than 15 million rows, then we jump to
the last question. Do we need to have live
connections to our data sources? If the answer is yes, then we have again to
choose Tableau distob. But if the answer is no, then finally, we can go and use Tableau
Public. All right. So if you follow those
questions and this chart, You can easily decide when to use which table
product. All right. So with that, we have covered all the tableau products
for development. And next, we will start talking about the table
products for sharing. So let's first understand
the sharing process.
17. Tableau Sharing Products & Process: All right, y. So in
the briefest tutorial, we splitted Tableau products
into two main categories, developers tools
and sharing tools. Now we're going to focus
on the second category, the sharing tools where
we have Tableau server, Cloud Public Cloud, reader,
and Tableau mobile. And as the name implies, those products can help us to share our reports and
dashboards with others. And in the last tutorial, we have talked about
the four steps of Tableau development process. Now we're going to do deep
dive in the step number four, where we're going
to talk about the different options that we have in order to share our reports and
dashboards with others. If you want to
share your visuals with your colleagues
in your organization, then we have here a few options. First, you can install
Tableau server products on servers using the infrastructure
of your organization, and then you can
start publishing and sharing your dashboard. Then your colleagues
can either use their web browser or they
can use T Mobile app on their smartphone or
tablets to view and interact with your dashboards
directly from the server. The second option we have, we can install to
server products on Cloud service providers
like Amazon AWS, Microsoft Azure or Google Cloud, and then you can publish
your dashboard there, and the same thing here, users can use web browsers or Table Mobile in order
to access your work. The Third option we have, you can use Table
Private Cloud service. Here you don't have to install any Table
server or anything. You will get everything
prepared from Tavla Team. You can start immediately
publishing your dashboard there and your users can
consume it from TavlaCloud. And now, let's say you want
to share your dashboards with everyone in the
world and make it public. Then you can use
Tableau Public Cloud. You don't have to
install anything. You can immediately publish
your dashboard there, and users all around
the world can use their web browser to access
your dashboards and data. But they cannot use mobile app in order to
access Tableau Public. And now to the last option that I really don't like to use. If you want to share your
repoards to individual users, you can send them a tableau
file with the format T WBX Tableau packaged workbook, which contains your data plus your reports
and dashboards. And then the users can
view this file using Tableau reader software
installed at their PC. All right, so with that,
we have an overview of the sharing process and the different options on
how to share your data. And next, I will
introduce you to three methods of
hosting Tableau.
18. Hosting Tableau: On-Prem vs IaaS vs SaaS: All right, everyone. Now
in order to understand the real differences between Tableau Server and
Tableau Cloud, we have to understand
the back end details and some basic concepts
about hosting servers. Let's go. Let's say we are startup company and
we want to host our own tau application and build the entire infrastructure
for that reason. There is a long list of
tasks that should be done. Of course, the first thing
that we need to do is to go and buy some hardwares
and configure them. Like servers that will
run the applications, and each servers need
as well storage, so we have to provide additionally
storage infrastructure like some hard disk
driver and SSDs. Servers needs to be as well
connected to the Internet. Therefore, we have to provide as well all the networking
infrastructure. Once we have all those stuffs, then we have all
hardware needed. The next thing that we need
to do is that we go to go and start installing and
configuring some softwares. Like we can install
an operating system, for example, windows or linux
and many other middlewares. Once the operating
system is in place, then we have to install and configure Tableau
server application. Once we have all software and
hardware ready and running, it's finally now the time to
set up our tableau project. We have to manage
the following tasks. We have to start adding users to the Tableau server and map
them to the correct licenses. We have as well to
curious schedules and tasks to refresh our data
inside Tableau server, and then we have to start
monitoring the tableau jobs. All right. So now we come to the big question that
we have to answer. Who will manage what? The first option you have
if you decide to manage all these liers that means we are talking about the
on premises model. So it's clear ownership. You manage everything
from top to bottom. Hardware, the software,
and the project itself. But now, if you
say, you know what, this is too much to manage. We don't have the money to buy all those stuff and
hardware at the starts, and we don't have the time to take care of them
and maintain them. Then you will start thinking about outsourcing the hardwares, where you're going to
buy a service from Cloud providers like
Microsoft Azure, Amazon AWS, or Google Cloud. Now that they manage
the hardware and you manage both
software and projects. And this is what we call
infrastructure as a service, IS the first letter
of each word. But now, if you
say, you know what, our IT team is very small. We don't even have the time to keep those softwares updated. Each time Tableau
makes a new release, we have to install a new
version of Tableau server, which is really
wasting our time, and we are not able to focus on our core
business projects. We don't have the resources
to manage our own software. Then you start thinking about outsourcing the software layer. To do that, you can buy
a service from Tableau. It's called Tableau Clouds, where Tau team going to
manage everything for you, both hardware and softwares, and this is what we call
software as a service stats. Okay, guys, so now
let's summarize and compare the three
hosting options. The first point is
about hosting setup. On premises, you need Table server installed in
your organization servers. In IS need as well Table server installed in Cloud
service provider, for example, Microsoft Azure, and in SAS, you just buy
Table Cloud product. Now for the question,
who manage what? In on premises, you
manage everything, the hardware, software,
and your projects, and there is no outsourcing. In IAS, you manage both
software and your projects, and the cloud service provider can manage only the hardware. In SAS, you manage only your business
projects and Tableloa can manage both
hardware and software. So now let's check
the advantages and disadvantages of
each service model. For the on premises, the good thing here is that you have full control of everything, the hardware and the software, and your data remains
behind your firewalls. This is very
important if you have critical or sensitive
information that should not stored outside
of the company's firewall. But the drawbacks here, you need a dedicated hardware
and software administrators to deal with the maintenance, patching, and many other tasks. It is very costly at the
start of the projects. You have to pay a lot for the hardwares and the softwares, and it's not flexible. It's really hard to scale up or scale down your
hardwares as needed. Having all those
stuff, generally, you have less time for
your business projects. Alright, so now let's
move to the IAS. The first advantage it
gives you flexibility. You can scale up, scale down the hardwares as
the business needs. And there is no upfront
cost for buying hardwares. But the downside of IAS
is that you still need administrators to manage your softwares to
do installations, patchings of your softwares. And if you don't pay
attention for the cost, you might end up
paying big pills. Now let's move to SAS. The main advantage in
SAS is that it allows your IT team to focus only on
the core business projects and allows you to implement
projects in very short time The other good thing is
that your software will be always up to date Tableau team going
to deal with that. The downside of SAS
is loss of control. You will be at the
mercy of Talaau team. If anything bad happen
like security problems, all your organization's
data might be compromised. And the other disadvantage is that you might have
bad performance or networking issues
connecting Tableau to your source systems. And my advice that you should avoid reinventing the wheel. Always take advantage
of services that do things not part
of your core business. Every hour you spend patching an OS or installing
update for your software, or replacing hardwares
is an hour not spent enhancing and refining
your dashboards in Tableau. Alright, so with that, we
have learned the differences between those three methods
of hosting Tableau. And next, we will
have an overview of the Tableau server
and Tableau cloud
19. Tableau Server & Cloud: Alright, everyone. So
now we're going to do deep dives into Tableau
sharing products one by one in order to understand their key
features and as well, their limitations for
each one of them, and we start with Tableau
server and Tableau cloud. As Tableau developers
in organizations, we need to share our reports and dashboards with other
colleagues in our organization. So we need to put
those dashboards in a trusted environment or
platform in our organizations, and we usually have
four requirements. The first requirement, it
should be safe and secure. We want to control who is accessing our data
and dashboard. Second, it should
be easy to scale. Third, it should
be robust that can handle huge amount
of users and data. And the last requirement, it should be powerful and
deliver high performance. No one wants slow
dashboards and reports. And now, in order to build this trusted environment
with these requirements, we have two tableau products. Tableau server and
Tableau Cloud, and we have three
hosting options on premises, IS and SAS. Don't worry about the terms. I'm going to explain them.
Tableau server and Cloud, they are very similar at
the user interface level. You will not notice
any differences. But if you are checking
the back end level, there is a big
differences between them. So now, first, let's talk about the user interface level of
Table server and Table Cloud. Once you publish your dashboard to Tableau server or Cloud, you can share them by
providing links to the users across all departments
in your organization. Then the users, they can
access your dashboard using their web browser without installing any
software at their end. If you give them access, they can start
exploring your data. In tsaver or Cloud, you can manage your users by
adding and removing them. Give them specific rules like admin curators
viewers or explorer. You can manage your users as well by adding them to groups. Another important task
you can do in tablesver or Cloud is that you can
automate your tasks. For example, you can create
a refresh schedule to refresh your data sources on regular basis like once a day. In table server Cloud, you can monitor the
tasks and schedules to check the status if the
job failed or succeeded, and you can find many other
statistics about the runtime, the average queue and
error messages, and so on. Not only the users can view the dashboards in
Tableau Server or Cloud, but also they can
create a new one. If you give the
users enough rights, they can even start creating
their own insights and views directly on their web browser without having them
to install any talods It's something we
call self service BI. Alright, so that was
a quick overview of the Table server Cloud. And next, we will talk about the free option Table Public.
20. Tableau Public: All right, everybody.
Now with this, we have clear picture about Tableau Server and Table Cloud. Now let's talk about the
other sharing table products. Tableau Public Cloud is a free cloud service
managed by Tableau team. Everyone in the world can share visualizations in this platform. If you publish your
dashboards in Tableau Public, everyone can access it, interact with it, and
even download it. Tableau Public is
like social media. You can edit your profile and add your personal
information. In Tableau Public, you
have a huge gallery of visas built by people
all around the world. It hosts currently over 5
million visualizations. In Tableau Public,
if you are browsing and you found some
interesting dashboard, like this amazing
dashboard from Ajs, you can add it to
your favorites. And then you can check
what other visas did Ajs created and
published to public. And like any other social media, if you like her content, you can go and follow her
to see her new updates, and if you're inspired of
one of her dashboards, you can go and install
the whole workbook to see how she did build these
amazing dashboards and see all details. With that, you are expanding the knowledge in
Tableau developments. So using Tableau Public, you can get inspired from
others and you can get connected to other
Tableau developers from all around the world. And one more good thing
about Tableau Public, if you are searching
for a new job and you want to flex your data
visualization skills, you can publish a lot of work in Tableau Public and link it in your CV so that
the companies can see how skilled are
you in Tableau. So all these nice features
makes Tableau Public Cloud a very attractive platform
for sharing visualizations. But now, if you are talking
about the security aspects, It is very limited. The only thing that you can
control is not allowed to download your visualizations or you can completely
hide it from others, but you don't have any
user access control like we have in Tableau
Server or Clouds. So Tableau Public Cloud is a free cloud service
from Tableau. We host a lot of reports and dashboards billed by people
all around the world. It's a great platform to get inspired by Tableau community, build connections to
other Tableau developers and share your skills. But since it's free, it
comes with feel limitations. The total size available for each account is
only 10 gigabytes. Your dashboard and reports are not connected to
the source systems. That means you cannot automatically refresh your
data in Tableau Public. Always, you have
to do it manually. So you can open the reports, refresh the data, and again, publish it to Tableau Cloud. And the third limitation of Tableau Public is that
as the name implies, everyone in the world can
see and share your data. That means you cannot use it in organizations since you
cannot protect your data. All right, so that's all for now about the Tableau Public. Next, we will cover the Tableau reader and
Tableau Mobile.
21. Tableau Reader & Mobile: Table reader is a software you download and install at your BC. You can use it only to view
reports and dashboards, but you cannot use
Table reader to curate any data visualizations
or even edited. As you can see, we don't have any tools or functions
to curate charts. You can't even connect any data sources or
refresh your data. Table reader is very
old tool from Tableau. It was created in the
early days of Tableau in order to share content
billed using Table do. This was before
even Tableau server and Tableau cloud
made available. At that time, Tableau reader
was the only option you have in order to share dashboard and report
with other users. So how it works, you build
data visualizations using Tableau disctub and then you
send a file to someone else. Then they're going to use
Tableau reader in order to view and interact with the
dashboard that you built. So to summarize Tableau
reader is a free tool. It is just to view
and interact with report and dashboard Pilt
using Tableau distob. You cannot create or edit
anything in Tableau reader. You cannot refresh the data inside your dashboard
using Tableau reader. Each time you have to ask for a new copy if you want
to have fresh data, and there is no
security features, password protections,
or login option. This is a big
problem. If the files lands on the wrong hand, your organization data
could be exposed. Well, I don't recommend at all, using this tool
in organizations. The risk is just too big. But if you want to
take the risk and to share your visuals with one, two, three persons, then use it. But try to avoid it. T Mobile is a free
mobile app that you can download at your
smartphone or your tablet. You can use it to view
and interact with Tableau reports and dashboards published to Table
server and Clouds, so you can use it only
to view the reports. You cannot use it to create new reports or to
edit the reports. While Table Mobile
is free to download, it requires a license to use, and it can only access
server and Cloud, so you cannot use it in order
to access Tableau Public. Table Mobile can automatically cache your reports
and dashboards, In memory, that means you can access them even
if you are offline. All right, so that
we have an overview of all five tableau
sharing products. And next, we will compare all the five tableau
products side by side, and I will work you through my decision making process to choose the right
products for you.
22. Tableau Server vs Cloud vs Public vs Reader vs Mobile: All right, everybody. So now
let's summarize and compare all tableau sharing
products side by side. The first point about hosting. Table server can be hosted in your organizations or in Cloud service providers
like Azure or Amazon. Both Tableau Cloud and Tableau Public Cloud are
hosted by Tableau Team. Tableau Either will just be software installed at your PC. You can't even host it. Now, if you are talking about the cost, for Tableau Server, you have to pay for licenses,
hardwares, and maintenance. But in Tableau Cloud, you have only to pay
for the license. Tableau Public and Tableau
reader are free to use. Now, if you check the
data security aspects, both Tableau server and Tableau
Cloud are highly secure. Tableau Public and
reader, they are not. Next point is about the
storage limitations. In table server, it really depends on the
server disk space. In Tableau Cloud and reader, there is no limitations, but in Tableau Public Cloud, the total size available for each account is
only 10 gigabytes. The next point about
the connectors. Tableau server and Cloud can be connected to different types
of sources like Cloud, API services, files,
databases, and so on. But Tableau Public Cloud
and Tableau readers, they cannot be connected directly to any of
your source systems. Let's jump to the next
point automation. In Tableau Server and Cloud. You can schedule tasks to
refresh your data inside your dashboards automatically
from the source systems. But the data inside
Tableau Public Cloud and reader cannot be refreshed. You have to do it manually. You have to republish it
or to resend the file. The next point
about Table Mobile, you can connect
your smartphones or tablets only to Tableau
server or Tableau Cloud. Now to the last point, we
can use Table server and Cloud to share dashboards
inside organizations. Table Public is used to share dashboards to
the whole world, and table reader
is used to share dashboards directly
to individuals. All right. So now
with this, we have an overview of all
Tableau sharing products. So now the question is, when to use which product. So let me guide you in my decision making process
following this chart. All right, first, we
ask all questions about the limitations inside
Tableau Public Cloud. The first question,
can data be public? If the answer is yes, then we ask the next
question should the data be frequently refreshed in
the reports and dashboards? If the answer is no, then you can go and use
Tableau Public Cloud. But if the data
should not be public, and should be refreshed
automatically, then we have to think
about private hosting. Now the question now, do you
want to manage the hardware? If yes, then you can use Tableau server on premises
at your organization. But if you don't want to do that and you want
to outsource it, then you ask the next question. Do you want to manage the
software on your own? But if the answer is yes, then you can use
again Tableau server. But this time, it's
going to be hosted in cloud service provider
like Microsoft Azure, in IS service model. But if the answer is no, you don't want to
manage the software by yourself and you want
to outsource it. Then you can go and use Tableau
Cloud as a SAS service. As you can see,
Tableau reader is not in my decision
making process, since I don't
recommend it at all. So now, if you combine
this flow chart with the one that we billed
previously for developer tools, you will get my whole
decision making process that I usually use when I
start a new Tableau projects. So if somebody asked you when
to use which table product, you can go through it and find the right combinations
for you or for a company. All those materials,
you can find it in my website. All
right, everyone. So with that, we have covered
all eight tableau products, and we understood the
differences between them. In the next chapter,
we will learn the tableau architecture
to understand how Tableau internally works and what are the main
components of Tableau.
23. #3 Section Introduction | Tableau Architecture: Tableau architecture. Now
we're going to go and understand how Tableau
internally works, its components, and
its limitations. So now we're going
to go and cover many important tableau concepts, like what is live and
extract connections? What are the different
file types in Tableau, and then we're going
to start drawing the Tableau disc
tub architecture. And then we're going to jump to Tableau Server in order to understand different scenarios like the published process, authentication process, and
accessing view process. And after that, we're gonna go and complete the big picture by drawing the server
architecture and its components. And at the end, we're
going to cover as well, the architecture of
the Tableau Public. So now let's start with
the first concept, the live and extract data
connections. So now, let's go.
24. Tableau Live vs Extract: In this section, you will learn the table architecture
to understand how Tableau internally works and what are the main
components of it. You will learn some
important concepts, and we will start with the
data source connection types, live and extract. Now we come to the most
important decision or questions that we're going
to make inside data source. Do you want to store an extra copy of your
data inside Tau? So here we have two designs
for the data source. Either you're going
to say no, we don't need to copy
inside tableau. The data should stay where
it is in the source systems. Then what happens each time your visualizations needs data, it's going to send squares directly to the
external database. And then the database
is going to send the results back to
your visualizations, so the data comes always fresh from the sources directly
to your dashboards. This type of the connections, we call it a live connection. Are you going to say yes? Let's have a copy of our
data inside Tableau. So a snapshot or subset
of the data going to be copied from the external
database to Tableau. This copy, we call
it an extract. Now each time our
visualizations needs data, it's going to send
queries this time to the extract instead of
the external database, and then the extract
going to return the results back to
your visualizations. Since the extract is inside tableau and very close
to the visualizations, we will get great response time and very fast performance. This type of connection, we call it an extract
connection. All right. Now the question is,
which connection type should I use in my data sources. The typical answer for this question is,
well, it depends. Because here we have a trade off between performance
and data freshness. For example, if
for a performance is way more important
than the data freshness, then you have to go
with the extract. Since the data going
to be stored inside Tableau in memory using the
column store technique, you will get just
great performance. But if you say, you know what, the data freshness for me is more important
than the performance, Then you have to go with
the live connections in your data sources
because you will always get the fresh data directly from the sources
in your dashboards. All right, so that's
just a quick overview of the two data type connections in Tableau, live and extracts. Next, we will learn
the different types of files that you can
generate in Tableau.
25. Tableau File Types: All right. Now, if
you want to send tableau files directly
to the users, we have to ask the question, which type of files
we're going to send? Because in Tableau disto we can generate not only one file, we can generate five different
types of files in Tableau. Now we're going to have quick
overview of those types of files to understand them and
to know when to use them. All right. So as we
learned, the Tableau book contains three things. Extract, the data source,
and the visualizations. There is a file type for each compination depend
on your requirements. For example, if
you want to share only your data without
anything else, no data source, no visualizations, then you can send an extract as
a hyper format. But now if you say,
you know what? I've done a lot of work
in the data source. I built the data model. I renamed staff. I
did aggregations. I created a lot of new columns, so I would like to share that with my team with my colleagues. And I'm not allowed to
share my data with them. So in this situation,
you say, okay, I'm going to share the data
source with my colleagues, and we call it Tableau data
source, TDS without data. Or you might be in other situations where
you say, You know what? My colleagues don't have an
access to the source systems. We cannot use the
live connection. And you don't mind sharing
your data as well. So now you can send them a package of an extract
and the data source. So the file type here called Tableau package
data source, DDS x. This type of file contains both of your data and
your data source. And we might be in another
situation where our colleagues or users are interested as
well in the visualizations. So we can send them a file with the visualizations
and the data source. And here again, we have
the same situation. You decide whether
you're going to send with it data or not. So if you don't want to
send the data inside it, you can send a file called
Tableau workbook, TWB. And the last scenario, I think you already guessed. If you want to send everything, the whole package, the extract, the data source and
your visualizations, then you can go and send your colleagues a
tableau format called, Tableau packaged
workbook, T WBX. All right. So as you can see, Tableau did design
different types of files for different purposes. So depend on the situation or
the scenario that you have, you can share your work with
your colleagues. All right. So now, generally speaking, we have two different
types of workbooks, a workbook with data using extract connection
and another book without data using
live connection. In one hand, in the
workbook with data, you can send three
different types of files. You can send only the data using hyper format or send
the whole dataset with the data using TDS x format or send the whole package
with the format T WBx. In the other hand, with
the workbook without data, you can send only two files, the dataset without data, TDS, or the workbook WBX. Now you might have the
question and you say, which table products should I use in order to open
these table files. Well, we have three
table products, Table distob Tableau
Public and Tableau reader. With the Tableau distob
you can open everything. You can open all these different
table formats and files. But with the table
reader and public, you can open only the Tableau
packaged workbook, T WPX. Since table reader and
Tableau Public cannot connect directly to the data
sources and they cannot use the live connections. All right. One more thing to understand about Table
work booxs is that Ta uses two different types of data to store the work box. The first one is the
metadata information. It will be stored in XML files. Meta data is data
about your data. It describes your data. It contains all information on what have you done
in the workbooks. Anything you click, dragon
or do while working with Table disto will be reflected in some
way in the metadata. You can find information,
for example, like column names, data type, data model, and so on. And the second type is the
data itself, the actual data. If you load data inside Tableau, Tableau can store it in
format of hyper file, where the data going
to be stored in column store methods in
the memory of tableau. It is like special formats for fast data retrieval.
All right, everyone. So with that, we have
learned the purpose of the different types of files in Tableau and when to use them. Next, we will do deep dive in the Tableau architecture to understand the disk
top components,
26. Tableau Architecture: Desktop Components: Okay. All right. If you understand the
tableau architectures and how the components are
connected to each other, everything going to make
sense for you as you are working with
Tableau and as well, it's going to makes you a
better tableau developer. I will be sketching the
concepts in order to make it easier for you to
understand. Let's go. The table architectures
contains four different layers, the source layer,
the disc to layer, server layer, and
the consumer layer. We will start
unboxing each layer one by one to understand
their components, and we're going
to work with this architecture from left to right, so we will start by
the source layer, and we're going to end up
by the consumer layer. All right. So now we
have the source layer. The source layer is
outside of Tableau, and it contains the
source of our data. So our data could be in
databases like MQL or Oracle, or the data could be in files like Excel and JS or even in the cloud like Amazon AWS or Microsoft Azure or even in EPIs. So our data could be everywhere. All right, so now back
to the big picture, let's jump to the next layer. We're going to unpack
the disctp layer. The first component in Tableau
disktp is the data source. Before you start building
your visualizations, you must set up the data source. The first thing that
we're going to do inside the data source is to
connect Tableau to our data. Tableau offers around 90
different data connectors so we can connect Tableau
almost to anything. Once you build the connection between Tableau and
your source of data, the access information
is going to be stored inside the data source. For example, the
bath of the file, location of servers,
username passwords, or access tokens and so on. All these information
is going to be stored inside the data source. All right, so the two types
of data connections in data sources are extract
and live connections. Now we connected to data. We decided which type
of the connection, The next thing that
we have to do in the data source is to start
building our data model, and we can do that by
combining tables together, using relationships,
joints, and union. You can do many other stuffs like sitting the
right data types, doing aggregations, renaming
stables and columns, creating new calculations
and filters, and so on. All right. Now to summarize the data source component in Tableau contains the
following informations. We have the data connectors to connect Tableau to our data, we have the access
in formations where the locations of our
sources going to be stored, as well, we can decide
whether we're going to load an extra copy of our
data inside Tableau. We call it an
extract connection, or we're going to leave it as live connections in
the data sources. And the last thing, we
have the data model inside data sources where we can combine tables together
and do aggregations, or we can do some
other custom stuff. All right. So once we are done with the setup of
the data source, we have the connection,
whether it's extract or live. We have our data model
and everything is ready. Now we're going to go and start building our visualizations. And Tableau organizes the
visualizations in three levels. The first one is the worksheets. So we can use the
data available in our data sources to build a
single view, only one visual. It could be a bar charts, a pie chart, or a table view. And as you can see,
each worksheet is connected directly
to a data source. But in Tableau, you can
build a worksheet from two different data
sources by using very powerful combining
methods called data blending, and this is very unique
feature in Tableau. You cannot find it in
any other BI tools where the data in one visual can come from different sources. Once we have these
different worksheets, we can go to the
next level where we start combining
these worksheets into one dashboards to show the different visuals
in only one view. But keep in mind, if you want to do any changes in the visuals, you have to go back to the worksheets and do
the adjustment there. And now we come to the last
level, we have the stories. As you know, the
main goal of doing data visualizations
is to tell a story, so you can build a sequence of worksheets or dashboards that's worked together in order to tell the user's story
based on your data. All right. Now you might ask me which visualization level
is the right one for you. Well, if you have
only one visual, then go with the worksheet. But if you want to
build some kind of KBI to monitor process, then build a dashboard. And if you want to present your data and tell
a story from it, then go and build a story. All right. So now we
have in Tableau disto both of the data sources
and the visualizations, and these two components
are contained in something called
a Tableau workbook. So now the question is, after you've done building your data sources
and visualizations, what can you do
with this workbook? Well, you can share it with your colleagues in your
team or departments, and there's two ways to do that. Either you're going
to go and send a table file directly to the users or you're
going to go and publish the workbook to
table server or Cloud, and from there, your users and your team can access
your workbook. All right. So now back to the big picture, the
Tableau architecture, let's talk about the layer on the right side, the
consumer layer. There's different ways to
consume tableau visualizations, depends on the user's clients and on the tasks the users do. So we start with
very small group of users that they might use Tableau reader to view and interact with tableau
visualizations, and they usually don't want to edit or create something new. For this group of users, we're going to send
them a tableau file. As we learned, they're going to need a tableau
packaged workbook, T WPX, and we might have
another group of users. Usually, they are
your team colleagues. They want to build analyses
on top of your work. They're going to use
table disktop to do that. For them, we can send any
kind of tableau files, depends on their requirements
and their tasks. Now we have a big group of users or consumers that they can access Table server or Cloud to view and interact
with Table visuals. They can use their web browsers
like Google Chrome and Firefox to access the content of Tableau server,
and from there, they can view interact and
even edit the visualizations, If they have enough permissions, or they can use Table mobile
app on the smartphones or tablets to view and interact
with your workbooks, but they cannot use it in order to edit the table
visualizations. For this group of users, you will not send them any files first you have to publish
your work to the server. And here we have two options. Either you're going to publish only the data source
or you're going to publish the whole workbook to
the table server or cloud. After that, you're
going to share the link of your workbooks to the users. And now to the last
group of users, that's worth mentioning,
they are the static users. You can always export your
data and visuals from Tutop and send it directly to the users as a BDF or Excel, of course, it's static and
they cannot interact with it. All right, so far in
the table architecture, we talked about
the source layer. We did deep dive in the tabled
stop and its component, And we understood
the different type of consumers and the clients. And in the next step, we will start talking about the Tableau server architecture. But first, in order to make
it easier to understand, we will go through three
different scenarios, and we will start with
the published process.
27. Tableau Server: Publish Process: All right. So previously,
we started sketching the tableau architecture where we learned about
the source layer, the discto layer, and
the consumer layer. Now we're going to unpack the server layer in
Tableau architecture. And in order to
better understand table server components, I'm going to walk you through three scenarios from
the user point of view. What can happen exactly in
Tableau server once we publish workbook or when we log into the server and access a
workbook. So let's go. So let's say that
you want to publish a table workbook
with an extract. What can happen, to disto go to request the server to
upload the workbook DWBx the first component in to server that can receive the
request is the gateway. The gateway knows how to forward the request to the right
server components. And in this situation,
the right component to process the publishing is
the application server. So the gateway go to
forward the request to it. And as we learned,
the table workbook holds two different
types of information. The metadata stored
in the XML files, data itself stored
in hyper files. I to server, those
two different types of files going to be stored
in two different places. The application server
going to send the XML file to be stored in the server
component called repository, and the hyper file
going to be stored in another component
called the file store. What we have learned so far, the gateway is responsible to forward the request to
the right component. Application server is the
one that go to handle the published process,
the reposorGa store, the XML files, the meta
data of the workbook, and the actual data, the hiber going to be stored
inside the file store. All right, so that's
all for this scenario. Next, we will start
talking about the authentication workflow
in Tableau server.
28. Tableau Server: Authentication Process: All right, so now
our workbook and our data are published
to Tableau Server. It's time now for our
users to log into the Tableau Server and start interacting
with our dashboards. So let's see how this go work. Let's say your manager is
Michael Scott and Michael wants to check your sales
dashboards in Tableau Server. And I'm going to do it. I need a user name. And I have a great one. And once Michael gives these
informations, a request going to be sent to the server as HTT B request. The first thing that it
can he is the gateway. The gateways knows that
the application server is the right component to handle
the authentication process. So the gateway can
forward it to it, and then the application
server can ask the repository to check if the credentials user
name and password, are correct, and if Michael has permission
to access our server. And then the post
you going to check, and if everything matches and Michael is allowed to
access our server, it will respond back to the application server
and going to say, Yeah, we knew the guy, he is in our records. Then the application server
is going to start building the server UI and send
it back to the gateway, and then the gateway
going to send it back to Michael Browser, and now he is inside
our Tableau server. So what we have just learned
from this process, again, the gateway is responsible for forwarding the request
to the right component, The application
server is the one that handles the
authentication process, the re poster going to
store the user credentials, and if the users have an access and permissions
to our server, and the application
server is the one that renders the web
interface of the server. All right, so that's
all for this process. Next, we will talk
about what happens in Tableau once we access
workbook to view the data.
29. Tableau Server: Access View Process: A All right. So now Michael is inside
our Tableau server, and he go to start browsing and searching for your
sales dashboard. And once you find it,
here going to click on it and try to access
your dashboard. So now let's see what's going to happen in Tableau server. And as usual, the
HTTB request for accessing going to be generated
and sent to the server. And we know by now
that the gateway going to receive the request and start forwarding it to the right component
application server. And then the application
server going to start render the chrome around the all those icons and images that are not inside
the dashboard itself. And then the application
server going to say, Okay, now we are talking
about visualizations. This is completely
out of my league. We have to forward this request to the master to the brain. It is the viscul server. It is the one that deals
with visualizations. And from here, the
viscula take over. I'm gonna say, Okay,
first thing first. Let's check if
this guy, Michael, is allowed to see
the sales dashboard. So the visculG ask
the repostory. And in the repository, there is a list of
users and reports. So it's going to search
there to find any matches. If yes, then it's going
to send back, yeah, Michael is a pos and he's allowed to see the
sales dashboard. And now the viscal go
to say, all right. Now we need data. So first, we need the meta data
of the dashboard. And as you know, after
we publish the workbook, the meta data going to be
stored inside the reposory. So the viscal gona request from the reposory one more thing is to send the XML file
of the dashboard. The reposory then go to
send back the XML to the viscuL server and the server will start building
the dashboard. All right. So now the viscal
go to say, Okay, now we have the dashboard, but the problem is it is empty. We need the data to fill it. And it's better to ask
our data specialist, and that is the data server. The data server is the one that knows everything
about the data. So it's going to say, all right, for this dashboard,
part of the data, we have it already
inside Tableau server, but the other part is
sadly outside of Tableau. To get the data inside Tableau
server from the extract, the data server gonna send the query request
to the data engine, and the data engines knows
how to query and extract, The needed data from
the file store. The data engine is going to get the data from the file store, and it's going to send it
back to the data server. And now we come
to the part where the data is living outside
of Tableau server. Here, the data server is
going to act as a proxy. We're going to use
the data connectors to connect to the
external databases. Once the connection
is established, it's going to send a query that matches the language that
the database speaks, and then the
database is going to return the needed
data as raw table. Now, once we have
all the needed data inside the data server, it's going to combine it and
do another security check. So the data server
going to check, is Michael allowed to see all data or should
we filter the data. The data server filters, the data depends on the data security setup
that you have made, and then it's going to send the raw data back to
the viscal server. Now, once viscal server has the raw data
for the dashboard, it's going to do now
the magic by turning all those numbers and raw
data into images and visuals, and it's going to put
it inside the work. Now, finally, the visco L
has everything it needs. The sales dashboard is
complete and ready. The ViscuL going to send
it back to the gateway and the gateway going
to send it back to the web browser of Michael, Michael can start interacting
with the dashboard. And now, Will. Does Michael have any idea what to do
with the sales dashboard? I declare bankruptcy. Alright, I know
there was a lot of stuff going around
in this scenario, but we have covered most of the Tableau server components. So let's have a summary and understand what we
have learned so far. As usual, the gateway
is responsible to forward the request
to the right component. The application server is not responsible for the
visualization process, but the viscuL server is the one that is responsible of
building the visualizations. The repository can to store information about the
permissions and security, which users are allowed to
access which dashboard and the data server are
going to manage both of the extract and
live data sources. The data engine
is responsible of retrieving the data
from the extract inside Tableau and the data
connector is going to help the data server to connect
to the external sources, and the viscuL server
does the magic of transforming the raw
data into visuals. All right, so far with
all three scenarios, we covered the most important component
of Tableau server. Now we're going to go and
put all pieces together into the table architecture and start explaining them one
by one. Let's go.
30. Tableau Architecture: Server Components: In this video, you will learn about the table
server architecture. And then we're going
to do a deep dive into each server component of the architecture to understand how it works and what it does. And we start right now. The server layer contain
mainly of three stuff. Two interfaces left and right, and in the middle, we have a
bunch of server components. The left interface is
the data connectors. They're going to connect
the external source systems to Tableau server components. And in the right side,
we have the gateway. It's going to receive requests
from different clients, and it's going to connect
it to ta server components. Alright, so now,
let's go more in details about the
gate component. So, in one hand, we have requests come from
different clients, like a login request from web browser or a publish
requests from Tableau disctob. And in the other hand, we have different table server
components like the app server, visQL server and so on. And the gateway going to be in the middle that knows how to forward the requests from different clients to the
right server components. The other task of the gateway
is balancing stuff around. Let's say that you
are working in multi node environment
where you have two nodes. When the gateway received
the first request, it's going to forward it
to the node number one, since both nodes are free. But now, if the gateway
gets a second request, it's going to say,
Oh, node one is full. Let's process this request
in node number two, since it's free, and so on. All right, so the gateway
in Tableau server is like a distributor
that knows everything. You know someone like that. Let's just say I know a
guy who knows the guy. Who knows another guy? The gateway has two tasks. First, it roots the client requests to the right
component, and second, it does load balancing
if you are running Tableau server in distributed
environment. All right. So now we're going to
start talking about those table components
in the middle. And in Tableuerver, there is like different arts
of components. We have servers, we have
engines and storages. And we're going to
start with the servers. As you learned in
Tableau Server, there is different processes, the login process, publish, accessing workbook, and so on. In Tableuerver, they designed different servers for
different processes. So let's start now with
the application server. The application server is responsible for
different processes. Like as we learned,
a user login request going to be forward to
the application server, then the application server
is going to check with the repository or
an active directory depend on your
configurations to find out if the user is allowed to
access the server or not. And the other process the application server
handles is the published With the
application server going to get the
published request, and it's going to split the
workbook into two files, the XML file to be stored in the reposoy and the hyper file to be stored in the file store. And one more task for
the application server is to render the
server interface. All those little stuff
that you find in Tableau server like icons, images, projects, minus, it is the application server
who render those stuff. So the application server
is responsible for different processes like the authentication and
authorization process, the published process, and
rendering the server UI. But one process that the application server
will never do, is the visualization process. Alright, so now we're going
to jump to the next server. We have the viscal server. This one is going
to be interesting. Alright, so
previously, we talked about the power of visuals and how human brain transform
text into visuals and images. The viscle is like our brain. It can a do the
magic by converting numbers and text into
visual and images. ViscuL stands for visual
query language for databases. The founders of Tableau, Chris, and Pat, they did
invent this language. Let's say that you drag and
drop something in Tableau. The viscuLGa convert this
action to an QL query, and then send it to the data
server to get the data. Then the data server
going to send the results back to the visco L as raw data. And now viscoel going
to do the magic by converting those raw data
into visuals and images, presented at your clients. Alright, so the
viscuL is the brain. It is very important
tableau component and responsible of the
visualization process. And mainly it does two things. It's going to generate
queries from user action, and it's going to
convert and transform the raw data into visuals and images.
All right, everyone. So now we're going to
talk about the third one. We have the data server. The data server is the one that knows everything
about the data. It knows where to find the data, how to connect to it,
and how to speak to it. The first task of the
data server is to manage both extract
and live data sources. If the data is inside tableau, it's going to send query
requests to the data engine. But if the data is
outside tableau, it's going to use the
data connectors to send query requests to
the external sources. The data server knows how
to speak to the sources. It acts like a bxy
to the data sources, can speak many different database languages
so that it sends a query request in a language that the
database understands. We have another task for the data server is to
handle the data security. It checks if a
user is allowed to see the data and do
filterings if needed, and the data server manages as well, the driver deployments. The data server is the central data management
component in Tableau server and the one that knows how to get data
from the sources. Alright, so now let's jump
to the next component. We have the data engine. If we decide to store our data inside Tableau as an extract, then the data engine going to
be the one dealing with it. Different components can send requests to the data engine. Like for example, the
data engine can receive a request from
application server to publish a new extract. Then the data engine can
execute and create operation, to create a new extract
and store data inside it. The data engine can receive as well query request from the data server asking for data. So what can happen
here, the data engine going to find the
correct extract. It's going to connect
to the hard driver, and then it pulls the
needed extract from it, and at the end, the data going to be sent
back to the server. Finally, the data engine
can receive a request from the back grounder to update
the content of an extract. The data engine can execute
an update operation by opening the extract and updating its content
with the new data. The data engine in tau is like
any other database engine. It does different operations
like it queries the data, It perform insert and
update operations, and it creates new extracts, but only for the data inside table server inside
the extracts. Okay, the next component
is the reposory. As you might already noticed, the reposory was involved
in every table process. So let's talk about it. The reposory stores many
different types of data. Like, for example, it can store the workbooks that we
published to the server, but only the meta data part, not the data itself. So the XML files from the workbooks can be stored
inside the reposory. In the reposry we find as well, the usage data data that's
going to help you to understand the performance and the traffic about your project. Like, for example, you can find the total number of active
users inside Tableau server. What is the total
view counts by day, and you can find out the most used data sources
in your projects. Another type of data that
you're going to find inside the reposter is the
security information. For example, which users are allowed to
access your content or which users are allowed to access our Tableau
server. All right. So as you can see
in the reposter there is different
types of data, and it contains as
well huge amount of data in Tableau server. But it's very important to understand that is
the data inside our dashboards and reports are not stored inside
the repository. We have many other
table server components that's worth mentioning. Like, for example,
the cache server. It stores almost
everything like images, icons, results of queries,
dashboards, and so on. So if you start a dashboard that is already accessed before, the data going to be pulled
from the cache server. Another component
is the background. In tableoserver, you
can create a schedule to refresh the data
inside your extract, and the task of the background
is to check this schedule each 10 seconds and then trigger the process of refreshing the
extract if the time comes. And the last component
that I would like to mention here is the
search and browse. The users of to server, they can search for content, and this component is
responsible for searching inside the reposory and return
the results to the users. All right, if you. So finally, we have the last puzzle,
the saver components. If we put it in
the architecture, we will get the
whole big picture of Tableau architecture. So now let's go and do
very quick summary. This source layer, it
is the one that is outside Tableau and
contains our data, and it could be anywhere
like databases or files. In the disktp layer,
the developers can start connecting
Tableau disktp to the data sources
with either copying the data inside Tableau
using an extract connection, or with the live
connections to the sources. Then the developers
can start building visualizations using worksheets,
dashboards, and stories. And both of the data source
and the visualizations, we call it a workbook, and we can either send it as a file or share
it to the server. The server layer can host our workbooks and we can
find many components like the data connectors to
connect our sources to the Tableau server
and the gateway to connect the client request
to the Tableau server, and we have the
application server responsible for the logging
and publishing processes, the ViscL server responsible for the visualization process, and the data server is the one responsible for the
data management. We have another component like the data engine that's going
to handle the extract. In table saver, we have three places where the
data going to be stored, and we have the reposory that contains many
different data like the XML of the workbooks
and the security objects, but not the data itself, because our data
going to be stored inside the file
store as an extract, and we have the cache
server that contains many different types of data to increase the
table performance. The last one is the
consumer layer. Here we found the different
groups of users and clients, like the Tableau readers, that's needs only the TWBXFiles directly from the
Tableau developers and another group of users
that they're going to use Tableau disctob
to develop new views. And we have the static
readers that's going to receive files
like MDF and Excel, and then we have a big group of users that's going to
access Tableau server using either web or table mobile to interact with the
published workbook. All right, everyone. One more thing that
I would like to show you is this amazing
dashboard from Tableau team. It's going to show you the
different component inside Tableau server and how they're going to
interact to do a task. For example, if we go to the
workflow or the process, we can select, for
example, access, and then we can select whether it's like an published extract or live And over
here, we have slider. If you drag it to the end, you're going to see
how the components are interacting with each
others to do the tasks, and on the right side, you will see description for each step. This is really great way to learn how Tableau server works. I learned from this a
lot for this tutorial, so make sure to check
that if you want to see more details about other
processes in Tableau server. I'm going to leave the link
in the tutorial materials. All right, guys. That's all for the Tableau server architecture
and its components. Next, we will learn the
Tableau Public architecture and what are the limitations
of Tableau Public.
31. Tableau Architecture: Public Components & Limitations: Let's start with the
source of our data. In Tableau Public, you can
only connect files like CSV, Jason, Microsoft Access
and Google Sheets. The next component is
Tableau Public Disktob. It is free version
of Tableau diskTub. It's software that
you can download and install at your PC. Here we start by connecting
Tableau Public to our files by creating
a data source. In the data source, we have
only one type of connection. It is the extract. The data should be copied
from our files to be loaded inside Tableau Public distob there is no live
connection option. Then after that, we're
going to start building our visualizations
or we call it Vss. Now, once we are done
building the views and the dashboards using
Tableau Public distob, we have here only one
option to share it. That is to share
the whole workbook, your data, and the Vss
to Tableau Public. Tableau Public is a free
platform hosted from Tableau team to share the visualizations
from the whole world. And once our visas are
published to Tableau Public, they can be now consumed from
users all around the world. And here we have a few options. The users can use
the web browsers to view and interact with
your visualizations or users can download the
whole work your data and the visas in different
formats like table file, TWPX or Excel, BDF
images and so on. The last option of
consuming your vises can be embedded into your
websites and blogs. Okay, now, since
Tableau Public is free, it comes with few limitations. At the source level, we can connect Tableau
Public only to files. The data connectors are very limited and
we cannot connect, for example, to servers. In the next level at
the public disto level, there is limitation
in the data source. We have only one
type of connections, and that is the extracts. So we cannot have a live
connections to the sources, and the workbook itself, it contains only maximum
15 million rows, and we cannot save the workbook
locally at our commuter. The only option to share it is to publish it to
the Tableau Public. But there is like a work
around toward that. I'm going to show that
in the next tutorial. Alright. So now let's move to the sharing level
to Tableau Public. Here we have as well,
few limitations. For example, the
total available size for each account is
only ten gigabyte, and there is no way to refresh
your data automatically. Each time you need new data, you have to manually republish the workbook with new data. And the third one, it's
going to be public, so there is no way
to make it like a private and to share it
with only few people. You have always to publish
it to the whole war. And now let's move
to the final level. We have the consumers. The only limitation here is that you cannot use
Tableau mobile, access and interact with the visualizations.
All right, everyone. So I decided to use Tableau Public in
this Tableau course. Since it's free, and all of you can follow me
with the examples. Without having you to pay for extra licenses and
the limitations that we have in Tableau Public, they are not really relevant
for the learning process. The main features of Tableau the data visualizations
that we have in Tablea disktop they are all available as well
in Tableau Public, without any limitations,
so don't worry about it. Alright, everyone. So with that, we have learned the tableau architecture and its components, and we learned how
Tableau internally works. And with that, we have covered the theory parts of Tableau. And in the next section, we will start preparing
your environment so you can practice Tableau with me during the course.
So let's jump in.
32. #4 Section Introduction | Tableau Prepare Your Environment: Now we can prepare your
tableau training environment. In order to learn tableau, you should not only
watch the videos. You have to practice with me. And that's why now
we're going to go and prepare your environment
in order to work with me. And of course, don't
worry about it. Everything is for free. So we'll start by downloading
and installing Tableau. Then we're going
to go and create a Tableau Public account. And after that, in order to make sure that
everything is working, we're going to go and create
our first vitilizations, and then we're going
to go and publish it to your Tableau Public account. And at the end, what
we're gonna do, maybe it's your first
time starting Tableau. That's why I'm going to take you a quick tour of the
Tableau interface. So now let's start
by the first step by downloading and installing
tableau. So now, let's go.
33. Download & Install Tableau: All right, so let's start
with the first step. We're going to go and download
Tableau Public Disktop. So in order to do that,
we're going to go to the website public.com. I'm going to leave the
link in the description. And from there, we're going
to find the menu creates. And then we can click on that. Then we have download
Disktop Public edition. So let's click on that, and then we're going to
go to the middle and click on Download
Tableau Public. And now before the
download starts, we have to fill out this
registration forum. This is not for creating
public account. It's just something
before download starts. So we're going to
give the first name, last name, e mail, and country, and then we're going to click
download the app. And then the download g to
start is just 500 megabytes, so it should not take long time. And now we have the
download is done, so let's click on
the execution file to start the
installation process. Okay, so at the start
of the installation, we are at the welcome page. And here, as usual,
we have to read and accept the terms, so
you have to do that. And here we have second box. You can click on it if
you don't want to send the product usage
data to Tableau team. It's like cookies. I don't mind. I'm just going to leave it,
so we click now Install. And once you do that, the
installation is going to start, it should not take long time. Okay, so now the
installation is done and Tableau going to be
launched automatically. Alright, so with that, we have done the first
step where we have successfully downloaded
and installed Tableau Public at PC. And next, we're going to
create Tableau Public accounts where you can share
and publish your work.
34. Create Tableau Public Account: Okay, so let's go
back to the website, public dot.com and on the
right side at the top, we're going to click on Sign in. And then we have
to click on this. Join now for free. Now we have to fill out
this registration forum in order to create a new
Tableau Public account. So we have to enter the name, the email, the password, and the country, and
then we have to read and agree on the terms.
Let's click here. I am not Robot and at the end, you're going to click
on create my account. And now we got the message
to verify our account. So that means we have
to check our e mails in order to activate our
account. So let's do that. Okay, so now after checking, I got an e mail from Tableau, so I'm going to click on it,
and then I'm going to click on Verify now in order
to activate our account. So I'm going to click on that. And then it's going to
send me to my account. And with that, we have brand new active
Tableau Public account. Well, it's like any other
social media account, you can add your
personal information. For example, we can add
our photo or avatar. So let me check what
I can do over here. So I have this photo from
Stud gar Television Tower. It's a meeting there. And
then I'm going to click Save. And we can add many other stuff. So let's click on Edit Profile. And as you can see over here, you can link your
social media accounts or add your websites, and so on. Let's click Save now. All right. So with that, you have
now D public accounts. But it's still empty. We don't have
anything inside it. Next, we will get the
training datasets, and I'm going to explain for you the data model behind them.
35. Get Training Datasets: If you want to learn
any new tool like Tableau BBI or any other
programming languages, you need always a good dataset for training and practicing. I start searching for good training datasets and
after a lot of research, I download it like
many many datasets. But I was not happy with them. I didn't like them
because they don't cover all the scenarios that
we need for training. Let me tell you why
this is an issue. In real projects, your data going to be stored typically in data warehouses or data links inside many, many
different tables. The first step in any
visualization tools like Tableau or Bar BI is to connect those tables and combine them in one a model. Training with only one
table not going to help you and prepare
you for real projects. That's why I decided to make my own datasets to cover
all the training scenarios and to have multiple
tables in order to learn how to combine
them in one data model. Of course, you can
use my dataset in order to learn anything
else like SQL, Python, Power BI, and so on. Let's see what I have
prepared for you. All right. The first thing that
we're going to go to the link in the description, and then you're going to land
in my website where I've collected all the
course downloads and materials in one page. So for example, we're
going to go and download the training datasets. We have here some
important links, the three sheet sheets and many sketch notes that I have
prepared for this course. And then as well, you're going
to find for each section, what are the important links and sketches and as well,
the table files. This link is going
to be available for you after the
course as well, so we can always
come back here and download the stuff that you
need. And of course for free. But now what we're going to
do, we're going to go and download the training datasets that we need for our course. Here, as you can see,
we have two zip files, one for the non EU
and one for the EU. If you are currently in Europe, what you're going to do,
you're going to go and download these datasets. But for all other countries, you're going to go and
download the first datasets, the non EU training datasets. Now you might ask what is the
differences between them? Well, it's about the
decimal numbers. Since in our datasets we have different decimal
numbers like the sales. In different countries, we have different representations
of the decimal numbers. All the European countries,
they use, for example, the to separate the decimal
from the whole number. But in many other
countries, USA in Asia, we have the.in order to separate the decimal number
from the whole number. If you are using
the wrong format, what's going to happen, table will not understand that this field is a decimal number and it's going to
convert it to string. Now, depend on your location, go and download the datasets. For me, I'm in Germany, so I'm going to go with
the second one, and as I said, it's
depend on your location. Let's go ahead and
click on that. Next I'm going to do,
I'm going to go and grab the zip file and put
it somewhere safe. I don't want to leave it
underneath the downloads. So I'm just going to
create a safe path for that and then start
extracting the data. Okay, now let's go
and zip the files, so I'm going to go and
extract all of them. Okay, so now let's go inside
it and check the data. So here we have three
different datasets. The first dataset, the table
project sales dashboards. We're going to use it
in the last section once we start building
our projects. Then we have two other datasets, the big datasets, and
the small datasets. We're going to use these two datasets in the whole course. So the small data source
and the big data source, they are very similar. Now you might ask me, why
do we have two datasets. Now, let's open both of them and see what do we
have inside them. As you can see, we have
almost the same tables, customers, we have orders, products, and so on. They are almost identical, and now you might ask me,
why do we have two datasets. Well, because we have
many different types of calculations and functions. For example, some
calculations going to change the data
at the role level, and it's better to
have a small dataset in order to understand
their results easily. In the other hand,
we have calculations like aggregations
on the table, LOD. It's better to have many data in order to understand
how it works. That's why I've decided to have two datasets in order to
cover all those scenarios. Another thing about
the datasets is that the file type is CSV. We have only one Json over here, so you can use
either to public or to dtop in order to
follow me in the course. All right. So now I'm
going to walk you through the data model of our data sets. Here we have three
typical tables. Our datasets contain information about the superstore use case. It is simply sales
transactions of customers ordering
products by a company. It's classic and very
easy to understand. The first table
in our data model is the customer's table. It contains all
customer information such as the name
of the customers, their locations,
and their score. In the small datasets, we have five customers, and in the big one, we
have around 800 customers. And the second table in our
data model is the orders. It contains all the orders
placed by the customers. So we have information
like the order date, sales, quantity, and profits. In the small datasets, we have ten orders, and
in the pig dataset, we have around five
years of data, and that's really helpful once we start building clusters. And the third table in our
data model is the products. It contains all the products that we find inside
our supper store. We have informations like
the product name category and the subcategory. In the small dataset, we have only five products in the category monitor
and accessories. But in the big datasets, we have more than
2000 products with categories and
subcategories. All right. Now we have those three tables, but as well we have
relationships between them. Like, for example, there is a relationship between
the orders and customers. They can be connected
using the customer ID, and if you check the
orders and products, you can find another
relationship between them where you can find the
product IDs in both tables, and with that, we can make a relationship between
the orders and products. Alright, guys. So I lift all those informations
in my website. You can find there
all the links to the datasets that I found
during my research. So you can go there and
check them if you want. Alright. So now, with
that, we have everything. We have the tools, we have the data, we have the accounts. Next, we will go and build our first visualization
in Tableau, and we can publish it in our
new Tableau Public account.
36. Publishing Your First VIZ: Okay, everyone. Let's start Tableau Public disctop if you
don't have it open already. Then in the starting page, we're going to go
to the left menu to connect tableau to our data. Click on text file. Now we're going to go
and find our file, the customer CSV that
we just downloaded, and now we can see the
customer's data inside Tableau. Let's move to the worksheets. I'm going to click on
the orange tab over here sheet one to create
a new worksheet. Now we're going to build our
visualization in Tableau. We have only to drag and drop. From the left side,
let's drag and drop the country in the columns, and let's get another one. Let's move the count. To the rows. All
right. That was it. We have our first viz. Here you can see in this visual, how many customers we
have in each country. With that, we are done building the workbook and now
it's time to share it. Sadly, in Tableau Public, we cannot download it
locally at our PC, but I'm going to show
you work around later. Now the only option
that we have is to publish it to our new
Tableau Public account. Now in order to do that, let's go to the main menu over here, then click on Files, and then we're going to click
on safe to Tableau Public. For the first time, you
have to sign in with Tableau Public account
that we just created. Now let's click on Sign in. And now we have to
give it a name, and I call it my first viz. Once you click Save
Tableau Public Disktop can start publishing our
workbook to Tableau Public. Once it's done with
the publishing, a web page can open
automatically directly showing your viz in your public
account. Here's our viz. Let's go back now
to our home page. As you can see over here, we have our first viz
published to Tableau Public. Let's go inside it again. Now, everyone in the
world can see your viz, interact with it, and
even download it. Let's see how we
can download that. There is download
icon over here. Then click on that, and now you can select the file
format that you want. Let's select the last
one is Table workbook. Click on Ds and then
click download. And now we will
get the Table file T WBx where we have our data and our
visualizations inside it. If you open it, you can see our And this is the work around that we can use in order to save our work locally at our BC in
Tableau Public. All right. So with that, you have published your first viz to your new
Tableau Public account. Next, I'm going to take
you in a quick tour in the Tableau interface of the
three main pages of Tableau, and we're going to learn how
to navigate through Tableau.
37. Tour of the Tableau Interface: Now, I remember in 2014, the first time I opened Tableau, I was overwhelmed with all icons and parts that we
have in Tableau interface, and navigating
through Tableau pages was very confusing
for me at the start. And that's why I'm
going to take you in short tour in Tableau interface. Let's go. Now let's
go and start tableau. Now the first thing
that I want to show you is that the whole thing, the whole file, we
call it a workbook. The workbook is like
any other book. It contains different sheets. The table workbook
contain three main pages. We have the start page. It is the main page where you can connect our data to Tableau, and then we have the
data source page. It is the place where you can connect and combine your tables together and do changes to the meta data like renaming
columns and so on. The third page where
you're going to spend most of the time is the
workspace page. It is the place where
you're going to build your data volzation All right. So now we can learn how
to navigate through those pages and how to
switch between them. Okay, so once you start low, you will be in the Welcome
page, the start page. Now if we want to go
to data source page, we have to connect something. Let's go again to the
left side over here, connect to text file, and then select our file
customers and open. Once we do that,
we're going to land automatically in the
data source page. Now if we want to go
back to the start page, in order to do that,
we're going to go to this table icon over
here on the left side. If we click on that, we're going to go back
to the start page. And if we want to go back
to the data source page, we're going to click
on the same icon. Click on that again. And we are back to the
data source page. So this icon, we can always go back to the start
page of Tableau. All right. Now, let's see how we can go to the workspace page. In order to do that, we're going to go to the
bottom over here, you will find different tabs. The first one is always
the data source tab. This is exactly where we
are now at the data source. But now if we select the sheets, Tableau going to take us
to the workspace page. And if you want to go back
to the data source page, there's two ways to do that. First, we can stay
at the bottom over here and we can select
the data source tab. By clicking on that, we go
back to the data source. The second option is
that add the data pane. If you go to the
left side over here, you can see our data
source customers. If you double click on it, we're going to go back
to the data source page. Okay guys, that's what it. This is how you can navigate
through tableau pages. Let's have now a quick
overview of each page. Okay, so let's start to the
first page, the start page. We can see here three panes, connects, open, and discover. In connect, we can find
all different types of data connectors and in Tableau Public, we
have around ten. That's enough for the training. But in Tableau do, we have
over 90 data connectors. Now in the middle, we have open. Once you start Tableau
for the first time, this section is
going to be empty. But as you start
creating new workbooks, Tableau can start showing you the most recently
opened workbook. And this is really nice to have quick access to our workbooks. Here we have only
one the first phase that we published before. And on the right side,
you will find discover. You will find
different stuff from Tableau team like blogs, news, training,
tutorials, and so on. Now on the bottom, you can see information about
Tableau software. For example, now it shows that we can upgrade to Tableau disto. Or later once Tableau releases
a new version of Tableau, you will find information
here to update your tableau. But since we just installed the most recent version of
Tableau, it doesn't show it. That was it for the start page. Let's jump now to the next one. We have the data source page. By now, you should
know how to go there by clicking
on Tableau icon. What do we have here in
the data source page. On the left side, you can find all informations about our data. In connections, you can find the connection
informations and I files, you can find all tables
that are inside our data. Then in the middle, we
have the data source name. Then over here we have the area where we're going
to build our data model, and it contains two layers, the logical layer and
the physical layer. I'm going to explain that
in the next storial. Don't worry about that. Beneath that, we
have the data grid. It's going to show us
a sample of our data, and as default,
it's going to show the first 1,000 rows of data. And in the left side,
we have another grid. This is the meta data grid. It shows us more details
about the tables fields. All right, so
that's all for now. We're going to move
now to the next page, the workspace page, and we can do that by selecting
the sheet tab. Okay, so in the workspace page, we can spend most of our time here building our
visualizations. That's why we have a lot
of icons and stuff around. Let me quickly guide you
here in this interface. Okay, so we're going to start on the top. We have the tool bar. It contains a lot of icons, and those icons are the most frequently used
functions in Tableau. As you are building
your visualizations, you have a quick access
to those functions. As you might already notice, there's some functions
that are not selectable. Well, you have to understand
here that in Tableau, if something is grayed out, that doesn't mean
that this feature is not available
in Tableau Public, but it means it is not
relevant for the visual now. For example, if I go over here, it's going to sort the visual and since I
don't have anything, so it's not relevant to sort it. Let's check the other icons. We have the Tableau icon. It's going to take us
to the start page. You know that already.
We have the undo and redo the last
action in the visual. And as you can see, as
I'm hovering the icon, tableau is going
to give me short description of the function, so here we can create
a new data source, or over here, we can create
a new worksheet, and so on. So just hover all the icons and you will see the function. All right. So now let's
move to the left side. We have here two panes, the data pane and
analytics pane. As default table go to
show us the data pane. But if you want to go
to the analytics pane, just simply click on it. So you can switch between
them by just selecting them. Let's see what do we have
here in the data pane. The first thing is
the data source. That contains our
data, and below that, we can find the tables
inside this data source. We have currently only
one table, the customers. We can see over here the fields or columns
inside our tables. Here we have as well
a search field. Sometimes our data
source gets really big, and we're going to
have a lot of fields, so this is really nice way to
search for specific field. Now let's go to the analytic
span and you can find over here predefined functions that you can add to your visual, like adding an
average line or doing clustering or even you can create your own reference line. Really nice stuff. Now I'm going to switch back
to the data pane. All right. Now let's move
to the middle and you can find over here different
shelves and cards. We're going to use them in order to build our visualizations, and everything works
here with drag and drop. Let's start with the first one, the rows and column shelves. The visuals of Tableau, they have two dimensions, the rows and columns
like any other tables. If you put fields in
the column shelf, it's going to create a
column of the table. While if you put fields
in the row shelves, it's going to create
a row of the table. Easy stuff. Now let's
have an example. Let's go to the left
side and we're going to drag and drop the
countries on the columns. With that, we define the columns
of the visual over here. Now we're going to have
something on the rows. Let's take the counts and
drag and drop it on the rows, and with that we define the
visuals, columns and rows. If you want to
swap between them, you can go to the tool bars over here and click
on this icon. You can switch between
them very easily. If you have a lot of columns,
I'm going to switch back. Now we can add more
columns and more rows. For example, let's
take the city, drag and drop it on
the columns over here. You can have multiple stuff. Now if you want to remove
one of those columns, you can do that by drag and
drop on the empty space. Let's move to the bages shelf. You can use it to split the
current visual into series of bages if you want to analyze something like step by
step and take it slowly. Let's have an example.
Let's take again the customer count drag
and drop it on the pages. Now as you can see
on the right side, we have a new window
to control the pages. Now we are at the
first page where we have countries with
only one customer. If we click over here
on the right side, you will get the countries
with two customers, and so on. Now for the next example,
I'm going to remove it, so I'm just going to drag
and drop in the empty space. Let's move to the next
shelf. We have the filters. You can use it in order
to filter our visual. For example, let's
take the countries, drag and drop it in the filters. Now you can here decide
which country is going to stay and which country is going
to leave the visual. Now, if I select for example, let's remove France
and click Apply. You can see our visual don't contain now the country France. Now I'm going to
remove it again from the shelf by drag and
drop in the empty space. And then we have the Marks card. You can use it in order
to design the visual. For example, we can
add new colors. If we drag and drop the
countries on top of the colors, we will get a color
for each country, or we can change the
size of the pars, either make it small or pig, or we can add labels, and so on. Now let's move to the middle. Of course, here
we have our view. It contains visualizations
or we call it visas. First, we have the title, and you can change it
by double click on it. Let's give it a
name, for example, customers by country.
And then click. Below that, we have
our visualization and it contains different stuff. For example, we
have the headers, and here we have the countries
as well, we have the axis. Now, the intersection between
those fields are the marks. Those marks could be like
pars in this example or could be a line or
circles or any other shape. Now, if we check the
bottom of tau interface, you can find status bar. It contains a lot of
details about our visual. For example, it says
we have three marks. Of course, we have 3 bars, and we have one row
and three columns, and the total number
of customers is five. Now let's add more stuff to the visual to see how
those status change. Let's take the scores, drag
and rub it in the rows. You can see here we have now
six marks, we have 6 bars. We have two rows
and three columns. Those stats are really important once your visualizations
get complicated. Now we have very simple one, we can count it and
see we have six pars. But if we have a lot of
dots and a lot of points, it's really hard to count them, so it's really nice to
check the status bar to see details about
our visual. All right. Now let's move to the right
side and we're going to go to the show me
icon. Select that. Now you will get different
visualizations that Table offers by just
clicking on them, you're going to switch the whole visualizations
in overview. Here we can switch it to
tables or to pie charts, or to tree maps, and so on. Now just go and explore those
different visualizations. And you might
already notice that some of them are grade
out. We cannot use it. Here again, it's available, but we don't have the
requirements to use it. For example, if you
go to the line chart, here Tableau tells you what are the requirements
or what Tableau needs in order to build this visualization.
It needs one date. It doesn't need any dimensions, and it needs at
least one measure. Currently, in our view,
Tableau cannot create it because we don't have any
date field in our view. All right, everyone. That was the main component
of the worksheet. Now before we go
to the dashboard, I'm going to do a few
stuff, you can follow me. I'm going to undo those visualizations
and go back to the bar. And then I'm going to
create a new sheets. I'm going to click over here,
create a new worksheets, and then I'm going to take
the countries and this time, I'm going to take the
scores over here, and then I'm going to
use the Pi charts. And over here, I'm going
to put some labels on it. That's enough. Let's go
now to the dashboard. We can do that by creating a new dashboard on
the icon over here. And now we are at the
interface of the dashboard. I'm not going to explain
everything over here. It's just important to understand
that in the dashboard, we can start compining
different sheets in one place. So we can drag and drop
the sheet number one, where we have the
customers by country, and then we can take
the sheet number two, place it somewhere over here. And then I have in one
place two visuals, the sheet number one,
and sheet number two, and this is the main job of the dashboard. All
right, everyone. So now I'm going to
show you the last type of sheets, we have the story. In order to create a new one, we're going to go
to the bottom over here and click in this icon. With that, we have created a new story and
stories in Tableau, they are like
sequence of visuals and we use it usually
for presentations, if you want to tell a
story from our data. All right What do
we have over here? In the left side, we have
the visuals that we created. We can see the worksheets
and as well the dashboard, and then over here, we can
add a new story points. In the middle, we have
in this section like navigator to go
through our story, and then here we're
going to present the story or the views. What we're going to do
now in the first one, we can drag and drop the
dashboard That's two dots. And now we can add a next step
by adding plank over here, and then we're going to
take the sheet number one, and then we can add a new one, plank and then sheet number two. So now we have story. It starts with the big
picture with the dashboard, and as we go through the story, step by step, we go more
in details in each visual. It's really nice
way to present or to tell a story
using our visuals. All right, so now we have the
table software installed. We have the two
training data sets, the public account
to share your work, and everything is ready to
start learning tableau. With that, we have
finished this section, where we have prepared
your environment to practice Tableau and
in the next section, we will do deep dive in the
Tableau data source to learn how to build a data model in
Tableau by combining tables.
38. #5 Section Introduction | Data Modeling & Combining Data: Data modeling in Tableau. Each successful
dashboard or charts in Tableau can be based
on a solid data model. And having data modeling
skills is essential for each table projects or business
intelligence projects. So that's why we can start
learning the fundamentals of data modeling including
the star schema and the snowflake schema. And then I'm going
to introduce you to the Tableau data
modeling where you can learn the physical
and the logical layers. And then we can learn the
different methods on how to compine tables in data
modeling using joins, union relationships,
and data blending. Of course, in order to understand the
differences between them, we're going to compare
them side by side. And, of course, I'm
going to guide you in when to use which methods. And in the end, you're
going to go and build two data sources based on
our training datasets. So let's start with the first topic where
we can understand the fundamentals of data
moduling. So now, let's go.
39. Concept Of Data Modeling: In real projects, your data
can be stored typically in data warehouses or data links inside many, many
different tables. The first step in any
visualization tools like Tableau or RBI is to connect those tables and combine them in one
big data model. So let's start
with the question. What is data modeling. Data modeling is the
process of organizing and representing data in a clear
and understandable way. Each data model has entities. Entities could be
things like customers and products or
events like orders. And inside those entities, we have informations and
we call them attributes like the first name and the last name inside
the entity customers, and we describe in
the data model how those entities are connected
or related to each other. We call it relationships. This data model, this
visual representation of the data makes it easier for us and for
programs to understand the data, which is really
important for making decisions and improving
performance of the business. All right, so we have
three different types of data models at different
levels of abstraction. First, we have the
conceptual data model. This type is high level
representation of the data model without going in details on how the data model
is implemented. It's like a map that shows the important entities
and the relationships, and we usually use this type to explain the data models to business analysts
and stockholders to understand the big
picture of the data. The second type is the
logical data model. In this data model,
we go more in details on how the data is
structured and organized. We define in this model the
attributes of each entity, and it includes as
well constraints and more details about the relationships between
the entities. This data model is usually
used by database designers and developers as a blueprint
for the implementations, and the third type is
the physical data model. This type represents the actual implementations
of the data model. It includes all the
technical details about how to store the data, like the data types of the attributes the
primary and foreign keys, indexes, and so on. This data model is used by developers to create and
manage the databases. All right, so let's summarize the conceptual data model shows the big
picture of the data. The logical data model provide a blueprint for
the implementations and the physical
data model shows how the data is implemented
in the databases. And Tableau did adopt both the logical and physical data models in the data sources. But we don't have
conceptual data model in Tableau. Don't
worry about it. I'll show you more
details later. All right. So now for analytics
and specially for data warehousing and
business intelligence, we need special data
models that are optimized for queries
and for analytics. It should be flexible
and easy to understand. And for that, we have
two special data models. First one is the star schema. Star Schema has a
central fact table and surrounded by
dimensional tables. The fact table
contains events and the dimensions holds
descriptive information. The relationship
between the fact and the dimension tables
form star shape, and that's why we
call it star schema. And the other data model, we call it snowflake schema. It is very similar
to star schema, but the dimensions here are breaking down into
sub dimensions. Normalized tables or
dimensions means that those tables are broken
down into small pieces to avoid having big
tables or big dimensions which leads to many
data duplications and slow performance. The shape of these data
models looks like snowflake. So Star Schema is a symbol and easy to understand
data model, and we usually use it if our
dataset is small or medium. In the other hand, the snowflake
schema is more complex, but it eliminates the duplicates and reduces the storage spaces, and we usually use it if
we have a large data sets. All right, so the
datasets that I've prepared for this
tableau course are using the star schema data model just to keep it symbol
and easy to follow. All right, our data model has a name and we call
it star schema. If you're going to
work on real projects, you're going to hear about
the star schema a lot. Star Schema has mainly two types of tables, facts and dimensions. For example, we have
the table customers. It describes each customers
by their first name, last name, country, and so on. Customers is a dimension table. And we have another dimension
table in our data model. It is the products. Products table
describes as we each products by their
name and category. It is as we dimension. Now let's talk about
the second type of tables in the star schema. We have the facts. For example, let's have a look at the
big table in the middle. We can see three things. You can see first a lot of
keys to the other dimensions. We have the order ID
customer ID product ID, and we can see dates. We have the order date,
the shipping date, and the third thing, we
can see a lot of numbers. We have sales,
quantities, profits. We call them as well measures. If you see those three things, that means we have an
event or fact table. Facts connect
dimensions together. It has dates and
as well measures. Okay. So to summarize, how do we decide if a table
is dimension or fact. If you have a table
that contains information about
a physical person or an object like employee,
customers, products. Then this table is a dimension, and usually they
are small tables. And in the other
hand, if you have a table that contains events. For example, we have sales, orders, logs, ATM transactions. So any table that has
events, transactions, and has time in it,
we call it facts, and usually they are
really huge tables. Okay, so in our data
model in the data sets, we have two dimensions. We have the customers
and products. And in the middle,
we have our fact, the orders All right. So now if you hear
in your project, someone talking about
star schems and so on, you know exactly what they mean. It's very important
concepts in analytics and BI word if you are using
Tableau or bar BI. Alright. So with that,
you have learned some important concepts
in data modeling. Next, we will learn
the table data model and the two layers physical
and logical layers.
40. Tableau Data Modeling and Layers (Physical & Logical): Okay, so once we connect
our data to Tableau, we have to create a data
model in our data source. And if your data
contains only one table, then your data model
is very simple. You have a single table
in your data model. But in real life projects, things get more complicated where you have multiple tables. Tableau here offers
four different methods of how to combine and
connect your tables. We have relationships, joins, union and data blending. Now before we start doing
deep dive and four methods, let's understand the
data moding in Tau. Oh. In tableau data model,
we have two layers. We have the physical layer, and on top of it, we
have the logical layer. In the physical
layer, we might have some coable physical tables, and we can combine them in
tableau using two methods, either joining the tables or
using union between them. Now let's move to
the logical layer. It is the top level layer
and provide us like an abstract to hide all the details in
the physical layer. This is especially
nice if we have a lot of tables in
the physical layer. Once we are building
our visualizations, we don't want to see all those tables in the
physical layer. The logical layer
going to provide us an abstract or going to
hide all those details. The result of merging the tables using join and union in the
physical layer are going to be presented in the logical layer with
single table flat table, and we call it agical table. That means we're going to
have two logical tables. The first one going to present three tables after
doing the join, and the second one going to represent two tables
using the union. But we still have
in data modeling to connect those two
logical tables. In Tableau, we have only
one method to do that. We call it relationships, and it's very important
to understand that. In the logical layer, we cannot merge
tables in one table. After we connecting them using the relationship between
the two logical tables, the table is going
to stay as it is, and nothing going to be merged. We just described
the relationship between the two logical tables. Now back to those two layers, both of the physical layer
and the logical layer, we can find it inside
tableau data source. As you know, on top
of the data source, we have our visualizations, and you can see in this example, only the tables from
the logical layer and you can start building your visualizations
using the data available from the
logical layer. But sometimes as you are
working with the projects, you build another data source
with another data model. Here in this example, it's
important to understand that not all logical tables comes
from the physical tables, they could come directly
from your source system. Now in order to build
one visualizations from both of the data models
and the data sources, we have somehow to connect those two data models
or data sources. We can do that in the
visualization level where Tableau offer us the last and very unique method of connecting and
combining tables, something called data blending. By looking at this,
you can see that tableau offer us four
different methods of how to combine and connect tables in different layers
and different levels. In the physical layer, we
have the joints and unions, we have in the logical
layer, the relationships, and at the visualization level, we have data blending. All right. Now, let's
say in Tableau, how we can navigate through the physical and ogical layer. We are currently at
the data source page, and as a default,
we're going to be a theological layer
in the data model. That means anything that
we drag and drop in our data model is going to be considered as a logical table. The customers is ilogical table. Let's take another
one. Let's take the orders and
drop it over here. This is our second
logical table, and as you can see Tableau
did create between them, a relationship because
at theological layer, we can do only relationships. Now we are at the logical layer, how we can go to
the physical layer. In order to do that,
we're going to go inside a logical table. Let's go to the customers
and double click on it. Once we do that, we're going
to go to the second layer, we are inside the
physical layer now. Table and tell you over here, the customers is made of one table because we have
only one physical table. Now, anything that
we drag and drop in the data model is going to be considered as a physical table. For example, we can take
the customer details. Let's drag and
drop it over here. By default table going to create between them that relationship, it's going to create a joint between those two
physical tables. Of course, we can do
a union between them. So in the physical layer, we
can do joints and unions. And as you can read over here, it says the customers, the logical table customers is made of two physical tables. And if you have
her on this icon, you will see exactly that. So we have two physical tables, defines the logical
table customers. Now, if you want to go up
back to the logical layer, we can do that by just closing the physical layer.
Let's click on that. Now you can see that the
customers has a new icon, it says in the physical
layer, there is like a join. And we get more information. If we have her on the tables, it says, logical
table customers, that is made of two
physical tables, the customers and the
customers details. That means the data in the logical tables comes
from the physical layer. But if we go to the order Here, you will see no physical tables. The data comes directly
from the original tables. And with that, we
have learned how to navigate through the physical
and the logical layer. All right, with that, we have learned the data modeling in tableau and what is the
physical and logical layers. Next, we will start learning how to compine
tables in tableau, and we will start with joins.
41. Joins: Inner, Left, Right, Full Join: All right. So let's start
talking about joining tables. We usually have two tables, table A, and table B. And if we want to combine
them in one pick table, then we can use
join between them. The first thing to
understand is that once we use join
between two tables, then we have two sides. Table A going to
be the lift table, and table B going to
be the right table. Now what's going to happen
after we join the tables? All the fields from the left
table will be at the output, and then all the fields from the right table will
be added next to it. Joins combines the fields or
the columns of two tables. Now, in order to do joins,
we need two things. First, we need the key field. It is a field that you can
find it in both tables. After that, we have to
define the type of join, and we have to
choose between four different types of joints. We have the inner join, the left join, right
join and full join. If you know SQL, then
you know those types, it's exactly the same logic. But let's have a quick examples to understand the four types of joints. All right. Now we have this example where
we have two symbol tables, we have the customer's names
and the customer's age. We want to combine them
in one table because it makes no sense to have two
tables about the customers, we want to make one
customer's table and we want to combine them. In the first table, we
have the ID and the names, and the second table
we have as well, the IDs and the age. It's really easy. The key for this join is the customer Now, let's see the different output using those different
types of joints. So let's start with
the first type of join, the inner join. Inner join says the
output going to show only the matching rows from
the left and from the right. So that means any
unmatching rows will not be presented
at the output. Let's see how this works. The first thing that's
going to happen is that we're going to
compine first the field. First, we're going to
start with the left side. And then the right side. And now we're going to
start matching the rows. We're going to start
from the left side. Do we have the user ID one
in the right side as well, so we have a match. So in both tables, we have the customer ID one. So this we're going to
see it in the output. And then we proceed
on the left side. Do we have customer
ID number two as well on the right side.
You see, we don't have it. We have only the
customer number three. That means two is not matching on the right
side, and as well, the customer three
is not matching on the left side. That was it. If you use inner join
in this example, you will get only the
customer ID number one, since we find it in both tables. Let's go to the next one.
We have the left join. Left joint says
we're going to have everything from the left table
without checking anything. But from the right table, we're going to have
only the matching rows. If we do left join
between those two tables, we're going to have
the following output. First, we're going to have the fields from the left table. And the fields from the
right table near each other, and then we're going to
have all the customers from the left table
without checking anything. Everything going to be presented over here, those two customers, and then from the right side, we're going to have
only the matching rods. That's means, do we have the customer ID number
one on the right table? Yes, we have it. Then we're going to have it at the output. But the customer ID number two, we don't have it at
the right table, which means it's going to be
empty and empty means nulls. Here we're going to have
the values of nulls in both of the field ID and
as well in the age. That's it. This is the output
of left join. All right. Now we're going to
move to the next one. We have the right
join. You might already understand how it works. So we're going to have
all the rows from the right table and only the matching rows
from the left table. Let's see how the output
is going to be if we do right join between
those two tables. As usual, we're going to have all the fields
from the left, all the fields from the right. We're going to have
all the rows from the right table without
checking anything. We're going to have
those two customers, and then we start matching
from the left side. Do we have the
customer number one? Yes, we have it, we're
going to add it over here. Do we have the
customer number three? As you can see, we
have only the two, that means we don't
have informations, and we're going to
have the nulls. Those can be empty. And that's it. It is exactly the opposite
of the left join. Now to the final type of join, we have the full join. Full join means
everything from left and everything from right
without missing anything. Let's see what's going
to happen if we have full join between
those two tables. As usual, we start with the fields from the left
and from the right, and then we take everything
from the left side, we take those two
customers over here. From the right side,
we're going to have the matching grows for
those two customers. So for the ID number
one, we have this one. But for the two, we don't
have any matching grows, so we're going to
have nulls over here. But as you see, we don't have everything from
the right side, so the customer ID
number three is missing. So that's why using full joint, we're going to have those
informations over here, and then we're going to match it as well from the left side. So do we have any
customer number three on the left
side, we don't have. So that means we're going
to have nulls as well. Now by checking the output, you can see we have everything, all the data from left, all the data from right, and where there is no
match, we're going to have. As you can see, you need to be really careful with the type of join you are using
because using the wrong one, this could cause of losing data. If you want to be safe and you don't want to lose any data, then you have to use the
full join, but sadly, full joins are very slow and you're going to end up
having very big tables, especially if both tables have
a lot of unmatching rows. And now I want you to
understand how joints works in Tableau and what can happen in the background once
we join tables. So we have the data source, we have the visualizations, and inside the data source, we have the physical layer
and the logical layer. In the physical
layer, we're going to join both of the
tables, A and B. And once we do that, Tableau can create one new combined table, A and B in the logical layer. This table, we call
it a logical table, which contains data
from both tables. Then in the visualization layer, let's say we want to
select the fields of F two and F four. Tableau can query the data
source and the data source going to get the data from the new combined logical table, AB, and then send the data
back to the visualizations. As you can see the
interaction between the visualizations
and the data source, going to be at the
logical layer, the physical layer going to be completely out of the picture. That's simply how joins
works in tableau. All right. Now, how we
can do joints in Tableau? Let's say that we want to join the table customers
with the orders. First, we're going to go to
the left side over here, drank and drop the customers, and the joint is going to be
done at the physical layer. We have to go there.
Let's go inside the customers and now we
are at the physical layer, and we're going to take
the orders and just d and drop it over here
at the empty space. And with that stablea
as default can create an inner join between the
customers and the orders. And if we want to
customize the join, we're going to go over here
at the icon and click on it, and we have here
two things to do. First, we're going to
define the type of join. As we learned, we
have the inner left, right, and full outer join. You can just click between
them and see which data can be missing and which data can be presented as the example
that I showed you, I'm going to stay
with the inner join, and the next thing that we're going to define the
key for the join. Tableau did understood there's
customer ID from the left. There's customer
ID on the right, and this is the perfect
match, which is correct. But let's say it was
wrong and you want to choose the correct
key for the join. What you're going to do,
you're going to go to the left side over here.
Click on the arrow. You will get all the fields from the left table and
select the correct one, and this example, the
customer ID is correct, so I'm going to stay with it and you go to the right side. You have as well the
same icon over here, and you will get
all the fields from the right table and you select
the one that suits you. One more thing, your key for the join could be
not only one field, it could be multiple fields. So you can add more
fields over here. You go to the next row and select the next
field for the join. But in this example,
we have only one key. So I'm going to close this. We have set up the joints. You're going to stay
with the inner join, and we can go back to
the logical data model. And as you can see the table over here has a icon of joint. It tells us that this
logical tables is a result of joining two
tables. And that's it. This is how you can
do joins in tableau. All right, so that's
all for joints. Mix we will learn
the second methods how to compine
tables using union.
42. Union: All right. Now let's
talk about union. Let's say that we
have two tables and both of them has exactly
the same columns. Sometimes it makes sense to combine them in one big table, and we can do that
using the union. Once we do union,
what can happen? The columns and the rows of the left table
are going to be presented at the output
from the right table, only the rows are
going to be a pen at the output beneath
the first one. Union going to combine
the rows of two tables. In order to do the
union correctly, we have two requirements. First, both of the tables should have exactly the same
number of fields, and second, the field should have exactly the
same data types. As you can see, we
don't need a key between those two tables,
it's not like the join. All right. So now let's have
a quick and very simple example about the union. We have here very
simple two tables, the orders of 2022, the orders of 2023. As you can see,
both of the tables has exactly the same structure. We have two columns, the ID
and date in both tables, and it makes sense to merge them in one table, we call it orders. If we do union between them, what can happen at the output? It's going to start
from the left table, and it's going to take the
fields the ID and date, and then it's going to
take all the rows from the left side and put
it at their results. Now, from the right table, we will not take
again the fields because we have it already
from the left table. It's going to take only the rows and abandon it at the
end of the table. It's going to take
the two orders, three and four and just put it beneath the
table over here. That's it. It's very
simple and easy. It just needs exactly the
same number of columns or fields and exactly
the same data types. All right. So now let's
understand how union works in Tableau and what's
going to happen in the background once we do union. So we have here
again, our layers, and union is very
similar to join. In the physical layer, we
have our tables, A and B. Once we do union between them, Tableau going to create a new combined logical table where it's going to combines
the rows of both tables. In the visualization level, let's say that we
take the field F one, Tableau going to send a
query to the data source and data source going to ask the logical table
to get the data. Once Tableau get the data
from the data source, it's going to be present
it at the visualization. As you see again here, the interaction is between
the visualizations and the logical layer. All right. So now let's see how we
can do union in Tableau. We're going to work
with the two tables, orders and orders are sheaves, both of them has exactly
the same number of files, and as well, exactly
the same data types. So in order to do that, we're
going to take the orders, drag and rub it on
the logical layer. But you know we can do union
only in the physical layer. So we have to go
inside the orders, double click on it, and now
we are at the physical layer. Let's take the second table, the orders are sheaves. But now instead of dropping
it at the white space, because Tableu then going to create a joint, we
don't want to do that. We want to create a union. Drag and drop it
beneath the table. And as you can see,
Tableau going to say, drag table to do union. So if we just place
it beneath it, to going to do union between those two tables,
and as you can see, there is two lines, gray lines indicates that there is union. If you want to check
that, you can check at the result over
here, the data. We will get a new field
called table name. And you see some
records comes from the orders and other records comes from the orders are saves, which indicates that we have one combined table of both of the orders and
the orders are save. Let's go back to
the logical layer, so I'm going to
press here the X. And as you can see, we
have a new icon over here, it indicates that
we have a union. As you can see the tool tip of tableau, it explains everything. We have a logical
table called orders. It is the result of union table orders
and orders are sit. This is one way of doing
union between two tables. In Tableau, there is
another way to do that. Let me show you how to do it. First, I'm just
going to remove it, drag and drop it
somewhere over here. As you can see on the left side, we have something
called new union. Double clicon you can see
we have here two options, the manual and as
well, the automatic. The manual, we're going
to get the result exactly like we just
What we can do, we can just drag and drop
the tables over here, the orders and the orders are
save, and then click Okay. With that, we get exactly the same results without going to the physical layer
and drag and drop two tables and put it exactly
underneath the table. So this is a nice way to do
union between two tables. You can check that by just
going to the physical layer. So double click on it.
And as you can see, we got exactly the same results. And here we can check
the table name, we have orders, and we
have the orders are Si. All right. So now let's check the second option where we
can do union automatically. I will go back to
the logical layer and just remove the
union over here. Let's start a new one
from the scratch. And now we're going to go to the automatic. What do
we have over here? Imagine that we have around
100 tables about the orders. This is very common if you are not working with databases, you are working with files, and the files has limitations. What we're going to do,
we're going to go and split the files after day, after month, after
year, and so on. We end up having a lot of And it is very
painful if we're going to go and drag and drop all those files in
Tableau to do union. And instead of that, we're going to define for Tableau or rule, and Tableau going to go and
search for all files that's follow the rule and do union between them.
What that means? For example, we have
here two tables, the orders and the
orders are chief. What is the naming
convention over here? Both of them starts
with the orders. I could have a third table
called orders underscore 2022, orders, underscore
2023, and so on. There is a rule I'm following here in my naming convention, and I can specify
that in Tableau. Let's see how we can do that. Over here, the first option is going to include or execude. I'm going to leave
it as includes, and now I'm going to
specify the rule, it starts exactly with orders. After this word, it doesn't
matter what comes after that. It could be underscore, 2022, 2023, or
nothing, and so on. So anything after
that doesn't matter. What we're going to
specify after that, star stars means
anything after orders. And then we have some options to tell Tableau where exactly to search either at the subfolders
or at the parent folders. I'm going to leave it as it is. Then click Okay. So
now we have a union. Let's see what
Tableau going to say. It says we have a logical
table called union, and it says we have
many union table because we have the
automatic way of doing that. Now, let's check whether
Tableau did that correct. As you go to the right side
here and the overview, you find we have a new
field called path. It is the pass of the
files. Let's see that. I'm going to go to the
sheet one here and just drag and drop the pass
to see just the files. As you can see Tableau
did it correctly, we have the orders
chi and the orders. It's very nice way
if you have a lot of CSVs and excels to do it automatically instead of drag and drop all those tables. Usually in my projects, I never use this
because all the data is prepared in the data warehouses
or in the data lake. So with that, we have learned all the different options on how we can do union in Tableau. All right, so that's
all for union. Next, we will learn
very important methods, their relationships in
Tableau or recoll it nodles.
43. Relationships: All right. So now let's
talk about relationships. In 2020, Tau introduced a new methods on how to combine and connect
tables together, and they called
it relationships. They made it even as
a default methods on how to connect tables, since it's very
fast and flexible. So what is relationships and
how it works in tableau. It is completely different
than joins and union. If we have in the logical layer two logical tables, A and B. We can connect
them at this layer using the relationships. Think of the relationships as a contract between two tables. And when Tableau uses the
data from those tables, it has first to check
the contract in order to understand how
to generate the queries. And now it's very important
to understand that once we connect the tables
using relationships, the tables can stay
separated from each others, Tableau will not create
a new logical table. Everything going to stay as
it is without any changes. And here we just described the relationships
between two tables. Now in the visualization level, if we take the field F one from table A and F four from table
B, what's going to happen? First, Tableau going to
check the contract in order to understand how
to generate the queries, and then it's going to send
the query to the first table, and then it's going to
send another query to the table B in order to
get the data for a four. Then the data going
to be combined at the visualization level
and not the logical level. All right. Now let's
see how we can create relationships in Tableau. It's really easy.
We're going to stay at the data source page and
as we add a logical layer. We will not go to
the physical layer. A what we need is two tables. Let's take the orders, drag and drop it over
here in the data model, and then let's take
the customers. Now, as you can
see, as I'm moving, there is a noodle
or relationships. So let's drag it here. Tableau going to
automatically create relationships between the
orders and the customers. And now, how are we
going to configure and set up the relationship. So let's go to the noodle over
here and just click on it, and then there will
be no new window or something for the setup. We're going to go to
the metadata over here. If you don't see the
information like this, then you can go over here, and you will see
the relationships and the logical tables. So make sure you are
selecting the relationship. And there is like three things that we're going to set
up at the relationship. First, it's going to be the key. It's like the join key. It is common field
between the two tables. Now as you can see over
here, from the left table, we have the customer ID and the right table, we
have the customer ID. And Tableau did automatically
understand that this field could be used as
a key, which is correct. But if you want to change
it, you can go over here, so we will get a list of all
fields on the left table, and as well, you're
going to go over here. You'll get all the fields from the right and you can add
more fields for the key. Currently, it is correct, so I'm going to leave it as it is. Next, we're going to go to
the performance options. So we're going to extend the performance options over here, and we have here two things. We have the cardinality
and the integrity. If you leave it here as it is, as a defaults, nothing
going to go wrong, you will not lose any data, so you don't have to
change anything here unless you want to
optimize the performance. What do we have over here?
We have cardinality as many or one on the left side
and on the right side, you can define the same stuff. For the integrity, we have some records marks
and all records mats. In order to understand
those stuff, let's have an example. All right. So now we
can have example for the cardinality
in relationships. We have two tables, our
orders and customers. There is a relationships
between them and the key for the relationships
is the customer ID. And in the cardinalities,
there's two options, either we're going
to use many or one. In order to decide which
one is the correct one, we have to do data profiling. Data profiling means we're
going to do deep dives in the data to understand the
values inside our tables. And once we do data profiling, it's very easy to select
whether it's many or one. So now what those values
means, many and one. There is a simple rule for that. We use many if there is
double kits in the key, and we use one if the key is unique and does not have
any double kit inside it. So now let's check
the example in order to determine whether
it is many or one. So let's go to the
orders over here, and the customer ID. You see in those values
there is double kits. We have the customer ID on
here and once here as well. And the customer
ID two is twice. So those values are not unique
and contains double kits. That's why we call it Let's go to the customers over here. You can see we have
the customer one, two, three, and that's it. So those values are unique, and there is no
duplicates inside it. We don't have the customer
ID one again in the table. So that means we can
specify here one. So now let's go through all scenarios in order
to understand what can happen in Tableau once you
configure this. All right. So now let's run the
first scenario where Tableau going to define
it as a default, many to many relationship. So we have the left side many And on the right side,
we have as well many. And let's say in the
visualization level, we took the customer IDs from the order and the
sum of all sales, and then the name
of the customer. Alright. So now let's see
how Tableau can work. TlauFir going to check
the relationships. It's going to say, okay,
it's many too many. It's better to check
the whole tables on the left and on the right. So we're going to start
on the left side. We have the customer one. It's going to take it over here. And it's going to
sum all the sales. Since it's many,
table can understand, I have to check the whole table. Table can scan the
whole table one by one. It's going to say, we
have the sales 50. The next one is not the customer one and then go to the next. It's going to skip it,
and then we have, again, the customer ID number one, and it's going to
do the sum 50-30. That means we're going
to have the value of 80. It is the sum of the two sales. And now we're going to go to the right side to find the
name of the customers. It's going to check, it is many, so it's going to
scan the whole table for the customer ID one. So now the first
record, it finds, we have the customer ID one, it's going to take
Maria over here. But now Tableau will not stop. It's going to scan
the whole table. Since in the
relationships, it's many. But it doesn't
make sense because the customer ID here is unique. So Tableau going
to check whether there is customer
ID one over here, and then go to the next. And then it didn't
find anything, so it's going to stay like this. And now Table go to proceed
with the next customer. We have the customer
ID number two, we're going to have
it at the output. And then we're going to
have the sum of all sales. So Tableau go to scan
the whole orders in order to do the sum. So we have over here the 20, and then we have here ten. So the sum of that is 30, Tableau going to have
at the output 30. So that's it for the left table, we're going to go
to the right table. Table go to scan the
record one by one. So the first one is not the
customer ID number two. We have here a match, so John
going to be at the output. Tableau going to scan
the whole table, so it's going to go for
the three and so on. And as you can
see, the output is correct using the default
methods of many to many, but we have a problem with that. On the right table, Tableau
is doing a full scan. So with that, we are losing performance on the right side. So it's better to optimize it where we're going
to tell tableau. If you find a customer,
then that's it. You don't have to scan the
whole table because we have at the maximum one
record of each customer. There is no duplicates
and it is unique. And now we have to tell somehow this information for Tableau. In order to do that, we can
do it in the cardinality. So on the left side, it's
going to stay as many. Okay. But on the right side, we're
going to say it is one. And with that, Tablo go to understand, okay, it is unique, we don't have to scan
the whole table, and we're going to win
a lot of performance. All right. So now
let's see how table can work once we have
it as many to one. On the left side, nothing going to change
because we have many, so Table going to
scan the whole table. So for the customer one, the result going to be the same. But now on the right side,
things going to be changed. Tableau going to say, customer ID number one, there is a match. It's going to take
Maria as the output. But now Tableau going to stop. Tableau will not search for the customer ID one and
scan the whole table. So with that, Tableau will not be doing any unnecessary stuff, and we're going to
win some performance. We're going to go now
to the customer number two over here. Same information. So Tableau, get a scan. So do we have the customer
number two over here? No, so we jump to the next one. Yes, we have a match,
we're going to take John. But Tableau going
to stop as well, and we'll not scan
the next record. So as you can see, we have
exactly the same output, whether you are using many
to many or many to one. With many to one, we have one, the performance with Tableau going to stop the scan
on the right side. Alright, so now, let's
jump to the next scenario. Where we're going to
do something wrong. Where we're going to say, okay, the customer ID on the
left side is unique, and we're going to
put the value of one. And on the right side,
it doesn't matter. Let's have many, for example. So now we are telling
Tableau on the left side. The customer ID is unique, so you don't have to
scan the whole table, and we're going to have the
same example over here. So let's see what's going
to happen on the left side. Tableau going to start
with the first customer, say, customer ID one. The sum of sales is now 50 because I don't have
to scan the whole table. So it's going to stop
at the first records, and the output is
going to be 50. So now on the right side, once we are saying many, here it doesn't matter, the result we're going
to be correct. We're going to have
Maria. But Table go to scan the whole table, so the performance
going to be bad. Now we're going to jump
to the next customer. We have the customer number two. So Table going to have
it at the output. And here again,
the same problem, Table gonna say okay. We have the sale 20, The
customer ID is unique. We will not find it
again in the same table. I don't have to scan
the whole table. Table going to
take the value 20, I'm going to put
it at the output without checking
the other values. And here on the right
side, it doesn't matter. We have John, which is correct, but going to scan
the whole table. As you can see, if you make mistake here in
the cardinalities, you might have some
problems at the output where we're going to
have some missing data and wrong information. All right. So now let's run the last scenario
where we have on the left side one and on
the right side as we one. We're going to get
exactly the same output because we have it
wrong on the left side. The only good thing here
is that on the right side, table going to stop the
scan once it find a match, so it will not scan
the whole table. So at the output, we're going to get exactly the
same informations. And here we have
one one. All right. Now, let's quickly summarize. On the left side, we
have two criteria, the correctness and
the performance. Correctness is always way more important than
the performance. Let's start with
the first scenario. We have many to
many relationships. As you can see the
output was correct, but the performance was bad. Since Tableau doing
unnecessary full table scan on the right side. That's why I'm going
to give it ok for the correctness and not
ok for the performance. For the next scenario, we have
many to one relationship. The output was ok,
so it was correct. We're going to give it ok and
the performance was okay. Since To stops the scans
once it finds a match. That's why we're
going to win a lot of performance, and we're
going to give it. Let's jump to the third one. We have one to many
relationships. As you can see, the output was not okay. This
was not correct. We are missing data, so we're going to give
it not correct, and the performance was bad
because on the right side, we are doing unnecessary scans. That means it was the
worst scenario over here. Then the last one we have
one to one relationship. The output was not
correct, not okay. But the performance was okay,
since on the right side, we are not doing any
unnecessary scans, but to be honest, correctness is way more important
than the performance. And that's why Tu
always recommend to stay at many to
many relationships if you are not sure because
you're always going to get correct answers
at the output. But if your data is big, you will get some
bad performance. So if you want to have
good performance, you have to invest time
in analyzing your data, doing data profiling to
understand Is it many, is it one and then change it, but you have to be
sure about your data. Otherwise, you will get
wrong information at your visualizations,
and that's really bad. So that means for this example, the safe way to do it to stay at many to
many relationships, but the professional
one is to have many to one relationships
to get good performance. But this is not
always a scenario. Just imagine we switch the tables between
customers and orders. So customers is left
and orders is right. Then one to many relationships is going to be the correct one. So be careful here with the
sides. All right, everyone. So now let's understand the
integrity options in Tableau. Each relationship has two sides, the left table and
the right table. When we are changing the
settings of the integrity, we limit which joints can
happen in the visualization. So here we have two options, some record match and
all record match. And with that, we
have four scenarios. First, we can choose some record match in both
left and right tables, and if we do that,
then all types of joints are possible
in the visualization. Inner left, right,
and full join. But now, if we choose
all record match on the left and some record
match on the right, so what can happen now we are limiting the types of
joints to only two types, inner and right join. And the next one, it
can be the opposite, so we have some
record match on the left and all record
match on the right. What can happen again, here we limit the types of
joints to only two types, the inner and left join. And in the last scenario, if we choose all record
match on both sides, the left and the right,
then here we limit tableau to only one type
of joint, inner join. As you can see, it's
very similar to joints, we are just defining how
Tableau should work. When we use some record match, we allow more types of joints, and when we use the
option or record match, then we are limiting Tableau
with the types of join. Here it's very important to understand that we
have a trade off. If you use or record match
and go down this path, you will likely experience
better performance, but you will increase
the risk of losing data. But if you choose to use some
record match and you go up, you will ensure the completeness
and the flexibility, but you are sacrificing some
resources and performance. Tableau team here decided to
go with the first scenario where we have on the left and the right some record match. And I can understand that's because it's
more important to have completeness and flexibility
more than performance. Let's have a look at our data. So here we have customers
that didn't order anything. So the customer number three didn't order
anything over here, and we don't have a match of it. So we can say some
records matches like the one and two are
matching on the left side, but some other records
does not match. So we don't have an order from the customer
ID number three. So that means in our database, we could have customers in the customer table that
didn't order anything. So the correct option over
here is some records matches. Now, let's analyze the orders. As you can see, we have the
customer ID number one. We find it in the customers. Two, as well, and so on. So we can see that
all the records or all the customers IDs in the orders has a match
from the customers. Well, that means we can
select all records match. We don't have, for example, customer ID four over here, which does not have a
match on the right side. So that means in our database, All orders should come
from our customers, and we should not have any order without a known customer. So after the analysis, we can say, on the left side, on the orders, we have
always a matching records. So we're going to select
all records matches. But on the right side, we might have customers
that didn't order anything. Then we can say some
records matches. If we do it like this, we can
prevent Tableau from doing any extra stuff by analyzing
the nulls, like in SQL, if you have full outer join, you will get huge
amount of data and sometimes if you're using inner join or left
join and so on, you will get better performance. So if you know exactly what
is going on in your data, then select the
correct integrity. Otherwise, just leave
it as a default. Some records matches on
the left on the right, you will be safe, you
will get correct answers. Alright, so now pack to Tableau, relationships are really easy. We just have to drag
those two tables and Tableau create the
relationships between them. Just get the key between the
relationships correct and everything going to be fine and leave those staff as a default. But if you want to be more provisional and get better
performance in Tableau, you have to do data
profiling and then select the correct one if you are
100% sure So in this example, the orders over here has
many in the customer IDs, but we have on the right
side one for the customers, and then for the integrity
on the orders or records matches because all orders has a customer ID in
the customer's table. But we might have some customers that didn't order anything, so I'm going to leave it as some records matches, and that's it. That is relationships
in Tableau. Alright, so that's all about
the very important concepts of the relationships
and how it works. Next, we will learn
very unique methods, the data blending in Tableau.
44. Data Blending: All right. So now let's talk about data blending in tableau. But first, some coffee.
Let's go. All right. So now let's have
this example where we have in the data
source table A, and now indivisualization level, we want to use the data
from the field F one. And you know by now
Table go to send a query to the data
source in order to get the data
of the F one from the table to show it
in divisualization. And now, since this data source was the first one to be queried and to be used and table call
it a primary data source. And in Tableau,
anything is primary, going to get the blue color. That's why you will see
like blue icon indicates that this data source
is a primary Now, sometimes you are in a
situation where we want to get the data from
another data source. For example, we have another data source with the table B, and we want to add the
visualizations to show the data of F four. So
what's going to happen? Table going to send
another query to the second data source in order to get the data of F four, and then the data can be
forward to the visualizations. And here, Table go to call this data source as a
secondary data source. And it will market
with an orange icon. Now in order for this to
work where we're going to get data from two
different data sources, we have somehow to connect them. And here exactly, we're going to use the very unique
way in Tableau where we can connect
data sources together using the
data blending. Data blending can
only be done at the visualization level
on the worksheet page, not in the data source. Now you might ask how Tableau is joining those tables at
the visualization level? Well, Tableau is
using a left join. We cannot change that
sadly. It is fixed. Since it's like a lift joint, Tableau going to
get all the data from the primary data source, and only the matching records from the Scrodery data source. Now to summarize
data blending is the method of combining data at the visualization levels from two different data
sources using left join. This is very unique
feature in Tableau. You don't find it in
any other BI tool like Microsoft Par PI. You cannot, for example, there combine data from two
different published datasets. All right. Now let's see how we can do data blending in Tableau, and for this, we need
two data sources. The first one going to be from the CSV files that we have
from the small datasets. So we're going to go
to the text files, and let's take the
products over here. This is our first data source. Now let's go and create the second data source
in order to do that. You can go to this
icon over here. And then click on new data
source. Let's go there. It's going to be from the JS file that I prepared for you. Let's go to JS and we
have the product prices. Let's open that. Since it's JS we have to select the schema. Let's go to the data over here
and click and then click. Now we have two data sources. In order to switch between them, we go again to this
icon over here, and you can see we have
now two data sources, and by just selecting
the data source, you will switch to it. Now, in order to do
the data blending and to connect those
two data sources, we cannot do it at
the data source page. We have to go to the
visualization level to the worksheet page. So let's do that. I'm going to go to the sheet
one over here. And as you can see, at the
data pane on the left side, we have two data sources, and by just clicking on them, you can switch in order to
see the tables inside them. So now we have to decide
which data source is the primary and which
one is the secondary. For this example,
I will say that the product is the primary one. And how we're going to
do that, by just using the data in the visualizations
as the first data source. So I'm just going to
take the product ID, drag and drop it on the rows. And immediately, Tlou
can understand a, this is the primary data source, and it's going to market
with a blue icon over here, indicating that this is
our primary data source. We still don't have a
secondary data source. So you see there is no
orange icon over here, because in our view, we have data only from one data source. Now in order to get the data
from the second data source, we're going to switch
to the product prices, and you can see Tu
immediately turn this data source as a
secondary data source. So you can see over here, we have the orange icon indicating that this is
secondary data source, and any field that we are using, it's going to
market with orange. So you can see over
here, the price, it has an orange on.
It's very simple. Now, let's say that
the product ID is not the key of order to join
those two data sources. You want to change that.
In order to do that, we're going to go to the
data over here in the menu and then go to the Edit
plintRlationships. Let's click on that. We'll
get a new window over here. And here we have two options
automatic and custom. If you leave it as automatic
table and to figure out which key to join
those data sources. Here in this example
is the product ID. But if you want to change that, you can go to the
custom It's like join. You have to specify from the
left and from the right, which fields are the key
in order to do the join. So if you want to change that,
just double click on it, and then you have
on the left side, the primary data source
and the right side, the secondary data source, and then you select the fields that are the key for the join. So I'm going to
leave it as it is, and let's add another key, so I will go over here
and add for example, the category is from the left side and
from the right side, the data index, which
is really wrong. Let's click OK. And then again. You will see on the left side. Now we have another
chain on the data index, and you can see it's
like broken chain. That means it is not
yet used in the join. If you want to activate it, just click on it, and you will see we have
an active chain. Now as you can see
the result is wrong because it doesn't make
sense to use this key, but I just want to
show you how you can deactivate and activate the key of the join
between two data sources by just clicking on them. Now let's just correct this. I want to have only
the product ID as the key for the join. That means I'm
going to deactivate the data index over here. This is how you can define the
key for the data blending. Now, one thing that
is very important to understand that
everything that we've done in the data blending is only relevant for
this worksheets. If I go to another worksheet, let's go over here
and create a new one. Now as you can see over
here, it's completely reset. The two data source,
we have it again, but we don't have it as the primary and secondary
data sources. That means in each worksheets, we can make a new decision. At the sheet number one, the products the primary, I can change my mind here, where I can say,
the product prices now is the primary data source. If I take anything over here, You can see product
prices is the primary. And if I go to the
products and let's say I'm going to take the
product name over here, products can be the secondary. I just switched between them depending on
the requirements. If we go back to the
sheet number one, we see that the product
is the primary. But if we go to the
sheet number two, the product prices now is the pri This is really
nice because it gives us relief flexibility where we
can decide in each worksheet which one is the primary
and which one is the secondary depending
on our requirements. So data blending is very
unique and great way on how to connect and
combine data. All right. So with that, you have
now an overview of all four methods of
combining tables. Next, we will go and
compare them side by side, and we will start
with the differences between joins and union.
45. Join vs Union: All right, so now, what is the main difference
between joins and unions? Both of them are very similar. They're going to combine two
tables in one big table, but the difference here, that's how the data going
to be combined. In joints, the fields of both tables going
to be combined. So we're going to take
all the fields from the left side and beside it, all the fields from
the right side. So the results we're going
to get one big wild table. But in the other
hand in the unions, two tables is going
to be combined. But instead of
combining the fields, here we're going to combine
the rows of both tables. So we will get all the rows from the first table and beneath it, all the rows from
the right table. But both of them has
exactly the same columns. So joins comps the fields
and Union comps the rows. Alright, so that was
the main difference between join and union. Next, we will learn
the differences between joins and data blending.
46. Joins vs Data Blending: All right. Now the question is, what is the main difference between joints and
data blending? Data blending is
like a lift joint, but the main difference here is that's when the aggregation
is going to be performed. In joints, the data
can be combined first and then the
aggregation can happen. But in data blending is
exactly the opposite. The aggregation going to happen first and then the data
going to be combined. Now let's have a simple example in order to understand
what this means. So again, we have our tables,
customers and orders. First, we're going
to do the left join, and afterward we're going to do the data lending between them in order to understand
the differences between them in the output. All right, now we're going
to start with the left join, you know left join
all the data from the left side and only the
matching on the right side. We start as usual by combining
the fields from left, the fields from right, and
we start record by record. So we're going to take
the customer number one, and we're going to
search for the matches. We have two rows on the orders. So that means Maria
are going to be twice in the output because
there's two orders. And then we're going
to go to the next one. Customer ID number two, we have only one order for that. We're going to have
it at the output. And George don't
have any orders. So that means we're gonna have
null here. Here and here. As you can see with
the left join, first we combine the data, the raw data without doing any aggregations and afterward
in the visualizations, we can find, for example, the sum of sales or
the average and so on. Now let's check
the data blending how it works. All right. Now, let's say we have
all the fields from the primary data
source and beside it, all the fields from the
secondric data source. This is like left join,
we're going to take all the data from the
primary data source. We're going to get all the
three customers over here. But the main difference here is that there will
be no Dublicates. As you can see, we
have here Maria twice, but in data blending, you will not get any Dublicates. Now here comes the difference
before we start getting the data from the orders from
the secondary data source. An aggregation can happen. So for example, with
the customer ID number one, we have two rows. The two rows will not be
presented at the output, first, it's going to be
like an aggregation. And now it's very important
to understand that the fields in Tableau are split between
dimensions and measures. In the next statorial I'm going to explain
that in details. But now, the measures
can be aggregated, the dimensions will
not be aggregated. So for example, the customer
ID, it is not a measure. It is a dimension. So
Tau cannot aggregate it. But since we have it
twice the same value, Tableau can arrive here one. And then the next one,
we have the sales. It is measured. Tableau can aggregate first and
then combine it. The sum of that is going
to be 80. Let's two dots. And the next one,
we have the date. Here it is a dimension,
cannot be aggregated. And since we have two
different values, dorit at the output a star. Since Tableau can provide at
the output only one value, and we have here two values. Tableau will not decide which
one of them going to be. Table can add a star. So what's going to happen in
the output going to be star? I know this is really not nice, but this is how data
blending works. As you can see, table
always tried to aggregate the data
before combine it. Now, let's move to
the next customer, we have John, and in the orders, we have only one record. That means nothing
going to be aggregated. The outbok going to
be exactly the same. And then for the
customer, George, there is no
information over here. We will get as well nulls. And this is the output
of data blending. And this is exactly what I mean with the main
differences between joints and blending is when
we do the aggregations. So in the left join,
as you can see, first we combine the
row data togethers, and afterwards we can do aggregations in the
visualizations. But in data blending, first, the data
should be aggregated, especially from the
secondary data source, and afterwards, the data going
to be combined in Tableau. All right. So with
that, we have learned the main differences between
joints and data blending. Next, it's important
to one. We will learn the main differences between
joints and relationships.
47. Joins vs Relationships: All right. So now, what
are the main differences between joints and
relationships? If you are using joints, things can get really static and we might lose as
well, a lot of data. But if you are using
relationships in our data model, then we will get
more flexibility, and we will not lose any data. Now in order to understand this, let's check this example. We have prepared
two data sources, one with joints and the
other with relationships. The first one with the orders, if I go to the physical layer, you can see we have a lift joint between orders and customers. And let's check the second one. We have the relationships. We have as well the same tables, we have orders and customers. And between them, there
is a relationship. Now, if you check our data, we can find that there
is a five customers, and in the orders, there is only four
customers that did order. So if you check over
here the customer ID, you will not find
the ID number five. That means this customer
didn't order anything. This is no problem for
the relationships, but if you go to the
joints over here, and you check the data, you will see that we don't have a customer ID number
five at all in our data. So you can check, we have one, two, three, four, and so on. So the customer ID number five
is completely disappeared. And that's because we have a lift joint between the
orders and the customers, only the matching roads from the right side can be
presented at the final table. That means we lost
this customer, and if we are at the
visualizations, let's go over here. Let's say we want to count how many customers do we
have in our database. Let's drag and drop
the customer ID, and let's turn it to a
measure of count distinct. Okay. Our data says, we have four customers. If we go to the relationships, let's open another one and
switch to the relationships, and let's take the customer
ID again over here, switch it to a measure
and count distinct. You will see we
didn't lose the data. We have five customers
in our database, and the relationship is going to give us more correct answers. Now you might say,
we can fix this if we change the type of
join. That's right. If I go to the data source, and then I go to the
joins Go to the orders, and I just switch
this to the right, so that means we're going
to get all the data from customers and only
matching from the orders. Let's close this and go back
to our sheet number one. You will see let me close this, you will see that we
have five customers. So with that we have correct answer as well
as with the join. And here we come
to the next point that things are
really not flexible. So that means if I'm
building visualizations, where sometimes I'm asking how many customers do we have or how many orders do we have, I cannot each time go to the data source and
change the type of join. Because once I decide
it's a lift joint, it's going to stay for all the worksheets
as a lift joint. Unless I'm doing full outer
join between the two tables, and if you are working
with big tables, then you will get a
very big merge table which can close everything down. And this is exactly what I mean. If you are using joins, you will lose data if you are using left join or right join, and as well, things
are really static. With the relationships, if we
go to the sheet number two, here things are more flexible because we didn't
merge anything. The data state separated
from each other. We just described the
relationships between them. So if in worksheet I'm doing analysis about
the customers, it will not affect the
next visualizations if I'm doing analysis
about the orders. Because we didn't lose any data. And I don't have to worry, do we have left
join or right join? Should we change it and so on. So it's more flexible and we will get always correct answers. So that's why joints are static
and you might lose data, but relationships are more flexible and you will
not lose any data. All right, so there's another
issue with the joints, if you compare to
the relationships. Sometimes in joints,
we might get wrong answers if you are doing calculations
on the measures. So let's take this example. On the customers tables,
we have the score. So for each customers, we have a score, and we
have those five customers. The average of this
score going to be 625. Now let's stick in
Tableau the results from joints and
relationships. All right. So now we are at
the relationships, and let's take the score and drop it over
here on the text. And then let's find the average, so we're going to go over here. Measures and the average. So in relationships, we got the correct answer, we have 625. And now let's check the joints. We are at the data
source of joints. I'm going to take the score, drag and drop it on the text, and now we're going to
switch as well to average. And here we got the
wrong results, 585. So what happened here?
Well, the answer for that is sometimes if we merge
two tables together, we might get double kits. So let's check the data. If you go to the data source again. In the joins, if we
go to the score, We would have tablicts because some customers have
more than one order, and that going to
result in a lot of tablicts if we merge the
customers and orders, and if you do the average, you will get the wrong answer
as we saw in the results. If you switch to
the relationships, And we go to the customers. We see the score over
here on the right side. There is no duplicates and we will get the correct answer. And that's going
to guarantee for us that's using relationships. We will get correct answers if you are doing calculations, and that's way better than
having duplicate in our data. We might never get correct
answers from joints. And that's why
Tableau introduced in 2022 relationships just to fix all those problems with the
joints and they made it as the default methods on
how to connect stables. All right. So
that's all for now. And next, we will compare
all the four methods side by side in order to
understand the big picture.
48. JOIN vs UNION vs RELATION vs BLENDING: All right. So now we're
going to go and compare the four methods on how to
combine data in Tableau, unions, joints,
relationships, and data blending side by
side. So let's go. The first point is, in which page in which layer
we can use the method. Now, both union and joints, we can create them at the data source page in the
physical layer. And as will the relationship, we can use it at the
data source page, but in the logical layer. And finally, the data
blending could be used at the visualization level
in the worksheet page. And the next point, can
we use the method in order to connect tables from
different data sources, For union joints and
relationships, we cannot do that. It should be done in
the same data source. But only the data blending
could be used in order to connect tables from
different data sources. The next point is after
using the methods, are the tables
going to be merged? In unions and joints, they're going to merge
the tables and they're going to create
completely new tables. But if you are using
relationships and data blending, they will not create anything. The next point is
about the flexibility. If you are going to
use unions and joints, the decisions that you are
making at the data source can affect all the worksheets
and the visualizations. But if you are using
relationships and data blending, you have way more flexibility. For example, the data blending, you can decide on
each worksheet page. Now, if you are talking about
the joint types in joints, we have inner left,
right, and full. In the relationships,
we can have as well exactly the same
behavior as joints. But in data blending, it is fixed, we have
only left join. And the next point, if you
ask me to rank these methods, I would say, and Tu as well can say, always use relationships. After that comes
the data blending, it is really great way on
how to combine tables from different data sources and
the flexibility that we have. And then the third one I'm
going to say that joins. I would not rank union because
it's completely different than the methods of joining relationships, and
data blending. So always try to go
with the relationships. Now, let's see the big picture on how those four methods works. And let's start with joints, they're going to connect two tables at the
physical layer, and they're going to
create completely new logical table in the logical layer
where it's going to cobine the fields
of both tables. And then at the
visualization layer, the data says go to create
query at the data source, and data source can
to get the data from the logical table. And same thing for the union, you can create it at the
physical layer of two tables, and they're going to create
as well completely new table where the rows of both
tables can be compined. At the visualizations,
tableg send query to the data source and
the data source going to get the data
from the logical layer. Now to the third mesode
of the relationships, we have two tables
at the logical layer and table will not combine
or create anything. We are just describing the
relationship between A and B. At the visualization level, Table going to ask
the data source and the data source going
to get the data from the separate tables. Finally, the data blending, we have two data sources. The first one is
going to be called the primary data source. The second one is the
secondary data source. So first tableca send query
to the primary data source, and then another query to
the secondary data source. Here, it's important
that the aggregation going to happen before
the data is combined, and we are combining the data at the visualization level
using data blending. So as you can see, joints and union happen in the
physical layer. In the logical layer, we
can do relationships, and at the visualization level, we can do data blending. All right, Kay, so with that, you have learned
everything that you need about combining
tables in Tableau. And next, we're going to practice where we're
going to create two data sources using the new skills that
you have just learned.
49. Build Two Data Sources: Okay. Okay. All right. Now we're going to
create together two data sources because
we have two datasets, the big one, and the small one. And during that, I want to
show you how I usually make decisions on when to use
which methods. Let's go. Okay, guys. Now, let's close
everything and start from the scratch in order to get the data source
correctly created. Let's start Tableau Public. We're going to create now
the small data source on top of our small dataset. Let's go to the connectors on the left side and
click on Tex file. And then it doesn't matter
which one you're going to use. Let's take the orders open. I will delete it anyway in
order to explain how I start. So previously, I showed you the data model of our data sets. We have Star Schema. Where we have facts
and dimensions, I always start with
the fact table. Doesn't matter
whether you are using star schema or snowflake. Always start with
the fact table. So our fact table is orders. So let's just drag and drop
it here on the logical layer, and then I continue
with the dimensions, so we have customers
and products. So let's start with
the customers, drag and drop
somewhere over here, and tableau and to create a relationship between
the orders and customers. And since we are talking
about two different entities, so we have orders and customers, I always use relationships
between them. And now let's check
the relationships whether everything is correct. So we go over here
on the meta data. We see the customer
ID from lift, a customer ID from
right, which is correct. And now let's go to the
performance options. I will change only
the cardinality. If the quality of
our data is bad, and we haven't done
any data profiling, Then the pace is to
leave it as default. So many to many
some record matches on the left and on the right. But in the datasets, we already checked that so
we have clean star schema, and always on the fact side, on the left side over here, it's going to stay as many. And all the dimensions on the
right side like customers, it's going to be one
because we have usually, for example, unique customers
or unique products. So I will go and chain
that on the right side as one because it is dimension
side and on the fact side, it's going to stay as many. I will not touch those
integrity stuff. So we're going to
leave it as it is. And that's it, we have now the customers and the orders
connected to each other. And now before we continue
building our data model, we have to check
something very important. Are we working on the
correct data sets in the correct format? Now if you go to the
orders over here, and here we have some few
fields like the sales, quantity discount profits, all those information
should be in number. You can check that by
checking the icons, the data type icons, and
if they are like this, hash value over here, and green, if you click on it, T going
to say it is number decimal. So if you see it like this,
number decimal or number, then everything is fine. But if you see it as a string, for example, if you go over
here and switch it to string. So if you see this field as a string, there's
something wrong. So if your data is like ABC, then you are working
with the wrong datasets. It's not correct. So you should see
it like a number. Now the question is why it's
wrong, why it's not correct? Why Tableau didn't
find it as a number. Well, there's different
representations of the decimal separator
in decimal numbers. Some countries like in
Europe, we have a comma. But in many other countries
like in USA in Asia, we have a dot between the decimal number
and the whole number. Now, for example,
I'm now in Germany, and my data is
separated with a dot. What can happen table will not understand this
is a decimal number, and it's going to
show it as a string. And that's why in
the download link, I have prepared two datasets
depend on your location. The Europe training datasets and the non Europe
training datasets. The Europe training datasets, all decimal numbers
are sparated with ma and for all other countries, they are sparated with a dot
for the first downloader. So now the question
is, how to fix it? Well, go and download the
correct training dataset. Is another way in order
to fix it, for example, now, I have the n
Europe dataset, and as you can see, the
discount sales profit, everything is wrong,
everything EPC and string. Now, some of you think,
it's really easy fix. I can go to the data
type over here and switch it from string
to a number of decimal. So once I do that,
what's going to happen, everything going to be
null, so it will not work. Because Tableau
don't know how to convert those numbers correctly. So let's move it back to a string in order to
see the data again. There is a fix for that if you go to the orders over here. Ertic connect and let's go
to the text file properties. Here we have
different properties about the files
like the separator. Here we have it semicolon, so Tableau did
detect it correctly. But what's more
important than this is the format of the decimal
number, the local. Here we have to
choose a local which is matching to the
current format. The current format is a
dot here in this example. What we're going to
do, we're going to go over here and search for, for example, United States, And as you can see,
table and understand the correct format and everything can be
changed to a number. The solution, either you can
use the correct datasets or you can go and configure the
properties of each file. So I would say you can go
and try United States or Germany until you have
the data type number. Make sure that in the orders, all those informations
is the data type number. All right. So now
let's go and keep building our data model
into data source. Let's go to the next dimension. We have the products. A what
we're going to do is just drag and drop. And
then release it. Tableau can create another
relationship between them. Let's check that again. Click on that, go to the
metadata, scroll up. Tableau did automatically find the key for the relationship. It is the product ID,
which is correct. And now the same
thing, we're going to go to the performance options. On the left side,
on the fact side, it's going to stay as many, and on the right side,
it's going to be one. So on the right side,
we have the dimension. It's going to be
one. You can check that easily if you
click on the products. And here you check the data, you can see the product
ID is a unique field. There is no Dublicate inside it, and we can go and use one. If you are not
sure, just leave it as many to many relationship. So let's go again to
the relationship. We have it many to
one, and I'm going to leave it here as some
recurse matches, no problem. Let's go to the other tables. We have here the
customer's details. Here we have two
options. Either we're going to use
relationships or joints. You can go over here
and just drag and drop, put it near the customers
as a relationship, but to be honest in data moding if I have two objects
about the same entity. Here we have customers and here another information
about the customers. I tend to merge those
two tables in one. This is different that talking about the orders and customers, they are completely
different entities. Usually in data warehouses, I prepare this tab
in the database, or we can stay on tableau and merge those two tables into one, and we can do that using joints. So what I'm going to
do, I'm just going to remove the customer's
details away, and then we're going to
go to the physical layer inside the customers, and then we're going to
take the customer's details and drop it over here. And table as default going
to leave it as inner join. But to be honest, the
customers table is for me, the main table about
the customers, and customer details is
like secondary table. So in order to not lose
anything from the lift side, I'm going to change the
type of join to lift join. Let's do that. I'm
going to click on the icon and then
select lift join. Then we can check the results. Well, the main thing
that we don't get doublicates or we don't
lose any customers. So as you can see the output, we have our five customers. There is no doublicates, and
we didn't lose anything. Let's go back to
the logical layer and just to close this. As you can see, we
have list tables, and we have one entity
called customers. We don't have a lot of tables, and I usually do that if we have a lot of tables
about the same topic. Now let's go to the next table, we have the order achieved. And here we have
the same situation. We have two tables describing the same entity, the orders. But of course, we
can connect it as a relationships to the orders. But again, I like to minimize the number of tables
that I'm dealing with, and I'm going to go and merge
those two tables together. So here we have again two
options, unions or joints. If the tables has
exactly the same number of columns and the
same data types, then we can use union. In order to do that,
we have to do data So either you open the CSV files and compare them together, or we can go over here. There is a small icon like a table, and if you click on it, Table going to show you a
sample of data in order to do data profiling and to understand the content of this table. So let's just make it bigger. So we have the order date, shipping date, customer
ID, product ID, and as well, the unit
price and so on, and we can compare it to
the orders over here. Let's just make it bigger, and we can find exactly
the same number of fields, the same content,
the same data types. So that means we can go
and do union between them. In order to do that,
I'm just going to close this and go to the physical
layer inside the orders. I like to drag and drop
just beneath it over here. And now you can see
we have a union. Let's check that on the right
side in the table name. So we have orders and
we have orders archive. With that, we combine
both of the tables in one logical table.
Let's close this. As you can see, we have the icon that there is inside it a union, and with that we have
only three tables. Instead of having five tables, it is just easier at
the visualizations to deal with three tables
instead of five tables. The data model is much easier to understand
and to explain. With that, we have connected
all the CSV files together, but we still have one file, the adjacent file prices. Sadly, we cannot connect
it with the others in the same data source because
it is different file type. But we still can connect
it to them if we create a second data source
and use data blending. Now that sets, we have our
fact table and the dimension. We're going to give it a name. I'm going to call it
small data source. Now you can pass
at the video and go and create the
big data source. If we are done, I'm
going to go and create the big data source. So I'm going to go over here, new data source, going to
click on the text file. I will just go back
to the big one. Here we have only the three. So we start with the orders. Always we start with
the fact table, and then we take the dimensions, let's take the customers. Customers. I already
checked all those IDs. They are unique, so I can go to the relationships
over here and change it to one on the right side and
on the fact side, it's going to stay as many. The same we're
going to do for the products, drag and drop. And all the IDs of the
products are unique, so we can go to the performance
option just to make sure we select the
relationship and select one. That's it. I'm just going
to call it big data source. So now in order not to
lose those data sources, in Tableau Public, we have to publish to our public account. So I will go and do
that. We're going to go to the sheet over here. Let's just take something like the customers drag
and drop on the rows. And that's it. I will just
go over here and publish it, save to Tableau Public. And I have to sign in. I'm going to call it data
sources then safe. Now it start publishing
to our profile. So that says, if you want
to download the file, you can go over here and
download Tableau workbook. All right, K. So with that, we have created two data
sources on top of our datasets, and we can use them in
the whole tutorial. All right, K. With that, you have learned
everything about the Tableau data moduling
in data sources, and how to compine tables
using the four methods. And in the next section, we will start talking about
the meta data in Tableau. We will learn many
important tableau concepts for data visualizations.
50. #6 Section Introduction | Tableau Metadata: The meta data of Tableau. Understanding the
tableau metadata concepts like data types, measures, dimensions,
discrete, continuous, is very important
in order to build a correct data visualizations
in Tableau and as well, can help you to understand how Tableau works with your data. So first, I'm going to introduce you to the meta data in Tableau to learn what
happens to your data once you connect it to Tableau. Next, we're going to dive into all data types in
Tableau like integer, strain date, and so on. After that, we're
going to learn about the data type rules like the geographic rule
and the image role. After that, we're
going to cover very important concepts in Tableau. We have dimensions, measures,
discrete and continuous. And of course, in order to understand the
differences between them, we're going to
compare them side by side in order to understand
the big picture. So now let's start
with the first topic where we can have an overview of the basic concepts of meta data in Tableau.
Now, let's go.
51. Introduction to Tableau Metadata: All right. So now we're going to
have a quick introduction to the table metadata
in the data sources. In order to understand
what's going to happen to our data once
we connect it to Tableau. After connecting our
data to Tableau and building the data model
in the data sources, the next step is to check the metadata of the
tables and the fields. Because once you connect
your data to Tableau, Tableau can start analyzing the content of your data to make assumptions about the types and roles of each field
in the data source. Table can assign each
field to data types integer, string,
date, and so on. Data types gives us
information about the kind of data stored
inside our datasets. This piece of information
is very helpful for Tableau in order to understand how to
deal with your data, which rules, operations,
calculations can be performed. One more thing that
Tableau going to do is going to assign each
field to a role. These roles can help Tableau
building the visualizations. The first set of roles, we have dimensions and measures. Dimension fields
define the level of details of the view and the fields with the roll measure going to be used for
aggregations in the view. And we have another
set of roles, we have discrete and continuous. These rules can help tableau
by plotting the visuals. Discrete fields can break
the view to separate values, and the fields with the
continuous roles can to plot unbroken chain and
connected values in the view. I call all those informations
about your field as a metadata in the
Tableau data source. One more thing that I
want to tell you that. Those assumptions that
Tableau makes about your field is
correct around 90%. So that means there's
a possibility that those assumptions
from Tableau are wrong. That's why it's very
important after you build the data model is to have a
double check on the metadata. To check that all
the informations are assigned correctly. Otherwise, you're going to have bad quality and bad results at the visualizations.
All right. So next we're going to
do a deep dive into these important
concepts in order to understand them and
the differences between Alright, so that was
a quick introduction to the meta data in Tableau. Next, we will dive into the
basic data types in Tableau, like integer, string,
date, and so on.
52. Data Types: All right, so we can find data
types not only in Tableau, but in all programming
languages, but they don't support
exactly the same data types. And that's why if
you are learning new programming language or
an application like Tableau, it's very important
to understand which data types they support. Now the question is,
what is a data type? Data type give us
information about the kind of information
stored inside our data. This piece of information
is very important for programming languages
and applications like Tablo. In order to understand how to deal with your
data, which rules, operations, and
calculations could be performed on
top of your data. Now, if you look
closely to our data, you can see that each field in our data source must be assigned to a small
icon or a simple. Those icons indicates the
data types of each field. Now, one more thing, once we
connect our data to Tableau, Tableau can analyze
our data in order to assign automatically the correct
data type to our fields. Well, most of the times
Tau does it correctly, but sometimes things
go wrong or you want to change the data
type of specific field. This is really easy.
Either you can do it on the worksheet page or at
the data source page, you will get exactly
the same effect. Let's go to the
data source page. Let's go to the orders and
click on the icon over here. You can see it's number hole. We can change it to string. What we're going to
do we just click on the string, and that's it. We just change the data
type of the order ID. But let's say we
want to change it back as Tableau did
it at the start. What we're going to
do, we're going to go to the icon over here again, and then we go to the default. It's back to the
original data type that tabled did as
sign at the start. Here, one more thing to notice
that the data types are really sensitive in the
joints and the relationships. For example, if we go
to this relationship over here between the
orders and the customers, the key is the customer ID. Those keys should have
exactly the same data type. Let's say we go to the orders. And let's change the customer
ID from number to string. So we're going to
go to the string over here and we change it. Immediately, you can
say at the data model, the relationship
between the orders and customers is now broken. You can see at the tooltip, it's going to say type mismatch
between the customer ID, the string, and the
customer ID number. As you can see now,
Tableau is very sensitive with the
data type of the key. Whether you are
using relationships, joints, data blending,
doesn't matter. They should have exactly
the same data type. Now in order to correct
it, as you can see, we don't have any more the
data review, the data grid. How we can change
now the data type, we're going to go to the MaataGrid we're going
to do the same thing. We're going to go
to the customer ID, click on the data type icon and change it back to
default or to number. I'm just going to
click on default. Table going to be happy now and the tables are
related again. The third way to
change the data types, you can go to the
worksheet page, and same thing over here, you can go to the icons
and change the data type. As you can see,
it's really easy. In Tableau, we have a bunch of different data types that we're going to cover
in this tutorial, and I group them into
three categories. First, we have basic
main six data types. We have the number
hole, number decimal, string, date, data
and time and Polon. The second group, we have roles, we have geographic
roles and image roles. And the last group, we have advanced data types like group, cluster group, benz, and set. And this group contains
special data types that's introduced from Tableau
for data visualizations, and they are specially made in order to organize our data. In this tutorial, we're going to focus on the first two groups, the basic and the role. And for the advanced data types, I'm going to dedicate
another full tutorial just speaking about
them. All right. So now let's start
with the first group, the basic data types, where we're going to
do deep dives into each type in order to
understand them. So let's go. All right, so now we're
going to talk about the data type number. If our data contains only
number, nothing else, it contains digits 0-9, then we can call it
a number data type. And it's very important
to understand that numbers cannot
contain any characters. For example, let's
say that we have the following phone
number in our data. This type of data, we
cannot call it a number because it contains characters
like we have the minus, we have the plus, because the number data type can
only have digits 0-9. Now, if we remove those
characters from the phone number, then it's going to
look like this, and only now we can give
it the data type number. And I tableau, the data
type number has this icon, it's like hash, and for numbers, we have two data
types in tableau. We have number hole
and number decimal. So what is the
difference between them? You know in math, a
positive or negative number could be splitted by dots. The first part, we call
it a whole number, and the second part,
we call it decimal. If your number does not include decimal dots or any fractions, then we can call
it a whole number, like three -100,
zero, and so on. But if your number contain
dots and fractions, then we call it a
decimal number, like 2.4 or 30.99. And here you need to be careful
which one you are using, especially if you're making
calculations in tableau. For example, if
you want to divide two numbers like
one divide by two, if the output field has the
data type whole number, then the result can be zero. But if it has the data
type number decimal, then the result can
be correct, 0.5. This is exactly the
difference between those two data types. All right. Now let's check our
fields in Tableau to find out which one has
the data type number. I would say, let's check
the orders over here and you can see we have the order
ID customer ID product ID. By just checking them, you can find that all
of them are numbers. They don't have characters, and they don't have fractions. That means they should have
the data type number hole. As you can see, all of
them is number hole. Let's check another fields. On the right side,
we have here sales, we have discount, profit, and as you can see,
they have fractions. So those numbers should be a number decimal. So
let's check that. You can see Tableau
did automatically, figure out that those
numbers are number decimal. But for the quantity, it's whole because we don't
have here any fractions. So that says,
everything is fine. All right, now
we're going to talk about the data type string. The string data type is one of the most widely used data type in all programming languages. A string data type is a
sequence of characters, and it could include
anything like letters, numbers, pass and any
other type of characters. And you can think of
string as a plain text. And any field in our data
source could be a string. String is like a
default data type, and it has no rules or whatever like the
other data types. That means you can
convert any fields in your data source to a string data type
without any problem. Table as well uses the
string data type when it couldn't find any suitable other data type for your fields. Now let's check in
our datasets where we can find fields with
the data type string. Let's check first the
products over here. You can see we have
here two strings, the product name
and the category. In the product name,
we have characters, we have spaces, we have numbers. Those are the data type string. Let's check the
customers over here. We have the first
name, last name, both of them are string. But now you might notice
or ask, You know what? We have city and country. Both of them contains
like characters. Why don't we have the icon
of ABC? Is it like string? Well, the answer is yes, because if you just
click on the icon, you can see that tabled
assign it to a string. But here, the difference is
that they have an extra role. We have the geographical role, and you can see tabled
assign it to a country. And here Tableau going to
give it another icon just to indicate that this field
has a geographic role. But the basic the main data
type for that is a string. And the same is for the city. Okay, now we're going
to talk about one of the most confusing data type. It is the date. If your field stores information about
the calendar data, then this field is going to
have the data type date. And dates have very different formats in
different countries. For example, in Germany, we have the following
date format. You see, we use dots
instead of slashes. But date in the
international formats follow another rule where the date
get to split it by minus. And in the world, there are
many, many different formats. Those dates follow
specific formats, and we describe it with
the following code. For example, for the
international formats, we have this code. It's going to start
with the year and the year had four digits. That's why we have four times y. Then we have a minus and
two digits for the months. So we have M minus two
digits for the day DD. So there is like a code for
each part of the dates. We have the day, months, year, weeks, and so on. In this table, I'm going to leave the link on
the description. You can find all those codes and the descriptions of that. With that, you can customize the date format as it suits you. And don't
worry about it. To understand almost all
date formats that we have. In our data, we could have
not only the calendar data, but also informations
about the time. Then we have into another
data type for that. We call it date and time, and in programming
languages or databases, you might hear it already
about the time stamp. But in table we call
it date and time. So it might look like this. We have the date, then
space, and then afterwards, we have informations
about the hour, the minute anacon
And like the dates, it could have as well
different formats. You could have the
milliseconds or the time zone and
many other stuff. So here we have again a table of all the codes for the
time informations. You can find it as well on
the same link. All right. So now let's check
our data to find out which fields has
the data type date. Usually in star
schema data model, all the dates are placed
at the fact table. And our fact table
is the orders. So let's check that. You can see we have two fields with the data type icon dates. We have the shipping
date and the order date, and it's not date and
time because we don't have in the data
information about the time. Both fields are dates. We can check here
and as well here. In the other tables,
products and customers, they don't have any dates or times because they
are dimensions, they are not events, and usually don't have any
information about the date. All right. So now
let's go back to our orders to our two fields. And as you can see
the format here is that they are splitted
with slashes. Let's say that you don't want this format, you
want something else. Now how we can change the
date format in Tableau. In order to do that, we have
to go to the worksheet page. So let's go to the
worksheet page over here, and now you have to
decide something. Do I want to change
the date format for the whole workbook for
the all visualizations. So that means you are changing the default format of the date, or you want to change the
format only for this view, only for one visualization. Let me show you how
you can do both. Now, let's put
something at our view. I'm going to take the order ID, drag and drop it over here, and let's work with
the order date. I'm going to drag and
drop this on the text. Tableau going to
show it as a year. I want the exact date in
order to see the format. As you can see, our date
has the following format. Now I want to change
the default date format for the whole workbook. In order to do that,
we're going to go to the left side to the
order date, right click. Then we go to the
default properties and here you can find
the date format. If you click on that, automatic, it is what Tableau did
figure out at the start. Then we have some pre
defined format from Tableau. What is interesting is at
the end, we have custom. Our new format for the
date can split with the dots and the year going
to have only two digits. The code format is
going to be like this, D D for day, then dots, for month. And for the year, we're going
to have only two digits, that's going to be y y twice. Let's hit. And as you can see, Tala did change the
date format in Tableau. Now let's go and Dublicate
this worksheet over here, pydicing on it and then Dublicate As you can see in
the next worksheet as well, we have exactly the same
format that we defined. This means that
the format that we defined is a default now
for the whole workbook. But now, let's say
that I want to change it only locally at
one visualization, and I don't want to change the default format for the date. Let's dublicate that as well. Once again, Okay. Now instead of going
to the left side, we're going to stay at the view, and we're going to
go to our fields, right click on it, and then we go to this one here format. Once you do this,
on the left side, the data being going to
switch to the format span, and over here on the left
side, you can see dates. If you click on
that, we're going to get exactly the
same stuff over here. Those are the pre
defined from tableau. We have the automatic
at the top, and at the bottom,
we have the custom. Now let's choose one
of those predefined. I'm going to take the
week and the year. Let's click on that.
As you can see Tau did change the date
format in this view, and now interesting to
check the other sheets, whether the date
format did change. Let's go back to the
previous sheets, and as you can see, they stayed at the default
format of the date. With this, you learned how
to customize the format of the date for specific view
or for the whole workbook. But now I want to change
the date format as before. In order to do that, I'm
going to go over here, close this format, then go
to the order date again, right click, default properties, date format, and then we just click on the
automatic and hit OK. So as you can see, we have again the same old date formats. That's it. This is how we can work with the data type dates. Alright, now we're
going to talk about the last data type in
the basic category, the Polian data type. The Polian data type
represent a fields that has only two values,
true or false. It's like the
language of commuter. We have only one and zero. And this data type is often used in the output of a
condition or logic. So for example, if I ask you, do you like this video so far? The answer is going
to be yes or no. If you like this video,
please give it a lie. So the answer for
this question can has the data type polon
either yes or no, true or false, and
know any other values, and don't forget to subscribe. The Bolan data types
has many use cases. For example, control the
workflow of something, If the output is true, then do something, I false,
then do something else. All right. So now
let's check whether we can find Ai Polan data type. In our orders, we
can check over here. We don't have any
Polan data type. And the customers
as well. Nothing. And in the products. Well, we don't have any field
with the Boolean data type. Well, usually data type
bullion going to be add once we use
conditions in Tableau. And once we create new
calculated fields. Now to create the
calculated field, we're going to go to
the worksheet page, so we're going to go
sheet number one and now make sure to select
the small data source. Then we go to this
small icon over here, and now we select Create
calculated field. Let's click on that. We will get a new window to write our expression
or our condition. I'm going to give you
the name of logic. 400. And now, what we're
going to check or what is our condition? If the sales is
smaller than 400, then should be true,
otherwise going to be false. The logic is very simple, so here we're going
to find the sales, smaller than 400. That's it. If the sales is
smaller than 400, it's going to be true, otherwise,
it's going to be false. Let's click OK. And
once you do that, you can find on the left side, we have a new field called Logic 400 and it has
the data type volume. The output has only two
values true and false. Let's validate that. I'm just going to drag and drop
this on the view. Over here. And as you can see, we have only false and true, and let's see whether
the logic is working, so we're going to
take the order ID and just put it before it. And now we need the sales, so we're going to
take the sales drag and drop it here on the ABC. And here you can
see, for example, the first order, it
is smaller than 400. That means the logic is
true, which is correct. Then the next one,
it is above 400, it's false, and so on. So we can see if the field has only two values true and false, then the data type
can be bullion, and we usually use it as
an output of a condition, and the bullion data type has a lot of use cases, for example, if you want to filter our data, anything above 400, we don't want to see it
in our visualizations. So what we can do, we can
use the logic in the filter. Just track and drop
that on the filters, and we're going to
select only the true, so I'm going to unmark the false and then hit ok.
And as you can see the result can show
only the orders with the sales less than 400. And with that we just filter
our data very easily. All right, so with
that, we have covered the basic six data
types in Tableau. So now let's do a quick recap. We have the number
hole is for fields that stores only numbers
without characters, and those numbers are without
fractions or decimal dots. Next, the number
decimal is as well for fields that have only
numbers without characters, but those numbers could have
fractions or decimal dots. String is a sequence
of any characters. It could be numbers, letters, special characters or spaces.
And then we have date. Date is for fields that stores informations about
the calendar dates. Next, we have the date and time is as well for fields that stores informations
about the calendar and as well about the time, and it has as well
specific formats. And the last time,
we have the bullion, it can store only two
values false or true, and we usually use
it for conditions. Alright, so so far
we have learned the basic data types in tableau. And next, we will learn
the two data type roles, geographic and image roles.
53. Geographic and Image Roles: Okay, guys. So the first
role that we're going to talk about is the
geographic role. If you have in your data
field that contains location informations
or geographical areas. Then you can assign it
to a geographical role in Tableau based on the
type of the location, such as city, country, postal code, and so on. Assigning this extra role
can help Tableau to plot your data correctly if you
are using map visualizations. In Tableau, there are
over 12 geographic roles, but I think the
most important ones are country City and zip code. Now, let's check our data, but first, some coffee. Let's go. All right.
Back to our data source. Let's go to the
customer's table. There we have some information about the location
of the customers. And here we have three fields. We have country, city,
and postal code. Now in order to check
the geographic role, just click on the icon over
here on the data type. And again, here, it's very
important to understand. Each field must have
a basic data type. For example, the postal
code is a number hole, and then we assign an
extra role for it. Having the geographic role will not remove the
number data type. Now let's check the
geographic role over here, and you can see
that Tableau didn't assign it to anything,
so it stays here, no. And this is a zip code or postcode. So we're
going to correct that. We're going to just
click on this over here to assign a
geographic role, and you can see the
icon did change. With that, we have
the data type number, and we assigned a
geographic role for it. Let's check the others.
So this should be a city. So let's click over here. The basic data type is a string because we
have characters, and let's check the
geographic role. Tableau did it correctly.
We have it as a city. That is correct. Let's go
to the country over here. We have it as a string, and then the geographic
role is country. With that, we have all
location informations assigned correctly to
the geographic role, and we can start building a map visualizations in Tableau. Let me show you an example. Let's go to the sheet
number one over here. And what we can do, we
can go to the customers over here and let's take
the location information. Let's take the
country, the city. Let's have one metric. I'm going to take the sales drag and drop it over
here on the ABC. As you can see,
it's only a table, we want to switch it to a map. In order to do that, go
to the show me over here, and then click on the map. So you can see Tableau did
correctly plot our data. Let me just close it and assigned for each
country the metrix. And this is done because we assigned our data to
a geographic role. Alright, now let's talk
about the other one. We have the image role. This is brand new. Tableau
just introduced that in 2022. So I Princip, if
your field stores a URLs pointing to images, then you can assign this
field to image role with the URL to show the images
in the visualizations, and Tableau have here
some requirements. So the first one table supports only those three
image extensions, and the URL should begin
with the HB or HBS, and the third requirement, the maximum number of images
in each field is 500. And then we have the image size. It should be less
than 128 kilobytes. But though things might
change in the time since, it's completely new
feature in table. And I think the most
used case for this is to show the product images
in your visualizations. Alright, now let's
see an example in ta about the image role. In our datasets, I have prepared some URLs inside
the table products, but only in the small
datasets. So let's check that. If you go to the
products over here, we have a field called
product images. And here we have URLs pointing
to images in my website. So now let's check
the data type. Over here, it is a
data type string. This is the basic one because a URL is a sequence
of characters. And now we can add on top of this basic data
type an image role. And it's really easy. We just go over here to the image role, and we click on the URL. Let's do that and with that, we have a new icon indicates that this field has
the role of image. Let's check the
data. We're going to go to the sheet number one. Then we go to the products, make sure we are selecting
the small data source. Then we go to the
products image, just drag and drop over here. As you can see now, we have some images about the products, but two of them are broken, and I think it's still bugging
at the disco version of Tableau Public
because if we publish now to Ta Public in the web, we're going to have all
the icons correctly. Now we can go and
grab another field. Let's take the sales. Drag and drop it over here. And with that, we have
nice images to the matrix. Let's go and publish
that in Table Pablic. I'm going to call
it view with image. Let's save. And as you can see now in Table
public, we have all icons. Nothing is broken. So
I think if you are building dashboards
about the products, it's really nice
to show the image of the product
instead of the names. It's just more catchy to have images inside the
visualizations. All right, so that's
all for the data types. Next, we will learn very
important concepts, the dimension and measure
roles in Tableau.
54. Dimensions and Measures: Dimensions and
measures in tableau. Once we connect our
data to Tableau, tableau and analyze
our data in order to assign each of our fields to either a dimension
or measure. This kind of meta
data going to help Tableau to blot our
visualizations. All right. Now the question is, what is dimensions and measures? Well, Tableau didn't invent the concept of
dimensions and measures. It is an old concept of PI now we're going to have
a quick origin story. If you learn the concepts of datawrehusing and
business intelligence, you might already know that the core concept is
the multidimensional. Online analytical processing.
The concept says, if you want to answer
the business questions or do data analysis, first we have to build
the data model that has the shape of a cube
with multi dimensions. It's something like this cube and each cube has
two informations. First, we have the
dimensions of the cube, and the second information,
we have those cells. Those cells can store
informations like data numbers, and we call it measures. So each cube has
two informations, the dimensions, and the
sales, the measures. And now let's have an example. We have the cube of sales, and it has three dimensions. The first dimension
is the locations, and inside the locations, we have three members. USA, France and Germany. Though three values are the member of the
dimension location. And we have another
dimension called time, and it has three members
in the dimension, January, February and March. And the third dimension,
we have the categories. And now inside the
sales of the cube, we have the mejor sales. So now our cube is ready with
the dimensions and measure, and we can start answering
the business questions. For example, find the
total sales in USA. What can happen, we can select
the dimensional location and filter the dimension to
have only the member USA. This operation in the cube, we call it slicing the cube. Then we can aggregate
the measure, and we will get the
total sales of 120. If you have cube, we can do multiple
operations like slicing, dicing, roll up,
drill down and befot. If you have such
a cube, we can do data analyses and find fast answers to the
business questions. Now to summarize, Dimensions
contain qualitative values. They usually describe
something like the product name, the
product category, customer location, and we use
dimensions to categorize, filter, and show the
level of details. And in the other hand, we have the measures they
contain numeric quantitative values that can be measured like the name says. And the measures,
unlike the dimensions, they can be
aggregated. All right. This might be still confusing, and if you say, you know what, if I look to my data, how do I decide whether it's
a dimension or a measure. Here's my decision
making process. First, I check the data
type of the field, whether it is a number. If the answer is no, then
this field is a dimension. But if the answer is yes, then we can ask
the next question. Does it make sense to aggregate
the values of the field? Like doing the sum
calculation on the values or finding
the average value? If the answer is yes,
then it is a measure. But if the answer is no, then it is a dimension. What this means all nonumeric
fields are dimensions, but not all numeric
fields are measures. This really depends
on the questions, whether it makes sense
to aggregate the values. If yes, then it is a measure, if no, then it's dimension. Now let's practice in
order to understand the concept of dimensions and
measures and how they work. We will check our
datasets and we can assign each field to either
dimension or measure. We're going to do the
table customers together, and then you can go and
bowse the video in order to do the products and
the And then at the end, we're going to check the
result together. So, let's go. We're going to start
with the first field, the customer ID. The customer ID is a number. So we cannot say it is
automatically a dimension. We're going to jump
to the next question. Now, does it make
sense to aggregate it? Well, we have here
to understand that the customer ID is a unique
identifier for the customers. For example, Maria has the customer ID number
one, Martin has four. And now, if we sum
all those values, we're going to get
the value of 15. Or if we do the average, we're going to get
the value of three. Those values don't make
any sense because we use the customer ID only to
identify the customers. And I don't think that we'll
be in a situation where we have to find the average
of the unique identifiers. So, since it makes no sense, this field is a dimension. And with that, we can assign the customer ID to a dimension. Now, let's go to the next one. It is much easier because we
have here the first name, and it is not nonmeric, so it is automatically
dimension. The same goes for the last name. It is as well, string. It is not a number. All right. So now let's move
to the next one, we have the post code
or the zip code. It is a number, so we
can ask the question. Does it make sense to
do aggregation here? Well, I don't think
there will be a situation where we have to find the sum of the post code or
to find the average of it. So that means it is here again, it's a number, but
it is a dimension. So let's assign the
value for that. And then the next
one, it is easy, so we have the city
and the country. Both of those values are string. So it is automatically
a dimension. So let's assign it again. Okay, so let's move to the
last field. We have the score. Here, it's again a number, so we can ask the question. Does it make sense here
to do aggregations? Well, the answer is yes. It's really makes sense to
find the average of the score. That's why we're going
to map it to a measure. So on the table customers, we have six dimensions
and only one measure. And now you can go and
pass the video in order to practice with the table orders and as well with the products. Alright, so now let's
check the results. As you can see in
the table orders, we have a lot of measures
because it is a fact table, and fact tables in the star schema is the central
place for the measures. So this is very normal. So
let's check the fields. We have the order ID
customer ID product ID. It is like the customer ID. Those are identifiers, and
it doesn't make sense. To aggregate it. So that's
why we have it as dimensions. The order date and
shipping date, those informations
are not numeric, and that's means
it is dimension. And then we have all those
informations, the sales, quantity, discount,
profit, unit prices, all those fields are numbers, and here it makes sense to do aggregations like the
sum or the average. So we're going to
use the orders, the fact table if we need any Let's go to the next
one to the products. Here, this one is
easy. The product ID is like, again, the identifier. It doesn't make sense
to do an aggregations. We can have it as dimensions. Product name and category, both of those
informations are string, they are non numeric, and
that's why they are dimensions. I hope with this you
have understood how I usually do it by just
looking at the data, we could decide whether it's
a dimension or measure. All right. So now
back to Tableau, and the first question is, where do I find in Tableau, whether my fields are
measures or dimensions. Well, there's no icons for
dimensions and measures, and as we cannot check that
at the data source page. In order to check the
dimensions and measures, we have to go to
the worksheet page. So let's go to sheet number one. And then we're going
to go to the data ban on the left side over here. Let's open any table, for example, the orders. Now, if you look closely
to the table orders, you will find like fine
gray horizontal line, which splits the fields of
the orders into two groups. The fields above the line, they are the dimensions, and the fields below the
line, they are the measures. So, for example, we
have the customer ID, the order dates, order ID,
product ID, and so on. Those fields are
dimensions in Tableau, and the fields below the
line that discounts, the quantity, sales and so on, those fields are measures. And you can find this splitter, this horizontal
line in each table. So if you go to the
customers over here, you will see again
the same line, that splits dimensions
from measures, And the same if you
go to the products, scroll down, we have
again the same line. And one more thing that
you might already noticed, let me just close those tables
that outside the table, there is as well
horizontal line, sometimes in Tableau
curate fields that doesn't belong
to any tables, and Tableau and I put it
just outside of the tables. It's like global fields. And for that, we need
as well splitter to split the fields to
dimensions and measures. Okay. So now let's go
back to the orders, and now you might
say, You know what? We don't need this
horizontal line to identify whether the field
is dimension or measure. And now, if the field
has the color of blue, then it's dimension,
and if the field has the color of green,
then it is measure. Well, this is exactly
where most of Tableau developers get
confused and things gets mixed up between dimensions measures and
discrete continuous. Honest, I was thinking
the same at the start. Until I found out that
the color of the field indicates whether the field
is discrete or continuous. We're going to talk
about this concept in the next tutorial.
Don't worry about that. The color does not indicate whether the field is
dimension or measure, but the position of the field, whether it's above the
line or below the line. Let me show you
quickly something. Let's take any fields over
here, the product ID. Let's just drag it a little bit. Now Table going to mark the
horizontal line with orange and going to show you okay
anything above is dimension, and anything below is measures. Table showed that as well. All right, so now to
the next question, how do I change a field from dimension to measure
and vice versa. And here you have two options. Either you're going
to do it globally for the whole workbook for
all the views or you might do the change locally in one individual view. Let's
see how we can do that. Let's start with the first
one where we're going to do the change for the whole
workbook for all views. Globally, we're going
to go, for example, let's take the order
ID over here, right, click on it, and then
we go over here, convert to measure.
Let's click on that. As you can see, the
field order ID just jumped from above the line to below the line as a measure. Now, if you want to change
it back to dimension, right, click on it, and
then convert two dimension. So that's it. It's really easy. Now let's see how we can
do the change locally at one view without affecting
the whole workbook. Let's take again the order ID, drag and rob it over here, and here we're going to
radically con it on the view, and then we're going
to go to the measures. We're going to convert
it to a measure. Currently, it is a dimension. So let's go to the measures, and we have to select one
of those calculations. Let's take for example, the sum. Now, as you can
see, the order ID only for this view is a measure. But the order ID on the left
side for the whole workbook, it stays as dimension. And that's it. This is
really easy how we can convert between measures
and dimensions. All right, so let's have an examples in Tableau in order to understand the main purpose
of measures and dimensions. Let's go to the orders on the left side over here
and the small data source, and let's take one
measure the sales. We just going to drag and drop
it on the text over here. And as you can see,
Tableau can start immediately doing
aggregations on the measures. Now if we check the data, we have only one number. This is the total sales that
we have in our dataset. And now we are at
the top level of details where everything is aggregated in only one number. And now we have to
add more information in order to understand
this number. And in order to do that, we're
going to use dimensions. So for example, let's go
to the products over here, and let's take the category. So I'm just going to drag and drop that category over here. And as you can see,
now the dimension is splitting our measure
into two rows. So that means we
have now one level lower of details than
the top aggregation. Now let's take
another dimension. We're going to take
the product name. So let's just drag and drop it over here
near the category. And as you can see, using this dimension can give
us different level of details about the seals than the first dimension
of the category. So what happened,
we just moved with the details one more
level beneath that. And now let's take
third dimension. We're going to take now the
order ID from the order, dress drag and drop it
near the product name. And now, as you can
see this dimension can bring us to the lowest
level of details, where the aggregation
of the measure is exactly the
same origin value. And as you can see the
dimensions defined, level of details in our views, and each dimension can take us to different
levels of details. And always, if you want to go to the top level of details, you have to remove
all dimensions and only have the measure. So as you can see, as we are
removing those dimensions, we are going to the
top level of details. Another nice way
to show that is if we go to the tree
map visualization. So let me just go back over
here to have one dimension. Let's go to show me and
then click on the tree. So now you can see our data is split it to only two details. So now, as we add dimensions, let's take again the
product name over here, drag and drop it on the label. You can see the view
split it to more details. And if we go to
the lowest level, if you take the order ID
again over here to the label, we can see the view is
split it furthermore. And now I'm going to
tell you small secret. If you follow it, you can
generate hundreds of reports, even if you have small datasets. If you combine any measure
with any dimension, you will be creating
a new view or new reports with the title
following this pattern. Measure by dimension. For example, sales by product, profit by category,
quantity, by country. So if you follow this pattern, you can generate endless amounts of reports and views in Tau. All right, now, if you
come with the dimensions and measures in our
small datasets, we have around 16 dimensions
and ten measures. That means if you
follow this rule, you can generate around
160 views and reports. So even we have small datasets, we can generate huge amounts
of views and reports. So as you can see on
the visualizations, if we compine both of them, we're going to have
sales by order date, sales by shipping date, sales by country, and
so on. All right. So now, let me just show
you how we build usually reports in Tableau using
dimensions and measures. We're going to work now with
only one measure the sales, and we're going to make
dashboards about it. Let's take at the
small data source, and we're going to take
the sales from the orders. Let's just drag and drop
it somewhere at the rows. And now the dimension going
to be the product name. Let's take the product
name from the products. Let's drag and drop it
over here. So that's it. Now we have to call
it sales by product. Let's just rename
the sheet over here, right clkont and rename
sales by product. Alright now we're going
to create another one using the same measure
but different dimension. So what we're going to do, we're just going to go
and duplicate it. Right to click on
it and Duplicate. We're going to have now
the sales by category. I'm just going to
rename it again. And let's call it
sales by category. And now we're going to remove
the product name from here, so just drag and drop it
somewhere at the white space. And then we go again
to the products, drag and drop the
category on the columns. And now we're going to use
different vasalzations. So I'm going to go to
the Showm over here and let's use the pie charts.
So click on that. Alright, so now we
have a pie chart, but I would like to
show the values. So we go to the label over here, click on it and click
on this Mark show Mark labels in order
to show some values. That says, this is our
second one. All right. Now we're going to
create the third one with another dimension. We're going to take
the order dates, but we're going to
show only the months. So we're going to go over
here and duplicate it again. They just rename it. I'm going
to call it sales by month. So we will go now and remove
the category, drop it here. And then let's take
the order date, drag and drop it on the columns. We're going to switch the
visualizations to par, so I'm going to click on
this over here on the pars. So as you can see here, To go to show the years
of the order date. We want to have it as a month. So we have to
switch dots, right, click on the dimension, and then over here, just
select the month. So let's do that. Let me just close the
show me over here, and then let's add some lapols. All right, so that's
what it for this view. Let's make the last
one. We're going to make sales by country. So let's doublicate this again, and we're going to call
it sales by country. And then we're going to remove
the dimension order dates, and then we're going to
take the dimension country. So just drag and
drop it on the rows. So now, since we
have the country, we can change it to a map. So let's do that. We
go to the show me over here and then select the map,
lick on that. All right. So now we have a map showing the sales by country. All right. So now we have those
four reports or sheets. We can build now a dashboard. In order to create
a new dashboard, we're going to go to
this icon over here. Click on it. And
before we start, I'm just going to
give it a name. Let's call it sales dashboard. All right. Now we're going to go and drag and drop
all the sheets. We're going to start
first with the country. Let's just drop it
here in the middle. And then we're going to take the category just beneath it. Then the products beside it. Let's three size a
little bit to the left, and then we're going
to take the last one, the Manses and put it over here. And as you can see, with just four dimensions
and one measure, we were able to make
dashboards about the sales. And just following this small
rule, sales by country, sales by category, sales by
product and sales by month. So always measure by dimension. And now it's really
easy to train. Just go and pick
another measure with different dimensions and
build different dashboards. Alright, so now let's
have a quick summary where we're going to
compare both dimensions and measures side by side in order to understand the
differences between them. Let's start with the definition. Dimensions are fields that
contains descriptive values, and measures are fields that contains quantitive
numeric values. For example, we have dimensions
like product category, country, and customer ID. And in the other hand,
we have measures like sales, profit,
and quantity. The next point is
about aggregating. Dimensions cannot be aggregated as each member of the
dimension is unique. Measures, however, can be
aggregated using functions like some average
mean max, and so on. For example, you can calculate the total sales for
specific product category. Moving on to the data types. A different data
types can be used as dimensions like
string, date, bullion, and even numbers, like we
have learned the customer ID, but only the fields with the data type number can
be used as a measure. The next point is about
the role of analyses. Dimensions are typically used
for grouping, filtering, and organizing your data, and measures in the
other hands are used for calculations and
numeric analysis. And the final point is
about the granularity, Dimensions define the level
of details of the data, and the granularity of
measures on the other hand determines the quantity
being measured. So these are the
main differences between dimensions and measures. Alright, so that's all about
the dimensions and measures. Next, we will learn
another important concept for data visualizations, the discrete and continuous
roles in Tableau.
55. Discrete and Continuous: All right. Now
we're going to talk about discrete and continuous. Here again, once we connect
our data to Tableau, Tableau can analyze our data
in order to make assumptions where it's going
to map each field to either discrete
or continuous. Discrete and continuous are
metadata informations that's going to impact on what type of visualizations
that you can create, as well as how they
will look like. Now in order to understand
the concept behind them, we're going to compare both
discrete and continuous. First, we're going to
start with the definition. This concept comes from math
and they say discrete values are always separated
disconnected distinct values. Continuous values are
exactly the opposite. It's like connected value, a series or unbroken chain of data without
any interruptions. Let's have an example. Think of discrete as
you are counting 0-10. You start with zero, one, two, three, and so on. That means 0-10, we have
exactly 11 distinct values. But with the continuous values, we have like real numbers, which means 0-10, we have infinite number
of real numbers. So for example, we have 1.2, 1.3, 1.4, and so on. So with discretes, we
have distinct values, and with continuous,
we have a range of infinite values
between start and end. Once I read about
the discrete and continuous and the following
analogy stick in my head. Think about the discrete
values as a lego pieces. So you can take them apart
and you can work with each piece, differently
and independently. So you can move them around and analyze them in
different orders. And now think of continuous
as a roll of yarn. And now when you
unroll the yarn, you will not get
different pieces, you will just see
more of the yarn. So you will just get a longer
piece of the same string. Alright, so discrete values are separated distinct values, and continuous values are unbroken chain of data
without any interruptions. All right. So now let's
move to the next point. We have the colors. In tableau, the discrete fields
are the blue pils and the continuous fields
are the green pills. So let's see in tableau
what this means. All right. Now, as usual, the
first question is, how do I know whether my fields are discrete
or continuous? Well, it's like the
dimensions I measures. We cannot check that at
the data source page. We have to switch to
the worksheet page. Let's do dots, we're going to go over here. Now it's really easy. Now as you hover your
mouth on those fields, you will see we have
only two colors, the blue and the green. You can see those colors as
well on the data type icons. So we have icons
green and icons blue. The fields with the blue
color, like, for example, the customer ID, first name, order date, and so on, those fields are
discrete fields, and the fields with the
green color like discount, sales, unit price, score, and so on, those fields
are the continuous fields. And here exactly comes
the confusion where a lot of double
developers think that the blue indicates
for dimensions and the green indicates for
measures. Well, that's wrong. Those colors to
indicate whether it's discrete and continuous.
So now you know that. So let's start with
the first one, where we're going to
change the role of field globally for the
whole work workok. In order to do that,
we're going to go to the data ban on the left side, and as you can see
here, for example, the sales in the
orders, is green pell. That means it's
continuous field. And as well, it is a measure. Let's say that we want now to switch it to a discrete field. In order to do that,
right to click on the Here we have
convert to discrete. It's really easy, so
let's click on that. Now if you check
again the sales, we have it now as a blue pill. That means now it is
a discrete field. If you check the others, all of them are continuous measures, but only the sales is
a discrete measure. And this change
is done globally. So if you go to another sheet, The sales going to steal
as a discrete field. So now, if you want to switch between discrete to continuous, or what you're going to
do is radically cont. And here we have,
again, the same option. We're going to convert
it to continuous. So once we click that, it's going to go back
to the cream pill. So that's it. It's really easy. Now we're going to learn how
to switch between discrete and continuous locally
for only one view. All right, so let's
build the view. We're going to drag and drop
the sales on the columns. Let's take a dimension,
for example, the category, drag and
drop it on the rows. And now we want to
switch the sales from continuous to discrete
only for this view. So what we're going
to do, we're going to go to the sales over here. Right click on it,
and as you can see the current role is continuous
as to market for us here. Or you can see it
from the green pill. All what you have to do
is to select discrete. So let's go and do that. And now the field sales is
discrete for this view, as you can see it's blue pill. But if you go to the data
bin on the left side, the sales stays as continuous
with the color of green. So that's how you can do it
locally for only one view. So for example,
if you go back to another worksheet
and take the sales, the sales going to be
a continuous measure. That's it. This is how
you can switch between discrete and continuous fields
locally for only one view. All right. Now let's move to the next point. We have filters. In tau, the discrete
field going to currate a filter with
distinct values. But the continuous
field going to currate a filter with range
values. All right. Now let's have an
example in order to understand what I
mean with those filters, and now we're going to work
with the Big data source because we need more data in order to understand
this. All right. Now let's switch to the big
data source, click on it, and then let's take the sales
drag and drop it over here, and then we're
going to take from the products, the subcategory. Drag and drop it on the rows. Now we have the sales
by the subcategory. Now if we want to go and
filter those values, we can go and put the sub
category in the filters, and don't forget that the subcategory is
a discrete field. Let's just drag and drop it on the filters and see
what can happen. Now in the new window as
you can see over here, Tableau listed all
distinct values inside the subcategory. Now here with those
discrete values, we can make decisions
individually. We can include some stuff and remove others.
Let's just do that. I'm just doing this
randomly and click. That says, This is how
the filter in Tableau can react if we have a
discrete field inside it. We have a list of
all distinct values. And we can show this
filter on the right side, if you just right click on the subcategory here and
then select show filter. Now we have it on
the right side, and we can now include
or exclude values. Now let's see what
can happen if we put on the filters a
continuous field. Let's take the sales again
since it's continuous field. But instead of taking it from the left side here
from the data bin, you can take it
from the selves by holding out and then drag
and drop on the filters. Since it's continuous field
and a measure, TG ask first, do we want to do the filter on all values or after we
do the calculations. So let's go with
the sum over here, since we have it as a sum. So I'm just going to click
on the sum and go next. And this is exactly
what's going to happen. If you have continuous field as a filter, you will get a range. It has a start and end. So you don't have distinct
values of all the sales. You will get a range of values, and you have to define
the start and the end. And here we have different
options about the range. But we're going to stay
with the first one. Let's hit our care. Now I want to show the filter
on the right side. Let's go over here, right
click on show filter. Now on the right
side, you can see exactly the difference between discrete and continuous
fields in filters. Let me just extend it over here. You see the sales is continuous
and we have a range, so we can filter like this by changing the start and
the end of the range. But with the discrete filter, we have all members
of the field and we can decide on each
value individually. We can just select and
deselect those values. All right. So now let's
move to the next point, we're going to talk about
the changes in the view. Discrete fields create the
headers of the visualizations, where the continuous fields creates the axis
of visualizations. Okay, now let's see what
this means in our view. As you can see, the subcategory
is a discrete field, and the sales is
continuous field. And in this view over here,
we have three things. We have the marks, those
parts, and on the left side, we have the subcategory, and we call those
informations as headers. And the third information, we have the axis of the view. What is the difference
between headers and axis? The discrete fields like subcategory always create
the header of the view. In the header over here,
you have a list of all distinct values inside
our dataset exactly as it is. But the continuous field like the sales create the axis
of the visualization. It's like the values
inside the filter, it's a range that has
a starts and ends. Unlike the headers,
you cannot see in the axis all the possible
values individually. You have a range
with start and ends, and in between we have pens. Discrete fields
create the headers and continuous fields create the axis. All right. The next point, we're going
to talk about sorting data. In discrete fields, we have many options in order
to sort the data. But with the continuous fields in Tableau, it is very limited. Let's see an
example. We're going to stay with the same example, and we're going to start with the discrete field subcategory. In order to sort the data
in the discrete field, just right click on
the subcategory over here on the shelf or you
can go to the header. It's exactly the same, right
click on the subcategory, and then we can select
over here the sort. Select that, and now we have extra window to set up the sort. As you can see here, we have
many different options like alpha patic field
manual, and so on. Let's go with the
manual over here. Here again, since subcategory
is discrete fields, we're going to get a list
of all distinct values, and then we can
change the order. For example, by just clicking
on the applications, we just can break it down and we can take the storage
and bring it up, plenders down and so on. We can do it manually
without any rule. As you can see, as I'm
changing the values, the order in the visualization
is as well changing. If you want to sort the data, we're going to use the discrete fields in order to do that, since we have many options. Now, let's check the
continuous fields. So I'm going to cloth this. Now if you go to the
continuous fields on the sales, right click on it, we don't have here
an option to sort the data like in the
discrete fields. But instead, we have
only one option if you hover on the sales, we have this very small icon, and we can use it in
order to sort the data ascending or descending.
Just click on that. As you can see now, the data is sorted by descending values, and if you click on that again, you will get the
data as ascending. Sorting the data using continuous
field is very limited. But instead of that, we can use the discrete fields
in order to sort the data since we
have many options. Okay, so now let's
move to the next one, and this is really important
to understand what is really the purpose of having continuous
and discrete tableau. The main use case of using
the discrete values is to do a deep dives analysis
in specific scenario. And in the other
hand, we're going to use the continuous values to see the big picture and do trend analysis. Let's
have an example. Now we're going to
create a new view using the big data source
since we have more data, and we're going to go
to the table orders. Let's take the order date. Just drag and drab
it on the columns, and then we're going
to take one measure. Let's say the quantity. Rack and rub it on the rose. Now as you can see the order
date is a discrete field, and we have five years of data. But now, what we're
going to do we can go to the order date, right click on it, and we
want to see more details. So go to the exact
date over here. Now as you can see
Tableau did convert it automatically from discrete
to continuous value, and we have it as a green pill, and that's because
we have a lot of order dates and Tableau tried to bring it
all in one picture. You can see now the order date created an axis with
a range of dates. Having continuous fields, you have all the data
in one big picture, and that's going to help you to find any trend in your data. Now let's go and convert the order date to
a discrete field. In order to do that, we're
going to go to the order date, right click on it and
click on discrete. As you can see now, we just
broke the chain and we broke the visualizations
into individual dates. Now because of that, we
have the header and we have all the distinct values
inside our data. We have all the
days all the months of the five years in one visual. With that having the
order day as a discrete, we cannot really do
any trend analysis over here because it's
really huge visualization. After we converted
the order date from continuous to discrete, we lost the big picture, and now it's really hard
to do any trend analysis. But now instead of
doing trend analysis, we can do now a deep
dive detailed analysis for each individual date. In order to analyze
a specific problem or scenario or to
answer the question, why do we have in the
first place a trend? So you can check the value
of each date individually. And we usually use the bar visualizations for the discrete and the line visualizations for the continuous.
Let's change that. I will go over
here on the marks, and instead of automatic,
I will move it to bar. So we have it now here as a bar, and I'm going to just duplicate this sheet and bring the
order date as a continuous. And then change the
visualizations to automatic. Now I just moved both of the
views into one dash part in order to see the differences between continuous and discrete. As you can see with
the continuous, if you want to make
trend analysis, seeing the big picture
or you're going to make a report for the management without showing a
lot of details, then go and use the
continuous field. Now if you look at
the visualizations with the discrete fields, you can use that if the task or the requirement
is to do deep dive analyses the data and evaluate
each data individually. The main purpose of
having discrete is to do detailed analyses
where the purpose of continuous values is
to do trend analysis. All right. So now
let's have a summary where we're going
to compare both of the discrete and
continuous side by side in order to understand
the differences between them. Let's start with
the definitions. Discrete values are
disconnected separated values, and continuous values are connected unbroken
chain of values. For example, in discrete, 0-10, we have infinite
number of values. We have exactly 11 values, and in continuous, 1-2, we have infinite
number of values. Next one is about the colors. Discrete fields are
the blue pills, and continuous fields
are the green pills. Moving on to filters, discrete fields
generate filters with a distinct list of all values
available in the dataset, and in the other hand,
the continuous fields generate a range filter that
has start and end values. Next point is about the views. Discrete fields can generate the header of the view
showing all possible values, and the continuous fields
generates the axis of the view. Again, it's like a
range of values. Then we have sorting. You can use discrete fields
to sort your data using different options But if you sort your data using
continuous fields, you're going to have
very limited options. We have only ascending
or descending. Finally, we're going to
talk about the purposes. The main purpose of the
discrete is to analyze a specific scenario
like you are doing a deep dive analysis
in a specific issue. But the main purpose
of the continuous is to understand the big picture from the data in order to do, for example, trend
analysis over your data. These are the main
differences between discrete and continuous
fields. All right. So that's all for the
discrete and continuous. Next, we'll wrap things up with the summary and get
better understanding of the big picture and the differences between
all of these concepts.
56. Data Types vs Dimension & Measure vs Discrete & Continuous: All right, guys. So now what
I'm going to show you is how those different metadata
concepts like data types, dimensions and measures, discrete and continuous
are related to each other. All right. So now we have
a field in our data, and in Tableau, we can assign
it to different data types. So it could be
string or pull with true and false or a date and we have as well date and
time or a number, whether it's or decimal. And now next Tableau can assign it to another metadata info, either dimension or measure. Any data type that
is not a number, it's going to be
dimension. So string, Polian and dates, all of them can be
automatically dimension. You cannot convert
it to a measure. And if the data type is number, we could have it as a measure or dimension if it makes
sense to do aggregation. Next table can
assign this field to the third meta data concept
discrete or continuous. If we have a dimension field
with the data type string, it could be only discrete. We cannot convert
it to a continuous. Like in our dataset, we have the category, the
first name, the country. All those fields are string,
dimension and discrete. You cannot change it
to anything else. The same goes for the
data type plian it could be only dimension
and only discrete. But now, if we have
a dimension field with the data type
date or date time, as you saw in our examples, it could be continuous or
discrete. We can have both. Now to the last one, if we have a field with the
data type number, it doesn't matter whether
it's dimension or measure. We can have this field as continuous and as
well as discrete. All right, y. So with this, you have a big picture for
all those confusing concepts in meta data in Tableau.
Alright, everyone. So we have now better
understanding about the data types and roles in Tableau and
these important concepts. And in the next section, we will learn about renaming
and aliases in Tableau.
57. #7 Section Introduction | Renaming & Aliases: How to name things in Tableau. As we are preparing
our data sources, what we usually do with that, we're going to go and rename
stuff like namic tables, columns, and even give
lias to our data. So first, I'm going
to introduce you to the different naming conventions that each developer should know. And after that, you're going to learn the different techniques on how to name fields
and tables in Tableau. At at the end, you're going to learn
the different methods on how to add aliases to
your data in Tableau. Let's start first by learning the different naming
conventions and what are the differences between
them. Now, let's go.
58. Naming Conventions: Okay. Sometimes in
real life projects, the source of your data might contain technical or
unfriendly names. When you are creating
visualizations for the users or
your colleagues, you have to make sure
that you are using friendly names that are easy
to understand and to read. That's why after you connect your data to table data sources, Tableau will start
cleaning up and renaming the fields and the tables
to more friendly format. The format is following specific naming
convention that is decided from the table team
which is really great. Let's understand first
what is naming convention. Naming conventions are set
of rules and guidelines that could be used in order to give names for things like tables, fields, functions and variables inconsistent and
understandable way. Let's say, for example, we have the two words, hello word. In order to create a
naming convention, we have to decide in two things. First, the word itself,
how we can write it. Here we have three ways. We can use the lower case, or we can decide to go with the upper case or we could
use the capital letters. The second thing to decide is the separator between words. Between hello and word, we have here white space. Here we have different options. You could use dots, underscore, white
space, or even nothing. Now, for example, let's
say we're going to go with the lower case and the
separator underscore. Then we're going to have
the following name, hello underscore word. With that, we have
a mic convention that we're going to follow
through all the projects, and it's really easy to follow. At the same time, it's
very important to decide on the namic convention
for your data model, especially at the
start of your project. And if you don't do that, I promise you the
look and feeling of your visualizations and
dashboard go to look really bad. And the whole project going to look unprofessional
and inconsistent. One more thing, project team decides on different
naming conventions, so there is no really
right and wrong here. All right, everyone. So now
I'm going to walk you through the most common
naming conventions used in programming languages. The first naming convention
is the snake case. Going to use the lower case in all the words and going to separate them using
the underscore. So the name at the end is
going to look like snake. All right. Our example is
going to be the customer name. And we're going to work
with this table to fill all the different
naming conventions, an example of the output, the rules for the litter
case and the separators, and in which applications
and programming languages, we can find this rule. Where we're going to start
with the snake case. The litter case is going
to be here lower case. And the separator going
to be the underscore. So if we follow those
rules with the example, we're going to have a lower case customer underscore name. And we can find those formats
in Python, PHP andro B. So the snake format is
really easy and popular, and you can find it
like almost everywhere. And now we're going
to talk about the next name in convention. We have the Camel case. And here we have another
naming convention. That looks like an animal. So in the camel case, only the first word
gonna be lower case. But then all the following
words going to be capitalized. And between the words,
there is nothing, no separators, no dots, underscores, dashes or anything. So at the end, we're gonna
have the shape of camel. Alright, so we have the
second naming convention, we have the Camel case. The rule for the letter case is going to be the following. The first words
going to be lower and the rest of the words
is going to be capitalized. For the second rule, we have the separation. There
is no separation. There is nothing
between the words. Here we're going to
write no separation. Now, if we apply those
two rules in our example, the customer name, we're going to have the
following output. The first one going to be
everything lower case. Customer There is no separation. That means we're going to start immediately with
the second word, but the second word is
going to be capitalized, so it's going to be
named like this. We can see the Camel case is widely used in
programming languages like Java, JavaScripts,
and Typescripts. That means we have the
third naming convention. We have the Pascal case. It's very similar
to the Camel case. The rule says all the words
going to be capitalized. So here we have capitalized
and the separations, there's no separation like the Camel case, so
there is nothing. If you follow those two
rules on the customer name, we're going to have
the following output. The first word going to
be customer capitalized, no separation, then
a capitalized name. And we can find this
naming convention, the Pascal case is used in programming languages
like Java and C sharp. I like this naming convention. I used it in many projects. All right. The next
name in convention going to be the ba case. And I think by now, the one who named those
naming conventions, should be an arbitude. As you can see, we
have all the words are lower caste and the skewer
and separated with dashes, so the name go to look like
a delicious hot cobb skure. So now the fourth one, we
have the keep up case, and the rule going to say, okay, the letter case can be lower
caste like the snake case, and the separation going
to be here, the dah. If we follow those two rules on the customer name
in our example, we're going to have
the follow the output. It's really easy, can to
be customer or lower, then a dash then name. And if you are web
developer or designer, I think you know about this
naming convention because it is widely used
in HTML and CSS. I think it's like
the snake case. It's really easy to follow. And now we have another
naming convention. This one is very important. And we call it a title case. It has nothing to do with
animals or foods, sadly. So we have here title case. The role going to say, the
words going to be capitalized, and we're going to separate
the words with a white space. So here we're going
to have space. Now if you follow those
two rules in our example, we're going to have
capitalized customer, then space, then
capitalized name like this. So why it's important
Because this one is the naming convention that Tableau team did
decide to go with. So you can see this naming
convention in Tableau. So Tableau currently
is enforcing this naming convention
in all your data. So once you connect
your data to Tau, Tableau can a leap and rename everything
following this rule. Well, if you look at it, it's really friendly
and easy to read. But sometimes in projects, we are forced or we are following some
requirements to follow a specific naming convention wh doesn't match with
the title case. Then the situation
is really bad, you have to go and
rename everything again. And of course, you don't have to follow one of those
naming conventions. You can make your own
rules and guidelines. So for example,
let's say this is my naming convention,
and the letter case, let's say it's capitalized, and I would like to separate the words with the underscore. So I'm just mixing stuff around. So if I apply those rules
to the customer names, we're going to have
something like this. So capitalized customer
underscore capitalized name. And with that, we have defined
our naming convention. All right. So now let's
check the naming conventions in our datasets and
as well in Tableau. Now, if you go
through the datasets that I've prepared
for this course, the small and the big
one, you can see that I'm always following the
same naming convention. The litter is going
to be capitalized and going to be separated
with an underscore. For example, on the orders, we have the products
underscore ID. Or if you go to the customers, you can see the first
underscore name and so on. So I'm always following the same naming
convention. All right. So now let's check
how Tableau did rename our fields and
tables from the dataset. You can check those
informations either from the worksheet or in
the data source page. But in the data source page, you can find more informations. So now we are at the
data source page. Let's go to the meta data grid. And here, it's
really interesting. We're going to find
two field names. We have here the field name
and the remote field name. So what are the
differences between them? Will the information in the remote field names comes
from the original datasets. As you saw, the original dataset is following the
naming convention of having underscore
between two words and we have all the
words capitalized. We have, for example, the order, underscore ID, customer
underscore ID, and so on. All information we find under the remote field
names comes from the original dataset from
the original source system. But now the field name on
the left side over here, those informations
comes from Tableau after renaming and
cleaning up our fields. So if you take a closer
look to those names, you can see they are following
the title case where we have capitalized words and
separated by a white space. So you can see over here we
have the product space ID, where the original name
was product underscore ID. So here Tableau did
rename our fields. So here, it's really
cool. We have in the Mtatagrid mapping
between the old values, the remote field names, and the new ones after
Tableau did rename them. We have always a data lineage between Tableau
and our datasets. As I said, there is no
right and wrong here, but it's very important
to define those rules at the start of the projects before you start building
any visualizations. And I remember one project where we started
immediately with building the dashboard and visualizations without deciding first on
the naming conventions. So we build around 30
dashboards in Tableau. And after a while, of course, we found out that the
developers are using different naming conventions,
which is really normal. If you don't define
the guidelines and the rules at the
start of the projects, then everyone going to
make their own style. So we end up having a
lot of dashboards with different rules and the users were not happy about it at all. Then we decided in
dynamic conventions, and of course we were
too late for that. Then we spend a lot of
time renaming the dataset, checking the report, and so on. If you don't decide at
the start of the project, especially if you
have a big projects on the amic convention, then you're going to have really painful and costly process of renaming everything
from scratch. Make sure add the start to
take enough time to talk to your users and the project team to decide on the
naming convention. And very important in
the review process of any new dashboards in
Tableau that to check that the naming
conventions are followed in each workbook to be
consistent in the whole project. All right, y, so that's was an overview of the different
naming conventions. Next, we will learn how to rename fields and
tables in Tableau.
59. Rename Columns & Tables: All right. Now, let's say that
you decided together with your users and the project team on specific naming convention, which is different from
the one that Tableau uses. Now the question is
how to rename Itablea. In tableau, we can do the
following changes on the table. So we can rename
the table itself, or we can rename the
fields inside the table. And the last one, we even can change the values
inside these fields. Also known as aliases, we're going to talk about
it in the next tutorial. In this tutorial, we're
going to focus on renaming the fields and
renaming the tables. First, let's learn how
to rename the fields in tableau. All right. So now we're going
to learn how to rename fields in Tableau. Let's have the following task. So the task says, rename our fields in Tableau, following the naming
convention Pascal case. So that means all the words are capitalized and no
separation between words. All right. So now the
first question is, on which page we can
rename our fields. We can rename our fields, either in the worksheet page
or in the data source page. We're going to get
the same effects. But I usually go to
the data source page. Since there we can find more metadata information
about the fields and tables. Now the second question is, Can we rename our
fields globally for the whole workbook
for all worksheets, as well, can we do it
locally for only one view. Well, you can do both, but renaming locally
for only one view, it's a little bit tricky. Now let's learn how to rename
our fields globally for the whole workbook for all
views in the worksheet page. Now let's go to the
worksheet page over here. Then we're going to go to the
data ban on the left side. We will rename the
shipping dates. Here we have three methods. The first one is the drop down. What we're going to do,
write a click on it, and then simply go to the rename. We're going
to click on that. And we're going to
rename it to the pascal. So I'm just going to remove the space between
them, then enter. And that's it. It's really easy. We just renamed the
shipping dates. And the second misid
is to use a shortcut. So, for example, let's go to the order date over
here and hit F two. And with that, we
can edit the name, so I'm just going to
remove as well the space between order and
dates. And hint enter. So as you might already noticed, the position of the order date just change in the data ban, and that's because the fields in the data bans are sorted
in alphabetical order. So that's what the
second method, using the F two,
using the shortcuts. And the third method to
rename the fields in the worksheet page is
to click and hold. So, for example, let's go to
the unit price over here. Lift to click and
hold. Then release. As you can see, we can
now edit the name. So this is third one. I'm just going to remove
the space between them. And hit Enter. So that's it. Those are the three method of renaming the fields
in the Worset, drop down a shortcut using
F two, and click and hold. One more thing about
renaming, unlike the Aliases, which we get to learn later, can rename any type of fields. Whether it's dimension, measure, continuous, discrete, any
type, we can rename it. There is no restriction
or whatever for renaming. So now let's go to the next one. We're going to rename the
fields in the data source page. Let's go to the data
source page over here. Here we have two places
where we can rename stuff either at the metadata
grids or at the data grid. Here we have only two
methods to rename stuff. The first one is going to be the drop down like
the worksheet page. Let's go to the
name, for example, the order date, right click
on it, and then rename. We're going to remove the
space. Them and that's it. And the second method
to rename fields in the data source page
is by double clicking. So for example, let's go over
here on the meta data grids to the customer ID and
just double click on it. And now we can go and as well, we're going to remove
the space. That's it. This is how we can rename
the data source page. We have only two methods that
drop down and double click. Here, we don't have
sadly any shortcut. All right. Now we have
the following scenario where we have renamed
the fields like several times and we forgot the original
names of the fields. In this case, we can reset everything back to
the original names. And we can do that either at the data source page or
at the worksheet page. Let's see how we can do it
on the data source page. If you just go to the field, for example, the customer ID, write a click on it,
then here we have the option reset name.
Let's click on that. As you can see, now, we are back to the original
name of the field. I found it really strange because I would like
as well to have the option of resetting to
the table mic convention. Now, let's see how we can do
that on the worksheet page. I'm going to switch back and
then go to the data bin. Let's pick the order dates. Now we're going to go and
edit the field again, right click on it,
and then rename. Then you can see over here a very small icon to reset
to the original name. By clicking on it, we reset the field to the
original field name. So now let's say that you
have a lot of fields, and you want to
reset all of them. Now, instead of resetting
them one by one, we can do mult selection
and then do resets. And we can do that at
the data source page. So let's switch there. And here, it doesn't matter whether you're
going to work with the metadata grid or
add the data grid. Now what we're going to do, we're going to go
to the order ID, click on it, and then hold
control, select the next one. And then we're going to select
the unit price as well, then right click
and reset names. Once you do that,
you're going to reset all of them,
which is really nice. So we have the unit
price reset it, the shipping dates, and
as well, the order dates. All right. So now we have the following
scenario where you are in the project and
you build already view. But afterward, you
decided to do renaming. So what can happen to our
view if we do renaming? So for example,
here in the view, we have the order underscore ID, and we want to rename it
back to the tableau name, so we're going to go to
the order ID, F two. And then instead of underscore, I'm just going to leave
it as a white space. So, as you can see in the view, Tableau did change the names automatically to the new name. Well, you might say,
Okay, and what? This is expected, if I change the name in
the data source, it's going to change as
well in the visualizations. Well, this is only in tableau. If you are using any
other tools like PowerBI and you do
renaming a the data sets, the whole visualization
go break. So here if you have
the task of renaming, this is going to happen
fast in Tableau. But in Power BI projects, it's going to be really painful. Alright, so so far we
have learned how to rename the fields globally
for the whole work boa. Now the question is, how to rename locally for
only one view. And here it depends
on the field roles. Discrete and continuous. So let's start now
with the continuous. As we learned before,
the continuous can generate the
axis of the view. So here in this example, as you can see the quantity and sales are the green fields. That means they are continuous, and they generated
the axis of the view. Now, to rename the quantity over here and the sales,
it's really easy. What we're going to do we will
go over here on the axis, right click on it, and then go to edit axis. Let's go there. Then here we have a new window, and if you go over here, you can see the axis titles, and the current
title is quantity. So let's go to the field over here and change
it from quantity, quantities. Then
let's close this. And as you can see now, the field name called
quantities on the axis. And if we check the
data bin over here, the field stays as quantity. So we did this change only
locally at this view. And this is really easy
for the continuous. But the tricky part is, if we have a discrete field. For example, the order ID
over here is discretes, we have the blue Pels, this
one is going to be tricky. So now we're going
to change the name from order ID to orders. So what we're going to do, we're going to go
to the blue p over here at the rows and
double click on it. Double forward dashes,
write the word orders, then press Shift
Inter. And that's it. Go outside, just click here. Space. And as you can see, now, we have renamed it to orders and as well here in the view, but we didn't change
the global name. It stays as order ID
here at the data pane. So this is how we rename the discrete fields
locally at one view. So it was not really clear, it's tricky, but let me show
you how I usually do it. Let's take another field
that category. Over here. We go to change it from
category to categories. What I usually do, I go over
here and double click on it, and just copy the name. Then I go to At editor
and paste the name. Then P for it, we're going
to have the new line, then double dashes, and we're going to have the
new name categories. And that, then I'm going to copy it from here and
go back to Tableau. Then I go again inside the category over
here, double clickont. Then I remove these parts and
just paste the new stuff. Then enter that, This is how I usually do it for
the discrete fields. I go to the text editor
and prepare there since it's more clear for me
what I'm writing. All right. So now you have learned
all different methods of renaming fields in Tableau, at the data source page, the worksheet page globally
and locally. All right. Now we're going to move to
the next point where we're going to rename
the tables in tau. Here again, we can do
the changes either at the data source page or
at the worksheet page, using the same methods
as renaming fields. And the next point about
locally and globally, you can change the names only
globally, anything you do, it can affect all the views, which is not really critical
as the field names. Now let's see how we can do
it at the worksheet page. We're going to stay with a small data source
over here and let's minimize everything
so we see the table names. You might already notice that on the names we have dot CSV. And that's because our
dataset comes from CSV files, which is not really
useful information to see it at the data source, so we can go and
clean up the name and rename it to only, for
example, customers. So we can go to the
name over here, right click on it, and
then click rename. So I'm going to rename
it to only customers. The next one, we're going to use the second methods using
the shortcut F two. Let's hit F two and
remove the SV parts. We have only the orders, and we're going to use the third methods
for the products. Just click and hold, then remove the CSV parts. That says. Those are
stream methods for re namic tables at
the worksheet page. Now, let's do the changes for the Big data source at
the data source page. Let's switch there. We're going to go to the data source page. And here you have two places
to change the table names, either add the data model
or add the meta data grid. So we cannot go to the data
grid to rename tables. So first, let's switch
to the Big data source. I'm going to go over here,
the Big data source. Let's change the orders
at the data model. So here we have
only one methods, right click on it and rename. So we're going to
remove the CSV parts, and then we go to the
customers over here. Then let's go to
the meta data grid. And as you can see,
just click over here, and you can remove the
CSV parts. So that's it. And now for the last one, we
have to rename the products, so we can go over here
and select the products, and then we're going
to rename it in the data source
page. So that's it. This is how you rename the tables at the
data source page. We have the data model
and the meta data grid. So with that, you have learned all the possible
methods on how to rename tables in
Tableau. All right, y. So with that we have learned how to rename things in Tableau. Next, we will learn how to
add aliases in Tableau.
60. Aliases: Let's first understand why and when we need S's in Tableau. Sometimes in Tableau projects, we face the following
situations. The first one is when we have a poor data quality
in our data sets, Cron data, typo, or
inconsistent values. So we have somehow to clean up our data before we start
building our visualizations. For example, we have scenario
on the table customers, we have bad data quality
inside the field country. Here we have a typo,
sometimes it's Germany, sometimes it is Deutschland, sometimes they call it
USA and then America. The data quality is
really bad in this table. Here we have to do
something about it and clean up the data. Here
we have two options. Either we go back to
the original datasets and do the changes
on the values, and the second option,
we can do the changes directly in Tablo using Aliases. How are we going
to clean this up, we're going to remove the
E from here, the typo, and then instead of Deutschland, we're going to have Germany and instead of America,
we're going to have USA. And we might have
another situation where the data quality is good, but the names are too long. And if you are building views, you will understand
that everything is tight and you don't have enough spaces to show the whole
values of the dimensions. That's why we end up most of
the time changing the values of the dimensions to shorter
names to abbreviations. For example, instead of
having the value of Germany, we're going to have
DE instead of USA, US, here F R D E, and US. And here, again, we have
the same situation. Either we're going to go back to the original data set and change the values or we stay at Tableau and do it directly
there using Aliases. And in real projects, you
cannot go each time back to the source system or to the original data sets and
change the values there. Either you don't
have the time for that or you cannot do that. That's why we end up always changing those values
directly in Tableau. So lyses in Tableau
are alternate names for the member of a
discrete dimension field, so that the labels appears
differently in the view. As you might notice, I say
it's discrete dimension field. And that's because Tableau
does not allow you to create elises for measures or for
continuous dimensions. So I Tableau, you can
create lises only for the fields with the
role discrete dimension. Now, as usual, we
have the questions on which page we can create elises. Well, only on the
worksheet page, we can create the
lis in Tableau, and we cannot create it
in the data source page. The second question,
can we create as globally for the
whole workbook, all the views, and as well
locally for only one view. The answer for that we
can create Alias only globally that's going to affect the whole workbook,
all visualizations. We cannot create lis
locally for only one view. We're going to go to
the worksheet page. We cannot do it at
the data source page. We're going to stay at
the small data source. Let's take the countries, drag and drop it over
here on the rows. Then let's take any measure. Let's take the scores, drag
and drop it on the columns. The task here, instead
of having those values, France, German, USA, we
want to have short names. Here we have two methods to
create Aliases in Tableau. The first one is to go to the
data bin on the left side. Let's go to the field
country over here, right click on it, and then here we have the option Aliases. Let's go there, and
here we're going to get a new window
to edit the Alias. Let's check what we
can see over here. In the middle, we
have three columns. We have members has liases
and value of the allliases. The first one,
we're going to see all the members of the
dimension country. Those values comes directly
from the datasets. So those are the original
values from the source. Then the next one
we has has aliases. It is like an indicator to
show us whether the values in the view are going to come from the original values
or from the liases. And now it's all empty because
we didn't add any allases. In the third field, we have
the liases here we can go and edit the Aliases of
each member individual. And as you can see,
now the Aliases are exactly identical to
the original values. That's why we don't
have any Aliases. So now let's go and change that. Instead of France, we're
going to have F R, and then instead of Germany, we're going to have the
E. And as you can see, as I'm adding a different values in the aliases from
the original values, Do go to market as a star. So now let's go
for the last one, and we're going
to have it as US. Now, just check what's
going to happen once I click OK. You see here
we have the old values, and if I click OK,
switches to the Aliases. That's it. This is how you can
add liases in the data in. But now, let's say that
you change your mind later and you don't want
to use the Aliases, and instead of that, you want to go back to the original values. How we can do that.
Maybe we already saw it. Let's go back to the country
over here on the data bin. Right click, we go
again to the Aliases, while editing the Aliases, there is here an option
called clear Aliases. What you can do, you can go over here and just click on it, and everything in resets
to the original values. As you can see those
indicators did vanish, that means there is no eases. Now, if you go and hit,
the values is going to go back to the original
values from the datasets. Here what I usually do once
I need aliases in Tableau, I don't go directly to one
field and change the values. But instead of that, I tend always to create a new
duplicates of the field and only change the values of the new fields that I have created. Let me show
you what I mean. We go to the country,
then right click, and then we go to the option
over here, duplicates. Let's do that. As
you can see now, we have another field called
country with the Copy. Of course, now from the name, I can understand this is Copy and the other one
is the original. But in Tableau, if you look very closely to the data type icon, you can see that in
the double gates we have an equal sign. This sign indicates that this
field is not original one, but it is created from
another original field. If you see the sign,
that means this is a customized field
that you have created. What I usually do,
I go and rename it. We're going to call
it country shorts. Now, I create the Aliases
on this new field. So let's go and do that,
right click Aliases, and then instead of France, F R, D E, and US. So with that I have the
two options, the long one, the original one, and as well, the short version
of the country. And I can decide
the visualizations, whether I'm going
to use the short version or the long version. All right, so that's all
for the first method, where we created Aliases from the left side
from the data pane. And now we're going to go to
the second method where you can create Aliases
directly from the view. So let's see how we can do that. Just move over the
value France over here, and right click on it. And then here we have
the option Edit lis. So let's select that. And now here I have
very simple window. I just have to edit the
Alias of only France. So I'm giving the lias
only for one value. Let's do that, FR and then hit OK. And as you
can see in the view now, we just changed the
value of France to FR quickly from the visualization and we can do the
same for Germany, so right click on the value. Then edit Elias again,
the same window. We're going to say DE. And ok. And as we the value
change directly in the view. So this is really
quick methods to edit the Aliases
directly in the view. And now, if you go and check the dimension country
in the data bin. So let's check the aliases. As you can see, the member, France and Germany has an lias, F R and D E, and we've done
that directly from the view. So now the question
which methods you use, I would say if you want to
change multiple values, go to the data bin
and do the changes, it's just easier to work with the window and add
all those values. But if you want to change a single value from the dimension, then you can do it quickly by going to the view,
It did the alias. That's all for the aliases. This is really great
way how to clean up how to change the
values directly in Tableau without having
you going back to the original datasets and
doing the changes there. Now we have the following
tableau task for you. The task says, Abbeviate
the values inside the field category in the table products
from the big datasets, showing only the first
character from each value. You can bowse the video
right now to do the task, then resume it
once you are done. Now let's do that quickly. As I showed you before, first, we start with
duplicating the field. I'm going to go and do
that. Then I'm going to rename it to category shorts. Then I'm going to present
both of the values category and category shorts. So far, both of the dimensions has exactly the same values. We didn't change anything. Now we're going to go
to the category short. Write it click on it, and then we're going to go
to the Aliases. The task says the
first character, the first letter
from each value. So that means the
first one going to be F. The second one, it could be O or O S, so I'm going to leave it as, and the third one is going
to be T. Then click. And that says, now we
have new dimensions that has only the first
character of each value. And we have done that
using the Eliass. This is really easy.
Alright, guys. So with that, we have
completed this section, which is a really important
step in order to prepare our data sets before we start building our
visualizations. In the next section,
we will learn how to organize and structure
our data in Tableau.
61. #8 Section Introduction | Organizing Data: How to organize your
data in tableau. In tableau, we have
different techniques and methods on how to group up
and organize your data, which is very important
for your users to understand your data. So first, you can learn how to organize the dimensions
in hierarchies. And after that, you're going
to learn how to group up the members of
dimensions using groups. Moving on, we can learn
how to cluster your data into different groups
using the cluster group. And after that, you're
going to learn how to split your data into two
subsets using sets. And then we have another
method called pins in order to group up the values of the measures in order
to build histograms. So let's start with the
first method of organizing our data using hierarchies.
Now, let's go.
62. Hierarchies: All right, guys. So the
best way to understand the hierarchy is to
have an example. If you take a look at our data, for example, the customers, you can find some
dimensions are related to each other's since they
hold similar informations. For example, the
dimension country, we have values like
Germany, USA, and France, and we have another
dimension city where you can find the cities
inside those countries. So for Germany, we have Berlin
Stuart and then we have a third dimension
postal code where you can find the codes
inside those cities. As you can see, these
three dimensions are describing a
common information. They give us information
about the user location, and we can relate
those dimensions together using the hierarchy. In hierarchies, we
have different levels, and we start with
the tobe node and we call it the root node. This node represents
the highest level of aggregations
in our hierarchy. And now we're going to go to the next level of the hierarchy, where we have the country. And in this level,
we're going to see more details about our data, where we have, for
example, the two values, USA and Germany. The links between the nodes, we call it branches. And now we're going
to go to the next level in our hierarchy. We have the level two City. So here in the city, we will see more details about our data. In USA, we have
Portland and Seattle, and in Germany, we have
Stuttgart and Berlin. Again, we have the link between the parent node and the child
node using the branches. Now we're going to go to the
last level in the hierarchy. We have the postal code. Here we're going to
split the structure furthermore with more details. So we have the following
bustle codes for each cities. Now since the bustle code is the last level
in our hierarchy, and those value don't
have any children, we call those nodes
as the leaf nodes. The leaf nodes or the leaves, they represent the
most detailed level of our data in this hierarchy. So now with that, we have the complete
structure of our hierarchy, and as you can see, it looks
like a tree structure. The top node, we call
it the root node, it represents the highest
level of the details. Then we have the
intermediate levels, and they are connected
using branches, and the last level we
call it leaf nodes, where it represents the
lowest level of details. So we have the root node, it represents the highest
level of the aggregations. Then we have intermediate levels connected with the branches, and then we have the
leaves, the leaf nodes. They represent the lowest
level of details in our As we learned before, we can do many lab operations on the cube. So if we have a
hierarchy in our data, we can do two very
important operations, the drill down and the drill up. The drill down and drill up, they are p operations
that's going to help us to navigate
through the hierarchy. In order to gain deeper or higher level understanding
of the data. So let's understand first
how the drill down works. Let's say that we are working
with the major sales, we start on the top node
on the highest level. So at the highest level, we're going to have
the total sales, in the whole data sets. For example, it's
going to be 140. So now we are at the highest
level at the root node, and if you use drill down, you're going to jump to the next lower level
in the hierarchy. So that means at this level, we're going to see more
details about the sales. So for USA, we have 90, and for Germany, we have 50. And now, if you want to see
more details about your data, we can apply again, drill down in order to jump to the next lower level
in the structure. So what's going to happen, we
go to go to the level two. And here, the sales
going to split between Portland and Seattle. We have 4050, and for Germany, we're going to have 24 St
guards and 30 for Berlin. That means we are seeing more
details about our sales. Now if you want to go to the
lowest level to the leaves, we're going to drill down
from the city to postal code. It's going to look like
this. The Portland going to split between
those two postal codes. Say Seattle going to be the same because we have
only one child. The same for Sutgarts
going to stay at 20, and Berlin, we have
two postal codes, so it's going to split again. As you can see, we are using drill down to navigate through the hierarchy by taking us from higher level to lower
level of details. It's like we are
expanding the tree to see more details to
understand our data. All right, so now
we're going to talk about the second b operation, the drill up it's exactly
the opposite of drill down. Drill up going to take
us from bottom to top from lower to higher
level of details. So how it works, let's say we're going to
start at the leaves, and we're going to have
the sales of those leaves, and now we can use a drillp to move from the postal
code to the city. So for example, we're going
to have the total sales in Berlin 30 because it's
the sum of ten plus 20. Then in Sedgt going to
stay the same 20, Seattle, 50, and Portland as well, go to sum up the values
from the leaves. So we're going to
have the value of 40. So as you can see, as
we are moving higher, the value is going to
get more aggregated. Let's see that we want
to jump to the country, so we can use again a drill up to move from the
city to the countries. So for Germany,
we're going to have the total sales of 50, and for USA, we're going to
have the total sales of 90. And now you can use
again drill app to go to the root node where you can have the highest level
of aggregations, so we can have the value of 140, the total sales
inside our data set. So as you can see, if we
have a hierarchy structure, we can use a drillp and drill down to navigate through
the hierarchy structure. So hierarchies organize and
structure the member of the dimensions into a
logical tree structure by grouping similar
dimensions together. Hierarchies are really
important and give dynamics to your views where you can have the big picture and understand the data at the highest level, and you can drill down to specific details to gain deeper knowledge
about your data. All right, so now we
are back to Tableau, let's understand how we can create hierarchies in Tableau. We can create hierarchies. Only on the worksheet page, we cannot create it at
the data source page. And in the worksheet page, we can create hierarchy
on the data pain page. And if you take a look to
the customer's tables, you can find that we
already have a hierarchy. And here we have small icon that indicates we have hierarchy. The hierarchy name
called Country City. And on the left side over
here, we have small arrow. If you click on it, the
hierarchy can expand and we can see the dimensions
inside this hierarchy. Speaking about dimensions, hierarchies could be used
only for dimensions. You cannot create a
hierarchy from measures. And this hierarchy that
we have over here, it is created automatically
from Tableau, since Tau analyzed the
content of the country and the city and automatically understood that there is
a hierarchy between them. But since we want to learn
how to create a hierarchy, we're going to go and remove it and create a new one
from the scratch. So now, in order to
remove a hierarchy, you go to the hierarchy
name over here. Right a click on it,
and then here we have the option,
remove hierarchy. Here you have to understand that the dimensions inside
the hierarchies will not be deleted. Only the hierarchy
itself will be deleted. So you will not lose any fields. Only the logical tree, the logical hierarchy
will be removed. Alright, now, let's
see how we can create hierarchy in Tau, and we're going to create
the location hierarchy. We're going to go to the
left side of the data in. We can select one
of the dimensions. It doesn't matter which one
you're going to select, but I prefer to start with the highest level
of the hierarchy. Here in our example, it's
going to be the country. Select the country,
radicli on it. Then here we have something
called hierarchy, and we're going to
select Create hierarchy. Let's go there. We have
to give it a name, we're going to call it location. Hierarchy. And then it. As you can see now
on the left side, we have the icon
of the hierarchy, and inside it, we have only
one dimension, the country. Now, in our
hierarchy, we have as well the city and
the postal code, so how we can add it
to this hierarchy. As we learn the hierarchy
has different levels, and the order of those
levels are really important. So we have country,
city, and postal code. Now in order to add the city, we just to drag
and drop the city beneath the country over
here and release it. With that, we have now the
city inside our hierarchy. Let's grab as well
the postal code, so we have to drag and
drop it beneath the city. Let's release And with that, we have created the
location hierarchy with the three dimensions, country, city, and postal code. So here, again, if
you want to hide the details about
this hierarchy, we can collapse it over here, or if you want to
see the details, we can expand the hierarchy. All right, so this is
one way on how to create hierarchy in Tableau
by using drop down. The second way on how
to create hiarchy we can quickly drag and drop
dimensions together. So for example, if we go
to the product table, we have as well a hierarchy
here between the category, product name and subcategory. So our hierarchy starts
with the category, then the subcategory,
and the last one, the leaves can be
the product name. So now let's see
how we can create the hierarchy using
quickly drag and drop. We're going to take one
of those dimensions. Let's say we're going to
start with the category, drag and drop it inside
the subcategory. So I'm now hovering and
selecting the subcategory. Let's release. Once we do that, Tableau understand that we want to connect
those dimensions. So Tableau going to
create a new hierarchy. We're going to call it
the product hierarchy. And let's. Now, let's see,
on the left side, we have new hierarchy called product hierarchy with the icon, and we have inside it two dimensions category
and subcategory. We are missing the
third dimension. Let's take the product name
and drop it in the hierarchy. Now we have problem with that. The order of the dimensions inside our hierarchy
is wrong because the dimension category
should be the level one and the subcategory
should be the level two. So how we can fix that, select the category
and drag and drop it on top of the subcategory.
Let's release that. And that says, This is how you change the order
of the categories, and with that we have
the product hierarchy. All right. So now,
let's say that we want not to remove
the whole hiarchy. We just want to
remove one member one dimension from
the hierarchy. So in order to do that, let's say we want to remove
the product name, select it, and just drag and drop it somewhere here
in the empty space. And with that, the
product name is not anymore member of the hierarchy. This is how we can remove
dimensions from hierarchy, but I want to put them back in our hierarchy because
we need it later. So I will put the subcategory
beneath the category and we take the product name and put
it beneath the subcategory. That's it. These
are the two methods of creating hierarchies
in Tableau, either by drop domino
or by quickly drag and drop the dimensions together in order to create a hierarchy. It's really easy. Alright, so
now we have this hierarchy, this structure, how we're going to use it inside our view. It's really easy.
We're going to go and select the whole hierarchy, then drag and drop
it to the view. So here, the hierarchy
going to start from the level one
for the countries, and we're going to see the
values of the country. Now, let's have one
of those measures. We're going to
take the sales and drag and rub it on the columns. So now if you look closely to the country to the
plu pile over here, you can see that we have a
new sign, the blast sign. This sign indicates that we can drill down in
this dimension. So now let's go and
click on the blast sign. As you can see now
we are drilling down in our hierarchy
to a lower level. Now we are seeing more details
about the sales and we are now at the level of the
city to the next level. Now, as you can see, we have the dimension
city in our rows. We didn't drag and drop it from the database and
put it at the rows. I expanded from the hierarchy. Again, here, the city has the plus sign that indicates we can drill
down inside the city. Let's drill down again. So, as you can see, now we
are at the postal code, and we can see more
details about the sales. Now, if you check
the postal code, there is no plus sign
like the city and the country because
we are at the leaves. We are at the lowest level
of details in our data. So with that, we have
navigated through our hierarchy from the
top node to the leaves. As you can see, it's really
easy and very dynamic. So now, let's say that
we are at the leaves, and we want to drill up back to the highest
level of aggregations. Back to the top node.
It's really easy. If you check again the
city and the countries, we don't have anymore
the plus sign, we have the minus sign. The minus sign indicate that we can drill up
in the hierarchy. So let's see what can happen if you click on the minus sign. As you can see, we drill up now from the leaves from
the postal code, back to the city,
and the values of those sales are now
more aggregated. And now the same
thing, if you want to drill up from the city
back to the country, we're going to click on the
minus sign, so let's do that. And with that we are
moved to the level one to the highest aggregation
in our hierarchy. All right, so so
far, what we have done is we drill up and drill down in our hierarchy
using the row shelves. And you know that's the
rows and the columns. We use it as developers
to build our view. So now the question
is how our users and the audience get to drill up and drill down
through the hierarchy? Because the hierarchy should
be as well used quickly from the users to drill
down to the details. So now let's see
how we can do that. If we go to the view over here
and hover on the country, we can see again a plus sign. So let's go and click on that. And as you can see,
we drill down in our hierarchy from the
country to the city. So now let's go more in details and drill down to
the postal code. We can hover on the city, and as you can see, we
have again, the plus sign. So click on that, and with that, we drill down to
the postal code. So this is exactly how the users go to drill down in the view. So now if we want
to drill up back to the higher level,
we can do the same. We can see the minus
sign over here. Click on it and you
go back to the city, and then we go to
the country as well, we have the minus,
we click on that. And with that, we drill
up back to the country. So as you can see
with those icons, we can navigate
through our hierarchy. So now you might say all
your users, You know what? This is really small icon, and my users don't like it. So is there any other way to drill up and drill
down in the view? Well, yes, if you go to any of those values over here
and write a click on it, you can see in this drop down, we have a drill down. So if you click on that, we drill down to the city, the same if you
select any value, doesn't matter which
one, let's go over here. And then drill down again. And with that we are
at the postal code. If you want to drill up, you can do the same an
values radically on it. And here we have the
drill, so silic that, and to drill up back
to the country, go to ani values in the country, tic click on it and drill. So those are the
two ways on how to drill down and drill
up in the view. All right, so so far, we have created our
own hierarchies by putting those dimensions
together in different levels. But in Tableau, we have as well indirect
embedded hierarchies in the data type date. In Tableau, any field with the data type date has
the following hierarchy. It starts with the highest
level with the year, then we have the
quarter, the month, and then the lowest level
the s have the days. Those four levels are
the default levels inside each field with the
data type date in our dataset. Now we have another
data type that holds as well an embedded
in direct hierarchy. We have the fields with
the date and time. Here we have information about the time and we
have seven levels. It starts exactly like the date, the highest level going to be the year then the quarter
month and then the day. But now we can drill down to more details since we have
the time on formation. The next level going
to be the hours, then we have minutes
and seconds. The seconds are the lowest level of details. They are our leaves. Here we have several
levels of the hierarchy. Date and date and time, they have hierarchy
embedded inside it. Now let's uncover
those hierarchies in All right. Now we're
going to go to the table orders, and
here we have two dates. Doesn't matter which
one, both of them are going to have exactly
the same hierarchy. Let's take the order date, drag and drop it
here on the rows. Now as you can see, we
have now the plus sign, it indicates there
is a hierarchy, and it starts at the highest
level with the years. Now let's take a measure
to see some data. We're going to take
the order counts and put it in the columns. I want to show as
well the labels. Let's show some
labels. All right. Now let's go and discover the
hierarchy inside the date. As you can see on the left side, we don't see any information
about the hierarchy. That's means it's really
embedded inside this data type. Let's go on the years and click on the plus
sign to drill down. As you can see the
next information, we have the quarter
informations. Now we see the total number
of orders by the quarter. Now we can see more details
about the total counts, and then we can drill
down to the day. Now we are at the lowest level. At the day, we cannot drill down further to, for example, hours, minute 10 seconds because the order date has
the data type date. As you can see, the dimension
order date has four levels, years, quarter, month and day. It's really nice to
have it like this in Tableau because it's
really standards. I worked with other BI tools. And there we have to
build it in our own, which is really time consuming to build all those hierarchies, especially if you
have a big dataset. So here in Tableau,
our life is easier. Tau did decide to have
a hierarchy inside each date. All right, guys. So one more thing
about the hierarchies, they really organize
and structure your views and make it more
dynamic for the users. So, for example, if you have the requirements to
make sales by country, sales by city, sales
by postal code, and you don't use hierarchies, you will end up
making three views, like here on the left side, so it takes a lot of space, and as well, it's
terally dynamic. But better than
that, we can create hierarchy between
those dimensions, and we can put
everything in one view, and then you give the
options for the end users to drill down and drill up
depending on what they need. So here if they want
the sales by country, we have it already
at the top node, but if they want
the sales by city, all what they have to do is to drill down to the next level, and we have it already
sales by city. And if someone's
need to go more in detail to go to the postal code, they can drill down as well
to the sales by postal code. As you can see, it gives
really your view more dynamic and going to be more attractive for the end users. If you compare to
the lift sides, now we have more dynamic, more interactive for the
end users, and as well, you are creating list views in your dashboards. This
is really great. If you want to drill up
back to the country, we can just click
the minus sign. Hierarchy gives more dynamic its structure and organize
your data in the views. All right, s. So now let's summarize hierarchies
organize and structure the members of the dimensions into
logical tree structure. And hierarchies are special
feature only for dimensions. You cannot create hierarchies
between measures, and we can use drill down and drill up to navigate through our hierarchy to gain deeper or higher level
understanding of your data. Overall, hierarchies are really important to organize and structure your
data in the views, and it will provide for the
users a powerful tool to quickly and easily navigate
and explore your data, uncover insights, and
make better decisions. Alright, so that's all for
hierarchies in Tableau. Next, we will learn how
to group the members of dimensions into
hierarchategories using groups.
63. Groups: All right, so far, we have learned how to group up the dimensions together
in hierarchies. But now we will learn how
to group up the values, the members of the
dimension into groups. In Tableau, we have three
methods in order to do that, so we have the groups,
cluster groups, and sets. Now we will start
with the first one, how to group up the members of the dimensions using groups. But now, as usual, let's understand first the
concept behind it, and then we can learn how to build it in Tableau. Let's go. Now, if you take a
look to our data, sometimes you're going to find dimensions that could be used to categorize or to group up
the data inside the stable. For example, if you take a
look to our products data, you can find that the category can be used to
group up the data. For example, you can see two
products are assigned to the category monitor and three products are assigned
to the accessories. This field could be used
to group up the data. Now if you check the
customer's data, you can find some dimensions that could be used to
group up the data. For example, the country, the city, the postal code, those information can be used
to group up the customers. All those dimensions could
be group up our data. Those groups or those dimensions comes directly
from the datasets, and we didn't create
so far anything. Sometimes we might be in a situation where
we want to group up the data differently than the original groups
in the datasets. Here we have two options. Either we go back
to the original datasets and do
the changes there, I create the group or
we can create a group directly in tableau without going back to the
original datasets. For example, we want to create a new group in the products, and it's going to be
the product class. Here we have another group, and we're going to call,
let's say, for example, the first three are the class A, And the last two
are the class B. So we can create this extra
group directly in Tableau. The same thing goes
for the customers. We want to add a new group. We want to add the
continent informations, so we can add this group. For Germany, it's going
to be Europe, for USA, going to be North America, and for the rest
France, Germany, USA, it's going to
be as well Europe. That's what you are doing now is adding new groups to our data. The groups in Tableau coine similar related values into
higher level categories, which can create a new dimension
for your data analysis. All right, so now
let's see how we can create groups in Tableau, and there's two methods
in order to do that, either by creating the groups in the data in or
directly in the view. We're going to start with the first one where we're going to create the continent
group in the data in. In order to do that,
we're going to go to the table customers and based on the values
from the country, we're going to create
the new group. Here, it's important to
understand that we can create groups only on
top of dimensions. We cannot create groups
on the measures. There is another feature
where we can use it to group up the measures.
We call it pens. But now for the groups, we can create only on
top of the dimensions, and the new field is going
to be as well a dimension. Let's see, we can do that, select the country,
right click on it. Then let's go to the
create and here we have the option group.
Let's select that. Now we're going to
get a new window in order to create the group. We're going to start first
by renaming the field name. We're going to call
this continent. And then in the
middle over here, Tableau going to list for you the distinct values
inside the country. So all possible values
from the dataset. So what we're going to do, we're going to group up France, Germany and Italy to Europe
and USA to North America. So how we're going to
do that, we're going to ultiselect those values
by clicking control. So France, Germany and
Italy, they are one group. So in order to group
them together, we're going to select
over here the group. So once we selected, Tableau going to put
all those values underneath a new group. So we're going to give
it the name of Europe. Let's click. And with that, we have created now a new
group for those three values. So as you can see,
we can expand and collapse those values
to see the details. But still we have one
more value inside the country that is not
mapped yet to a group. And here what we're going
to do, we're going to select it and then
click on the group, and we're going to
call it North America. So that it's now
inside the continent. We have two values,
Europe and North America, and they are related to those members from the
country dimension. Now, let's say that,
you want to move one of those members from one
group to another group. So how we can do
that, it's really easy by just drag and drop. So let's take, for
example, Germany, drag and drop it here
in the North America. And you will see
this member now is belongs to the group
of North America, which is wrong, so I'm
going to put it back. And that says, This is how
you switch between groups. And here we have in
Tableau. Another option is to remove the member
from all groups. In order to do
that, let's select Germany and click
over here and group. Once we do that,
you will see that the Germany value is not
assigned to any of those groups. If I collapse those stuff, you will see that Germany
is a standalone value. We usually use the
group other for all values that we couldn't
assign to any of our groups. Here Tau gives us a quick way in order to create this group. So what we have to do is
to click the value of Germany and then
click over here, include other. Let's put that. And as you can see
now, the value, Germany is inside the group O, and with that we have in
the continent three groups, Europe, North
America, and other. Now if you want to
rename the groups, you can click on the group and then click over here, rename. So we're going to have it like other continent or something. Or right click on the
group and then rename. That's really easy. So
now what we want to do is to move Germany
back to Europe. Now as you can see the group did disappear because it
doesn't have any member. So that says for now, we
have created our groups. Let's click OK. Now, as you can see on the left side, we have a new field
called continent, and it is discrete dimension, and it has a special icon and the data type indicate that
this field is a group. And I Tableau, if you
are creating a group based on another field
with the geographic role. Tableau can show both
of the icons group and geographic role because usually the group has the
following icon. For this situation, it's going
to show both of the icons, geographic role, and the group. Alright, now let's build the view based on
this new dimension. We're going to take
the continent, drag and rub on the rows. As you can see, it
has two values. We're going to take the sales as well, put it in the columns. Now to see more
details on the view, we're going to take
another dimension or we're going to take the whole
hierarchy of the location. So let's drag and
rob on the rows. Now, as you can
see, the continent is now grouping our data, so Europe for those three
values, North America, for USA, As we learned
in the hierarchies, we can drill down
to the next values. You know what, this
new dimension, the continent has
similar informations to the country and city and it
belongs to the hierarchy. Now, it makes sense to add it to the structure of our
location hierarchy. What you're going to
do, we're going to drag the continent and drop it
on top of that country. With that, the
continent going to be the level one and country
going to be the level two. We can use this new group as the highest level of
aggregation in our structure, so we can drill up
back to the continent. As you can see, we can create a new groups directly in Tableau without going back to the original data sets and
do modification there. All right, so that's what
the first method on how to create groups in Tableau
from the data bin. The second method is to create groups
directly in the view. So let's see how we can do that. We're going to create
a new worksheet, and we're going to
take two measures, we're going to take the profits. Let's put it here on the rows, and we're going to take
as well the sales. And now we want to show all
the customers as data points. In order to do that, we're going to go to the customer ID, drag and drop it put it here
on the marks on the details. So now we have for
each customer in our dataset as a data point. And now our task is we want to group up the customers
based on their performance. If you decide to go to the
data point in order to create those groups
and radically connect, then we go to the groups. You will see a long
list of all customers, and now creating groups based on those values can be really painful because the
customer ID has high cardinality compared
to the contrary. Instead of doing that here, we will do it
directly in the view. In order to do that, we will
go and select, for example, those customers,
those data points, we will get a new window. So as you can see
Tableau tell us, there is eight items
that are selected, and we have the
icon of the group. So if we click on that, Tableau going to be create few stuff. So if you look to the data pin over here on the left side, you can see that
Tableau did already create a group with
the selected items, and it did as well the coloring, so you can see the group as
well here on the colors. And on the right side,
we have the legends, so you can see the selected item is the blue and the
others are gray. So now what we have to do
is to go and rename stuff. So first of all, I'm going
to rename this group. I'm going to call
it customer group. And as you can see,
the group name is like the list of all members, it says, nine, 11, 33, five, and more. That's because it's hard for Tableau to understand why did we select those customers
and what is the group name. In order to rename the group, we're going to go
to the left side of the data bin click on it, and then we go to Edit
group. Select that. Now, as you can see over here, we have our group that we just selected with
the eight members. Let's go to the group
name, right click on it, rename, and we're going to
call it high performers. So that set, those customers has the highest performance compared
to all other customers. So as you can see,
Tableau did put all the other customers
under the group other. So let's click now, and now we have a better
name on the right side, and it makes sense to have
a gray color for other. Alright, so now we're
going to go and create another group of customers
with a low performance. In order to do that, we're
going to do the same, we're going to go in
the view and select those customers with
a bad performance. Once we do that, we're going to get this new window saying, Okay, nine items, and we're
going to select the group. But instead of that, if
you move your mouse away, you will see the
window disappears. In this case, we're
going to go to one of those data points and
right click on it, and then here we have
the option of group. Select that. Now,
what can happen table will not create a
new group on the data ban, it's going to include it as a new group inside the
already existing group. You can see here
on the right side, we have a new group with
the color of orange, and with that we have added
a new group to the customer. In order to rename it, we're going to go
to the data ban and edit the group.
Let's go there. Now instead of having
the list of the members, we're going to click
on it, rename, and we're going to call
it low performers. Let's click. And now with that, we have nice namings
for the groups. We can as well change the colors of the group, for example, for the low performance, we can have red, for the high performance,
we can have green. In order to do that,
we're going to go to the marks over
here to the colors. Click on that. Then we're
going to select edit colors. As we say it for the
high performance, so let's select this
value and assign it to green and we want for the low
performance to have a red. The color of the other
going to be gray, since it's not our focus. So let's click, and
as you can see now, the data points has new colors. And another use
case for the groups that we use it as
well as a filter, so we give the users
the possibility to interact with our views and
to focus in specific group. Now in order to do
that, we're going to go to our database
into the group, right click on it
and show filter. So now we have the group as a filter and the users
can click between the groups to change their focus on which cluster
they can analyze. And for example, if they
are not interested with all those gray stuff
and they want to compare the high
performance with the low performance to understand the difference
behavior between them, they can just remove
it like this. All right. This is
how you can create groups in tau using
the two methods, either from the data in. Especially if you
have a dimension with a low cardinality
like the country. But if you have a dimension with high cardinality like the
customer ID order ID, then you can create groups
directly from the view, which is really
fast way to assign the values to specific groups. As you can see, this
feature in Tableau the groups is really
awesome way on how to group data directly
in Tableau without going back to the original data sets and create
the group there. All right. So now you have
the following task for you. Go to the small datasets
and curreate a new group called classes based on the
dimension product name. The first three products
belong to the class A, and the last two products
belongs to the class B. You can pass the video
right now to do the task, then resume it
once you are done. Alright. So now let's
quickly create this group. We're going to check first the cardinality of the product name. So I'm just going to drag and
drop it here in the rows. And as you can see, we
have only five values. So that's means it
has low cardinality and we can do it
directly in the databan. So right click on
the product name, and then we're going to
go to the curate group, and now we're going
to call it products. Class. So we're going to
go and call it classes. And the first three
members are the class A, and the last two members
are the class B. So that. Let's go. Now we can go and
check the value. So let's drag and rob it over here before
the product name. And as you can see the
three products are class A, and the two products
here are class B. So that. This is really easy. All right. So now
let's summarize groups in Tableau combine related similar values into
high level categories, and groups can be created
based only on dimensions. We cannot create
groups for measures, and the group itself going
to be a discrete dimension. So groups in Tableau are very useful to simplify
your view and make it easier to understand
your data by grouping the data points into clear
and relevant categories. All right, y, so that's
all for the groups in tau. Next, we will learn a
very similar feature called the cluster groups. We can use it in order to cluster your data into
different groups.
64. Cluster Groups: All right, everyone. So
now we're going to learn another method on how to
group up the members, the values of
dimensions into groups. And this time,
we're going to use the cluster groups in Tableau. But as usual, first, let's understand the
concept behind it, that we can learn how to build it in Tableau.
So let's go. All right, cluster
group is another way of grouping your data used
for data clustering, which is statistical technique to group up similar
data points together. In data clustering, we have different algorithm to
calculate the clusters. For example, we have
the algorithm means, and another algorithm called hierarchical clustering
and another one called density based clustering. Tableau did decide
to go with the mine algorithm since it's really
simple and easy to implement. And the Kaman algorithm is widely used in data clustering. Now, let me show you how the
key means algorithm works. Let's say that in our dataset, we have the following
data points. So first, we have to define how many clusters
we want to build. In this example, we're going
to go with three clusters. And after that, the algorithm
going to pick three points, and we call them centroids. And then it can assign the data points to
the nearest centroid. For this data point, it's going to belong to
the green cluster. Then it's going to go to
the next data point and calculate the link between
it and the three centroids. Then it's going to assign
it to the nearest centroid. For this, it's going
to be the red cluster. The algorithm going
to do that for all data points and assign
them to the nearest centroid. At the end, we're going
to have three clusters, the green, red and blue. As you can see, the key means
is really simple and easy to implement. All right. Now in order to
understand the clusters, let's have the following task. The task is to identify high value customers by clustering them based on
the sales and profits. In order to find
out which customers generate the most revenue
and which do not. All right. Now in order to create
the cluster group, we have to be at the worksheet
page, and this time, we can create the clusters from the analytics pan and we
cannot do it at the data pan. Now let's see how we can
create the clusters, and we will stay with
the big data source since we need a lot
of data points. And here we need two measures. We need the profit, so let's track and drop it on the rows. We're going to take the sales
as well to the columns, and with that we have two axis, the sales and profit. But what we are missing now in the middle is the
customer's data. Each customer is going
to be one point. For that, we're going to
take the customer ID, and we're going to drag
and drop it over here on the details on the
marks. All right. Now we have the data points and each point represents
one customer. Now in order to
create the cluster, we're going to switch
to the analytics pan. Let's go over there, and
if you go to the models, you'll find the cluster. It's really easy. We just drag and drop it here on
the name clusters. Here we will have a
very simple window. So here it says
the variables for the clusters are the
sales and profit, and then we have the
number of clusters. And here, as a default,
it's going to be automatic, that means tableau and
figure out from the data, how many clusters do we need? And here as a default,
we have automatic, that means tableau and figure
out how many clusters, it makes sense to create
from those data points. So as you can see, tableau did already created the cluster, and it created three clusters. But if you say, you
know what, we want four clusters or five clusters, You can go over here and define how many clusters do you need. So if we have five, let me just move it over here
to see what is going on. So we have now five clusters. If you want to
have two clusters, we will have only two
colors, and so on. So I'm going to stay
with the three clusters. It makes sense. So that's it. In this window, there is
no okay or something, so we just go to
close it because Tableau can a create the
cluster immediately. Alright, so now we
have the cluster. The question is, where do
I find the cluster Well, if you go to the data
ban on the left side, you will not find any
cluster group over here because we have this information
now only on the colors. This field here is our cluster. And now we might have
this information, this cluster group
in the data ban in order to use it
in different views. So what we're going to
do we can just drag it and rub it somewhere
in the data ban. Now over here, we can
see we have new fields, and the icon indicates that this field is
a cluster group. Now we're going to give you
the name customer clusters. All right. Now we can reuse this cluster in different
views if we need. All right. Now the next point is how
we can edit our cluster. Now we have three clusters. How about we want to
change it to four? How we can do it? We will
go to the marks over here, right click on it,
and here we have the option of edit clusters. Let's select that. We will
get again the same window. In order to change the
number of clusters, we will not do it
at the data bin we're going to do
it at the marks. This is how you
edit the clusters. Now, if you go over
here again and click right and click
on the clusters, you can find we
have another option called Describe clusters. So here we're going to
find more information about our clusters. Let's select that.
As you can see here, we have a lot of information
about our clusters. So first, we have the input for the algorithm or for the
clustering algorithm. The variables are the measures
that we used in our view, the sum of rough it,
the sum of sales. The next info is the
level of details. Usually here we have
the dimensions, and we are using now the
lowest level of details, the customer ID since each data point
represents a customer. Then we have more information
about our clusters. So the number of clusters
we define are three, the number of data points, the number of customers,
we have 800 customers, and then we have the table
over here for each cluster, we have informations
like the number of items or the number of data
points inside each cluster. So in the cluster one, we
have around 617 customers. In the cluster two, we have 171, and cluster three is the
lowest we have 12 customers. The centroids of each cluster, the central points of clusters. If you need more statistics
about our clusters, we can find it inside describe
clusters. All right, guys. It's really fun to work
with the clusters, and I found different people use different designs on how
to present the clusters. For example, one design
that I see almost everywhere is that if you
go to the shapes over here, and then choose
the field circle. Now, if you have a
lot of data points, what's interesting with that to see the overlapping
between those points. But now it's really hard
to see it in this view. So what I'm going
to do with that, I'm going to focus about
those data points. Let's select those stuff, and then we're going
to say, keep only. Let's click on thats. We have now like a zoom in
in those points. So now, in order to show those overlapping in better
way in better visual, what we're going to do, we're
going to go to the colors, and then we're going
to reduce the opacity. So let's reduce it to
something like 70%. I think it should be fine. And now our visualization
will just look really professional and you can see the overlapping
between data points. Alright, so there
is another design that to assign a shape
for each cluster. So before we do that,
I want to have, again, the big picture, I
will remove the filter. So let's just remove the filter from here to somewhere else. And with that, we are
back to original view. So what we're going
to do with that, we're going to take the cluster
and put it on the shapes. So let's drag and drop the cluster on the marks
over here on the shapes. As you can see,
for each cluster, we have a shape, we have the
plus, square, and circle. And if you want to
assign different shapes, what you're going to do
is click on the shapes, and now we can go over here and change the shape of cluster. Let's say instead of plus for the clusters tree,
we're going to have x. And let's click. And now
instead of plus we have xs. So this is how I usually design
the clusters in Tableau. Alright, so now after
we create the clusters, it's really important
to interpret, outcomes of the clusters
with the business. Like in one hand, we have the red cluster focus on the customers with
the high profits, and in the other hand, we have the blue cluster focus on the customers with
the low profits. So clustering your customers
based on the sales and profit can help you to gain insights about
your customers, which can help the
business to target its marketing strategy
very effectively. All right, so now we have
the following task for you. The task is to identify the
top selling products by clustering the products based on the quantity and the profits. Create five clusters using
the big data source. You can pause the
video right now to do the task then resume it once
you are done. All right. So now let's create the
cluster for the products. Here we need two measures. We have the profit
and the quantity. Let's have first the profits. We can drag and drop
it here on the rows, and then we're going to take the quantities on the columns. And now we need the dimension to define the level of details, the data points, and
here we're going to use either the product ID
or the product name. So I'll go now for
the product name, drag and drop it on the
details. All right. So now we have
everything. We have the measures and the dimension, and we're going to go
and create the cluster. So we go to the analytic span and then we take the cluster, drag and drop it over table did create here
only two clusters, but the task says five clusters, so we're going to
go over here and define five. All
right. That says. Now we have five clusters for the products.
Let's close this. Clustering the product space on the quantity and the profits can help you to gain insights about the product portfolio, and the business can use it
for many stuff, for example, to optimize the inventory
management and make strategic decisions about the product developments
and marketing. This is really
amazing. All right. So now let's summarize the
cluster group in tableau is a statistical
technique to group up similar data points
together in clusters. The cluster gorithm used in
Tableau is the key means, easy to implement and as
well, easy to understand. Clustering in Tableau is one of the main features
and very powerful. Since Tableau is the only tool, the only PI tool that can plot endless amount
of data points. Because other BI
tools like Power BI, you always like make
limitations on the number of the data points that you
can see in the visualization, which can make it
really impossible to create clusters in Power BI. Data clustering in
visualization is a very powerful tool
for data analyses and battery recognitions to help the business and the
organizations to be data driven, which means to make better
decisions using the data. All right, so that was it
for the cluster groups. Next, we will learn how
to split the values of dimension into two subsets
using the tableau sets.
65. Sets: On how to group up the members the values of
dimensions into groups. By this time, we're going
to use the sets in Tableau. It is very similar to clusters. And as usual, we're going to start first with the concepts. Then we can learn how
to build it in Tableau. So let's go. All right. Now, let's say that we have
the following data points in our visualization. We can use datasets to
group up those data points. So sets can divine
your data based on specific criteria or selection
into two groups of data. The first group, we
call it, the group. In this group, you're going
to find all the data points that are included in
the subsets of data. These data points are
the members of the set. Other group is the out group. This group contains all
the data points that are not included in the
subsets of the data. That means the data points in this group are not the
members of the set. The sets in Tableau divide
our data into two groups, the in and out groups. When do we need sets
and why it's important? Well, we can use the
subset of data to do focus analysis on
specific scenario, and as well to compare the subset with the
remaining data. For example, we can
make a subset of the top ten customers
in our data sets, based on the sales and
compare the subsets with the remaining
customers in order to understand their behavior and
what makes them on top ten. So it's really amazing feature
in Tableau to understand your data and to make focus analysis on
specific scenario. And in Tableau,
we have different ways to create the sets. The first option is to
create a fixed set, and that's by using
a manual selection, and the other way is to create a dynamic set based
on specific criteria. And here we have two ways
to create the dynamic set, either using condition or
using ranking top or bottom. Now the last method
of creating sets in Tableau is by
combining two sets. And it can create a
new combined sets. So since we are combining data together, it's
like the joints. Here we have four options, inner, left, right,
and full join. And here, the output can be a new combined
set. So that's it. Those are the different methods in order to create
sets in tableau. So let's have quickly
some simple examples in order to understand
those methods. Alright, so now back
to our five customers, and now we're going to
create different sets using different methods. We're gonna start
with the first set. It's going to be fixed sets
using manual selection. So here we're going
to go and manually select which customers are inside the subsets and
which customers are outside. So here we're assigning
two values in and out. So, for example, we're
going to say John is inside the set
and as well better. But there is going to be out. So Martin, George, and Maria, going to be outside of the set. So, as you can see,
we just manually selected which customers
are in the set. So let's move to the second
set where we can create a dynamic set using a condition where the
sales is bigger than 400. So here we will not
select anything manually. We will just define
the rule for Tableau, and Tableau can to do it
automatically for us. Tableganz can hear
all the customers and start assigning
the values in and out. The first customer is Maria does not fulfill the condition, so it's going to
be out of the set. Next, we have the
second customer John. He has high scores on 900. It fulfilled the condition, so he is a member of the set. The same goes for George, 750, Martin as well. But Peter don't have any score, so he does not fulfill
the condition. He will be out of But Peter
don't have any score, so he does not fulfill the
condition. Peter is out. So using this condition, we have three customers
in and two are out. So now what make dynamic sets very important and
efficient at that? Let's say in the next day, those scores of the
customers did change. So what can happen after
you ratio data in Tableau, Tableau and to recalculate
the condition, and assign new values
if something changed. So there is dynamic and everything got to be
done automatically. Now let's move to the third one. We have dynamic sets, and now we're going to use
the top two customers, which means the top two
scores is going to be inside the subsets and
the is going to be out. So if you have a
look at the data, you can see Joan and George has the highest scores
between the customers. Those two customers
are going to be in and the rest is
going to be out. And again, everything here
dynamic and automatic. We just specify the rule, and Tableau going
to do the rest. All right, so those are the three methods
to create a set. Next, we're going to
go more advanced, where we're going
to create a set from combining two sets. So here we're going to take
the following example, where we're going to
create a new combined set by combining set
one and set three. So here it's really important to understand that
the calculation of this new compined
sets can be based on the output from the
set one and set three. Tableau will not check
the table customers. It's going to check only
the output from the sets. And here we have to
configure the compined sets, and we have four options. It's something similar
to the joints, but not exactly like the joints. So let's go through those
options one by one. The first option says all
members in both sets. So that means the customer
is going to be a member of the combined set if the customer is at least a member of
one of those two groups. So let's check our customers. Maria is not a member in
Set one and set three, so it's going to be not as well a member of
the combined group. And the next customer Joe
is a member of both group, so that is more than enough. So he's gonna be as well a
member of the combined set. And George is a member
of one of the sets, so he's gonna be as well in. Martin here again is like Maria. He's not a member of
Set one and set three, so he's gonna be as well out. And then the last
customer better, he is a customer of one
of those two groups, so that's gonna be enough to be a member in the combined sets. So as you can see
with this option, it's going to be enough
for the customer to be a member of one of the two groups to be
in the combined group. All right. So now let's
move to the next option. It says shared
member in both sets. So that means to be a member
in the combined sets. The customer should be
a member of both sets. So it's not like
the first option. It's enough for the customer
to be one of the sets. The customer has to
be in both sets. So let's check our
customers again. Maria is not a
member of post sets, so Maria going to be out. But next, we have
the customer John. He is a member of post sets. So that means he fulfilled
the requirements, and John going to be a member of the combined set as well. So now, as you can see for
the other three customers, none of them fulfill
this requirement. That means none of
those customers going to be inside our set. Well, this option is very
restrictive. All right. So now let's move
to the next one. It's going to say Set one
except shared members. What this means we're going to have all the members
from the set one, but they should not be a
member in the set three. So let's check the Custers. Maria is not a member in both
of them, so she can be out. And now we come to John. John is a member of the set one, but he is as well a
member of the set three. Well, this time, John
will not be a member of this group because we are
saying except shared members. So that's mean Join this
time can to be out. The next one, George is not
a member of the set one, so automatically
going to be out. The same goes for Martin. He's not a member
of the Set one. But now if you check Peter, he is the only one that's
fulfilled the requirements. Peter is a member of the set one and not
member of the set three. And this is exactly the
requirement for this group. So Peter going to be a
member of the set three. And this is exactly the
requirement of this option. So only Peter going to be
a member of this group. All right. So now let's
move to the last one. It's exactly the opposite. So it says, set three
except shared members. So the requirement for the
customers to be a member of this combined group is to be
a member of the set three, but not a member of the Set one. Alright, so now let's
check our customers. I really feel bad for Maria. She is not a member
of any of those sets. Like, if your name is Maria, I'm really sorry for
that, it's not intended. But now it's really too late. I already recorded.
So sorry for that. Next time, I promise you, I'm going to make better examples. But for now, Maria is out
as well in this group. The same here goes for John John is a member of Set three, but John is as well
a member of Set one, so he does not fulfill the
requirements. John can be out. Now, if you look
to the customers, George is the only one in the Set three and
not in the Set one. So only John can
be in this group, and the other two are out. All right, so with that, we have covered all the scenarios, or the methods that we
have in the tableau sets. All right, y. So
now let's see how we can create sets in Tableau. We can create it in
the worksheet page. We cannot do it at
the data source page, and we can do it either at
the data ban or in the view. So now we're going to
create different sets using different methods. But first, let's
create the view. So we need the customer ID. By the way, instead
of drag and drop, you can double
click on the field, and it's going to
be in the rows. We need as well the first name, double click on the first name. We would like to have
the scores as well. So drag and drop the
scores at the ABC. So now we're going to create the fixed set using
manual selection. So in order to do that,
we're going to go to the customer ID over
here on the data bin, right a click on it, and
then we go to create. And over here, we have sets. As you can see, the sets
has the icon of joints. But it is not joints. It has just the same simple. So let's click on that, and
now we have a new window. So let's see what do
we have over here. So we have first the
name of the set, so let's call it
set one and fixed. Okay. And now we have
over here three tabs, general condition and tops. As you can see, those are the different methods of
creating sets in Tableau. The general tab is actually the manual selection,
the condition, as you know, the dynamic set, and the top as well,
is a dynamic set. So now we're going to
go with the first one. We're going to start with the
general manual selection. Now here in the middle,
we have a list of all customers in our data sets, and we have to go
and start selecting manually which customers are in and which customers are out. So in our example, we
selected the customer two and the customer five to meet
the members of the in group, and anything that you are not selecting going to
be on the out group. So that sets the customer
one, three, four, are out. So let's go now and click Okay. So now let's see
what happened on the data bain. We
have a new field. It's going to be
discrete dimension, and since it's set, it's
gonna has the following icon. It's like the icon of joints. So now let's see the
values inside this field. Let's drag and
drop it over here. And now, as you can see, we have only two values out and in. It's like Polian data type,
we have true and false. And here, as well in the seats, we have only two values. So we selected the customer
two to be in the sit and as well the customer five to be in the set, the risk
going to be out. So this is how you
can create sets in Tableau using manual selection, and it's going to be fixed. All right, so now we're
going to go and create a dynamic set using condition. Our example was the customers
will score higher than 400. So let's go again
to the left side, right click on the customer ID. Go to create and then to set. Let's call it now set two. And we're going to
call it condition. So since we are making
now a condition, we're going to go to the
tap condition over here. So now we're going to go
and specify for Tableau, the rule to decide which members are in and
which members are out. The rule says score higher than 400. So
let's define that. First, we have to
select this by field. So our field is a score, which is correct, and then the operation over
here is not equal. It should be higher than 400. We have to specify the value
over here, and that's it. If the score is higher than 400, the customer is going to be in. Otherwise, it's going to be
out. Now let's go and click. And as you can see, we
have another dimension on the data pane called
set two double click. Let's check the values, the score over here,
350, which is out, 900 in 750 in 500 in a null one. So as you can see, it's really easy to define the dynamic set. We have just to provide a rule
and table and do the rest. If tomorrow we have
different data, the sit members going to change. Now we're going
to create another dynamic set using the rank. In our example, we had the top two customers going to be in and the rest
is going to be out. Again, we're going to
go to the data pane. Right click on the customer
ID, create the set. Let's give it a name,
so it's going to be sit three and rank. Now we're going to
go to the third tab over here to the top. So let's go So for this example, we're going to use the
score to rank the customer, so the highest two
scores go to be in. So in order to do that,
it's really easy, we're going to define
it here by field. And here in ranking,
we have top or bottom, as you can see, so we're
going to stay with the top. And next, we have to define
what we are selecting, top two customers, top
ten, top five, top 20. So here we have to go
with a two and by score, so we are using the score. Everything is correct,
and that's it. So this is how we define the rule and Tableau
gonna do the rest. So it's really logic
if you just read it, top two by score. Alright, so that's all.
Let's go and select. As you can see, we
have the set over here and the data
being dupliclict. Now let's check the data. As you can see, John and George, they have the highest scores. That's why they are in and
the rest they are out. So as you can see,
sets are really easy in tableau. All right. So now we're going to go
and make it a little bit complicated where we're going
to create combined sets. So we're going to go and
combine set one with set three. In order to do that,
we're going to go again to the data
ban but this time, we're going to
start from the set. So let's go to the set number
one, right click on it, and then we have here
an option called create Combined set.
Let's click on that. So as you can see, we have here a new window for
the combined sets. First, let's give it a name, so it's going to be set
four and combined. Okay. So first, we have to
define the two sets. So we have here's the Set one
since we started from it. And then on the right
side, if you click on it, you will get a list of all sets available in the data bin. So we have the set
two and set three. So we're going to go with
the set three. All right. So with that, we have defined which set is going
to be combined. But now we have to define for Tableau how the data
going to be combined. So here we have four options. The first one is going to be
all members and both sets. The second one, only the
shared members on both sets, and the next one is going
to focus on the set one, and the last one going to
focus on the set three. So for this example,
we're going to go with the shared
members in both sets. So let's go and select that. And as you can see
here between the sets, the icon did change as well. Alright, so now everything
is ready. Let's click. So here, again, on the data bin, we have a new field,
new dimension. Let's see the results. I'm going to go and double click on it. So now let's see the results. We are combining the set one over here with the set three. So here if you go and search
for the shared member, it's going to be only
the customer two, since it is in in the set one and as well
in in the set three. So as you can see, we have only one member
in the combined set, and that is the customer
John because it is the only shared customers
between the two sets. So it's really not that hard, you just have to pay a
little bit of attention to which combining
option you are using. All right, guys. So so far we
have learned how to create the sets from the data pain
using different methods. Next, we're going to go
and learn how to create the sets directly from
the views. All right. So now we're going to go
and create a new view, and it's going to be something similar to the cluster group. So we're going to have the two
measures profit and sales. So let's go and select them. So double click on the profits and double click on the sales. We have now the two axes. What we are missing
now the customers. So in order to add
the data points, we're going to go
to the customer ID and double click on it. So now we have our view, and we're going to go and create the set directly from the view. Here, it's very
similar to the groups. We're going to go and select which customer is going to
be the member of our set. So in this example,
we're going to go and select the customers with
the high performance. So all what you have to do
is to select like this. Let's go for those customers. And again, here we
have this new window. Last time we have
created the group. But this time, we're
going to go and create a set from
those customers. So click on D and then
we have to select this Curit set. So
let's go and select. So, now we have a new
window, and as you can see, we cannot define conditions
or any dynamic set. It's going to show us a list of all customers that we have
selected in the view. And the only thing that we
can do over here is to check, did you select all the
customers correctly? And if we've done any mistakes, we can go and remove
the customer. So now let's give it a name. I'm going to call it set. Customers, high performers.
That's all for now. We're going to go and
hit. Let's select that. Now, as you can see, nothing
changed yet in our view, we have now a new field on
the data bain code set. So we just created new set
directly from the view. Now, quickly, I want to show you something if you
are selecting group like this and let's say the
window here disappears. What you can do, you can go
to any of those data points, right click on it, and then here the last option is create set. This is another
way how to create a set directly from the view. All right, so now we
have the set and you might ask me what
you can do with it. Well, we can do many
things with the set now. First, we can highlight
it in our view. In order to do that,
we're going to take the set from the data pane, and let's just put
it on the colors. Now we can quickly
see which members are in and which
members are out. Here, as you can see, Table
always use the color of gray for the members
that are out of the set. Of course, you can change
that by going to the marks. So if you go over here, then
we go to the dt colors and you can define over here the color of in and
the color of out. But for me now the colors
are okay, so let's click. With that, you are
highlighting subset of your data for the
end users. All right. The other use of the
sets inside our view is that to focus on
specific subset. Currently, we are
showing all the customers the in and the out. How to filter the data only for the customers that are
member of the set, only for the group. In order to do that, we're
going to go to our set, write a click on it, and here
you can find two options. As you can see by default, we have show in out of set. That means we are
showing everything. But now we have another option called show members in the set. So that means we're going
to filter the data, and we're going to
show only the members inside our set, the group. So let's go and select that
and see what can happen. So as you can see, now Tableau, remove all the customers that
are outside of the sets, and we can see on the view
only the members of the sets. So this is really quick
way on how to filter your data and to make a
focus and specific scenario. But now you might
say, you know what? Let's give this
option to the users. So let's have the
audience that the users decide in which subset
they're going to focus on. This is going to
make your view more interactive and dynamic. So in order to do that, we can
offer the set as a filter. Let's see how we can do that. First, we have to show all
the data points in our view. So we're going to
switch that pack. Let's go to our set,
right click on it, and we're going to go and
select show in out of the set. Show everything.
It's a elk that. Next, we're going to offer
the set as a filter. Go to our set again, right click on it, and here we have the option of show filter. Let's select that. Now as you
can see on the right side, we have the two options in out and So now we have
different scenario. If the users wants now to
see the whole big picture, all customers, they're going to leave the filter as it is. But if we have
different scenario where they want to focus on the subset on the customers
with the high performance, all what they have to do is to deselect out and the filter.
So let's go and do that. Now, as you can see,
we are focusing on the subset of the group in, only the members in the set. For some other reasons, another users want to focus on the groups that are
outside of the sets. Maybe to understand the
behavior and so on, so they're going to d select
the and select the out. So now we are focusing on the group that are
outside of the sets. And again, if you want to
see the whole big picture, you're going to
select both of them. So I really prefer to give
this option to the users to decide on which subset they're going to select and
they're going to focus on, because with that,
you are covering many scenarios in only one view. All right, guys. So now
with the sets in Tableau, we can go a step further, where we're going to give the
full dynamic to the users, and they're going to
have the option of defining which customer is
going to be in the set. Because so far, what
we have done is that by creating the views,
we defined everything. So we defined which
customer is going to be in and which customer
is going to be out. But now instead
of redefining it, we're going to give the options the full dynamic of
defining the whole set. So let's see how we can do that. So in order to make the set
dynamic and interactive, we're going to add an
action to our worksheet. I will dedicate
later full tutorials on the actions and the
interactivity in Tableau. But now let's just learn how
to add an action for sets. Alright, so in order to do that, we're going to go
to the main menu in Tableau to the worksheet. So I'll select
that. And then here we have actions in
Tableau. Let's go there. Now I will not go in details explaining all the options
that we have in the actions. Because here we have way more than sets. We have
a lot of things. So now just follow
me, we're going to go to the add action over here, and then we have the option
here, change sets values. So that means the actions of the users go to change the
values inside our set. So let's go and select that. Now, we have to give
an action name, so we're gonna call it action. Change set. And
now we can select in which worksheets this
action can be applied. So now if you go over here, you can see the list of all sheets that we have
in our ***** workbook. So now I want to
apply this action only on this worksheet,
so everything is fine. Now here we are defining
the behavior of the user. So now the question is when the action going
to be triggered, either by hovering in the mouse or by selecting
the data points, or by drop down a menu. So I will stay
with the defaults. Let's have the user clicking
on those data points. Alright. So now we're
going to define the target set which sets is going to
change once we do the action. So let's see what we have here, so you can see we have
two data sources. In the tutorial we created in the small data
source three sets, and in the big data source, we have created only one set. Once the action is triggered, the values of the set
should be changed. So let's select that. And now we are coming to the
interesting part. But first, subcove. Okay. Here we have two types
of actions with the mouse. First, let's check
the left side, what can happen when we
select a data point. The first option going to say, assign values to set. That means it's going to create completely new set from
what you selected. The second option is
add values to set. Table going to hold the
old values and everything that you are selecting
can be added to the set. And the last option
is anything that you are selecting going to
be deleted from the set. Here it really
depends on how do you want the users to
interact with the view. Either you want them to
create completely new sets, so you're going to go
with the option one or you want to predefine sets, and you want them to extend it by adding new
members to the set, so you're going to go
with the option two, or you want the users
to start removing members from the
pre existing sets. I would say let's go
with the option two, where the user is going to add members to pre defined set. Alright, so that is
for the left side, what can happen once the
user start selecting. And on the right side,
what can happen once the user starts moving
away from the selection. So here, the first option
is to keep the set values. Second is to add all
values to the set. So that means once the user start moving away
from the selection, all the members,
all the customers are going to be in the in group. It's going to be inside the set. The third one is
exactly the opposite, what's going to happen,
all the data points is going to be
outside of the sets. So I think both of
them are extreme. We can leave it as it
is, keep set values. So now let's keep those options, and let's see what can happen in the view once we
start selecting. Let's go with K. So
as you can see here, we have our new action.
Let's click OK. And now let's go inside the view and start selecting stuff. But before that,
I want to change the shape of those data
points to be more clear. So let's go to shapes and use the field
circle. All right. So now I'm not
selecting anything. Like if I move my
mouse over here, you will see nothing
going to change. But the action
here is to select, so to click on the data points. Let's click on that.
Let's move away. So now we can see
this member is blue. That means it is in the set. And anything I'm clicking on those data points cannot
be inside our set. Or we can go over
here, for example, and select all those
staff at one time. Now, anything that I'm
selecting the view as you see, it's going to be
included in our set. With that, we are going full dynamic and we give
the option for the user to define which customer is in and which customer is
out. All right. With that, we have covered
everything about the sets, how to create it as
a fixed, dynamic, from the data bin,
from the view, how to add actions to it, how to add it to filters. This feature in Tableau is
really great. All right. So now let's summarize the sets in Tableau going
to divide your data based on specific criteria or
selection into two groups. So we have the subsets. It's going to contain all
the members inside the set, and the out subsets, it's going to
contain all members that are not
included in the set. The sets is very important
feature in Tableau. Since it's going to allow
your users to focus on subsets of your data and to compare it with the
remaining data, and sets are a great way to add dynamic and interactivity to your views by giving
the options for the users to define in which subset they're
going to focus on. All right, guys, so that's
all for the sets in Tableau. And next, we will learn
how to group the values of the measures using pens and how to build
histograms in Tableau.
66. Bins & Histograms: All right, guys. So so far, we have learned different
methods on how to group up the values of
dimensions into groups. But now we will learn
how to group up the values of
measures into groups. And for that, we can learn
the pins in tableau. And as usual, let's first understand the concept
behind the pins, and then we can learn how to build it in tableau.
So let's go. All right, y. So before, as we learn dimensions
and measures, we learn the secret formula
of building new views, and that is measure
by dimension, like sales by category. But sometimes we have to
build view from two measures, so it's going to be
measure by measure, like profit by sales, quantity by profit, and so on. One way to do that is by converting one of those
measures to bins. So we will have
profit by sales pins and quantity by profit
pins. So what is Bins? Pens divide the data into groups of equally
sized containers, resulting in systematic
distribution of the data, and we can use those pens to create charts called histograms. Histogram going to classify your data into
different pens and then counts how many data points do we have inside
each of these pens. In histograms, we usually use the par chart to
visual the data. All right, so now let's
have an easy example in order to understand the
pens and histogram. Alright, so now let's
have the following data. We have ten customers
and with the scores. The scores are like points
that the customers collect. And now we want to count how many customers fall
within a range of scores. For example, how many customers do we have in the range 0-30, 30, and 60, and so on. So first, we have
to create pens. In order to create pens, we need few informations. Like, what is the highest
value in the scores? So it's going to be the
first customer, the 63, and what is the lowest value in the scores? It's
going to be the zero. The next value that we have to define is the size of the pen. So for example here, we're
going to take the size of 30. And now we have all
the information that we need in order to
create the pins. Don't forget they
are equally sized. So what that means.
So the first pins that we have is 0-30. It starts with the lowest
value with the zero, and the size should be 30. That's why we have
the range 0-30. So this is our first pen. The next one going to be
between the 30 and the 60. Again, as you can
see, the size is 30, and now the last pin go 60-90. And with that, we're going
to start because with the last pen we can
cover the highest value. So with that we
have created from the measure score,
equally sized pens. Now, after we created our pens, we're going to go and
count how many customers, how many data points do
we have inside each pen? All right. So now let's start counting the customers
for each pen. Our first pen starts 0-30. So let's see how many customers do we have inside this range. So the first customer is
out, we will not count it. The second one is
inside the range, so we have customer, two customers, three customers. This customer is out of the
range, the same over here. So here we have the
first customer. This customer is out. We have the customer number
five, and that's it. So we have five customers between the zero
and 30. All right. So now let's move
to the next pin. How many customers do we have
that their score is 30-60. All right. So now let's start counting and scan our table. I think all those
values are out. We have this customer that
is inside this range. Then we have the
45 and as well 55. So we have four customers
their score 30-60. So this is our second Let's
move now to the last pen, so we have the range 60-90. And now let's count
how many customers do we have inside this range. So we have ten customers
who have already nine, so I think we have only one, and that is the
customer number one. And all other values
are not in this range. So we have one customer. And that's it.
With that, we have created a histogram
for the scores. We just have to create
the pens and count how many data points are
inside each of those pens. And we call those
blue pars as pens, and each pen has a size. Now, let's say that
we want to define another value for
the size of the pen, and we take the value ten. So what can happen? We
can have more pens. The first one is
going to be 0-10. The next is ten to 20, 20, 30, and so on.
It makes sense. If you define smaller
size for the pens, you will get more
chunks from the data. Instead of having three pens, now we have seven pens. As you know, after
creating the pens, we're going to count
how many customers do we have inside each
of those pens. So if you go and start counting, you can have the
following histogram. So as you can see, what
is defining the score is the lowest and the highest
values inside our data, and as well the
size of the pens. So as you can see,
using the pens, we created different
groups from a measure. And now you might ask me, why do we need histograms,
why they are important. If you compare the table
on the left side with the visual on the right
side, in the histogram, you can quickly
identify trends and patterns in the distribution
of the customers. Like you can see
quickly that most of our customers have
the score 0-30. This type of chart can help you quickly understand whether everything was okay or you have to improve
in certain areas, so you can define
new strategies and make better decisions
using the data. Alright, so now
let's see how we can create pens and
histogram in Tableau, and we can do that only
on the worksheet page. We cannot do it at
the data source page, and there's two ways
in order to do that. Either we create pens
in the data pane or we can create pens
in the visualization. So let's start with
the first one. So now we're going to
create a histogram for the customer scores, and we're going to
stay with a big data source on the left side. We're going to go
to the data pane, and we need the score, right click on it, and
then we go to create, and here we have
the option of pens. So let's go and click that. So now we have here a new
window to create the pens. The first one, we
have the field name. We're going to
leave it as it is. The second option here,
we have the size of pens. And here as a default
table to follow specific mathematical
equation in order to find the suitable size of pens But if you don't
want this value, you can go and change it. So for example, let's go
with the value of 20. And after that, we
found informations about the range of values. So what is the minimum value and the maximum value that we found inside the field score and the differences
between them? So for now, that's all,
we're going to have the size of bends of
20, and let's hit okay. Now if you check the data
ban on the left side, you can find a new
field called score pen. It is a dimension because
it has infinite number of values and the score can stay,
of course, as a measure. Let's check the values
inside our new field. Let's drop it here on the rows. Now as you can see, we have the pens and the size
of each pen is 20. Okay, now so far we have
the pens from the score. The next step in order to make a histogram is to get the
count of the customers. Now let's use this measure the customer count drag
and drup it here on the view and then
I have to switch between them so it
looks like a histogram. With that, we have
our histogram, but we are not there yet. To make it look like
a real histogram, we have to have the
pens continuous. So if you check the score
bin on the left side, you can see it is a discrete. It is a blue color,
and now we're going to go and convert
it to continuous. Right you click on it and
convert to continuous. Let's click on that, and it's still on the
view as a discrete, so we have to convert it as well here on the view
as a continuous. With that, we have created
a histogram in Tableau. I'm going to add the
final touch where I'm going to add the
values for each pen, so we go to the lapels,
show Mark label. And now I'm going
to change as well, the coloring in our histogram, so I'm going to
take the score bin and put it in the colors. Let's do that. We
are still not there. I would like to
have the pin with the highest number of
customers to be darker. So in order to do that,
we're going to go to the customers dot color. And then we're going to go
over here and reverse it. Click? Now, I'm happy. This is how I usually present the histograms in the projects. And now, once we
have the histogram, we have to discuss it in
order to understand the data. So usually we search for peaks, for valleys, or any
outliers that stands out. For histograms, there are different shapes with
different interpretations, and the shape of
our histogram that we have called
skewed to the right. Skew it to the right means that the histogram on the left
side has the highest peak, and then the frequency
of the data going to be descending as
you go to the right, and on the right
side, you're going to have the lowest frequency
of the data points. Is not really good
in this example. That means we have a
lot of new customers that didn't collect
yet any points. So the histograms are really powerful to see the distribution
of your customers in one click and to quickly
understand whether there are issues in your business or
if you find any new trends. Now, for this example, we have decided that the size
of the bend is 20. Let's say that you want to
change the distribution, and you want to change
the size as well. In order to do that,
let's go to our field, right click on it, and then we go to the edit Let's slick that. And here we can go over here and change it to ten.
Let's click Okay. Now, as you can see, we have more pens and more
details about our data. So now you might ask me, I
want it to be more dynamic, and I want to give the users the option of defining
how many pens do we have. And for this, we can use another feature
called parameters, which is going to be in the
next tutorial. All right. So now, so far we
have learned how to create pens from the data pin. There is another way to create pens and histogram in Tableau, which is way easier
than what I showed you. We can do that directly
from the visualization. Let me show you what I mean. So let's create a new worksheet. And let's say that
I want to create a histogram, from the sales. So in order to do that,
we're going to go and take the sales and
put it on the rows. And then we're going to
go over here on the show, and we have predefined visualization from Tableau
called heterochrome. So the requirement for
this visualization is only one measure. So once we click on that, you will see that
tableau did everything. If you check the data
pane on the left side, we have already
been or dimension called sales pen with
the role of continuous. And of course, Tableau to
suggest the size of the bends. You can go and change
that, of course. But as you can see, it's
really easy if we just took one measure in the view and
click on the histogram, the rest is going to
be done from Tableau. And this is exactly the power of tableau in the visualization. All right, so now
let's have a summary. Pens can divide your data into equally sized
containers which can result in systematic
distribution of the data, and pens are the method of
creating groups from measures. So that means we can create
pens only from the measures, we cannot create it from dimensions because
dimensions are already pens. And pens themselves
are dimensions, and it's better to convert it to continuous dimension to
be used in histograms. And one limitation
in tau that you cannot create pens from
calculated fields. And the main purpose of
having pens and histogram to quickly identify patterns and trends in the distribution
of your data. All right, so that's all for
the pens and histograms. And with that, we have learned everything about how to organize and customize our data in Talaau and we are done
with this chapter. Next, we will learn in
Tableau how to filter your data using different
techniques at different layers.
67. #9 Section Introduction | Filtering & Sorting Data: Filters. In tableau, we have many different types of
filters for different purposes like optimizing the
performance or as well for your users
to explore your data. That's why it's
very important to understand them and the
differences between them. So that's why first, we
can start by understanding the concept behind the different types of
filters in Tableau, and then we can learn
the different methods on how to create all those
filters in tableau. Moving on, we can learn
the many different options on how to customize the
filters in tableau. And at the end,
I'm going to share with you many tips and tricks, based practices of
using filters in tableau that I usually
follow in my projects. So let's start for
the first topic where we can
understand the concept behind the different types of filters in Tableau.
Now, let's go.
68. Types of Filters (Concept): All right, guys. So
now, we're going to talk about the
filters in Tableau. But first, as usual, we have to understand
the concept behind them, and then we're going
to learn how to build filters in Tableau. So let's go. Alright, so now we're going to start with the question, what are filters. Filters means to remove
or select a subsets of the data for different
purposes and use cases. And in Tableau, we have
the following reasons or use cases for filters. The first use case
for the filters is to reduce the
size of your data. Reducing the size of your
data inside tableau, go to improve and optimize the performance of
your dashboards. Especially if you are dealing in the project with the
huge data source, reducing the size of
such a data source, go to mean reducing the
processing time inside tableau, which is gonna lead to optimize response time in
your visualizations. So this is one of the reasons why we use filters in Tableau, to optimize the performance
of our dashboards. The second use case of filters is interactivity and analysis. We usually offer a set of different filters for
the users because different users may have
different goals or may be interested in specific
aspect of the data. So that means
allowing the users to filter and to focus
on subsets of the data can help in better analyzing and
understanding of the data. And the third use
case for the filters is, hiding sensitive
information. Data security is becoming very important topic
in each project. As now, many people are
working with the data, the data security is becoming
a very important topic. And in Tableau, we
can use filters to restrict the sensitive data or to hide it from the viewers to make sure that
we are protecting such a sensitive or
confidential data from being exposed
to the others. And the fourth use case for the filters is data
access control. Role level security RLS. This means that we can use the filters in Tableau to limit the access to data of the users based on the
role and the permissions. Because in real projects, you cannot just go and build visualizations and
share it with everyone. Instead, you have to protect your data and to have
some data instructions. Like, for example,
you're going to have users like sales employee. They should not see the
data like managers. So in order to
protect your data and implement the role level
security in Tableau, you can use filters. So as you can see, filters are really useful in
data visualizations. And I Ta we have six different filters for different purposes
and use cases, and I group them
under two categories. The first group of filters, they can optimize
the performance. So we have under this category, the extract filter,
data source filter, and the context filter. And we have another group for the interactivity
and for analysis. And underneath this group, we have the following filters, we have dimension filter, measure filter, and table
calculation filters. And now I'm going to go and
explain them one by one. All right. So now we
know doctor understands how the different
tableau filters work. Let's have a quick
recap on how Tableau processed the data through
different layers. Let's go. First, you connect your
original data into table data sources by either having an extract
connection where you can load an extra copy of the data inside
Tableau or you can use a live connection between your data and table data
source to get data on demand. The new might have
different worksheets connected to the data source, and for the visualizations, they're going to send
query to the data source, and then the data source
can respond by sending the result data back to the visualizations
and to the worksheet. As you can see,
your data is moving through different layers,
different stations, and if you are not using
any type of tau filters, the whole amount of
data can be moved and processed from one
layer to another layer. So for example, and those are just numbers to
explain the concepts, we have in the
original source of our data 30,000 records. That means the whole
amount of data going to exist as well at
the data source level. So there we're going
to have as well the same number
of records, 30 k, and then the same
amount might be as well the results
of your queries, so we're going to have
as well 30 k records in the visualizations. We might be in a situation where the source of our
data might have, a lot of unnecessary data. So it's going to
be really wasting resources and performance in Tableau if we are going to process the whole amount
of data in each layer. So what we're going to
do, we're going to go and apply different
types of filters as your data is moving from left to right from the sources
to the visualizations. The first type of
filters that we can use called the extract filter. You can apply the
extract filter between the source of your data
and the table data source. You can use this type of filter if you are using the
extract connection. So that means you cannot use the extract filter for the data sources using
the live connection. So the extract
filter will be used to filter the data
before it even enter The table data source. So, for example, if we are
using the extract filter, instead of having
the whole amount of data in the data source, we might have only
20 k of records. So the main purpose of
the extract filter is to optimize the performance of
loading data into Tableau. Sometimes you might
be in a situation where loading the extract or refreshing the extract in the table data source
taking very long time. Here, usually we go and create the extract filter
in order to get rid of all unnecessary data and remove it before it
even enter Tableau. Another benefit is optimizing the performance of
your visualizations, because we're going
to have less data, less processing time in Tableau, and that's going to result in better response time in
your visualizations. The main purpose of
extract filter is to optimize both the loading time and as well, the response time. And now let's move one
step to the right side. We have another filter, we call it the data source filter. So you can apply
this filter between the table data source
and the worksheets. So here, again,
the worksheets are sending queries to
the data source. But this time, the
data source will not respond by sending
everything the whole data, but instead here the data source can filter the data first. And then send the results. So here instead of
sending 20 k of records, here tableau might send like
around ten k of records. Here again, the main purpose of the data source filter is
to reduce the size of data. So that means and you
know that already, having less data means
less processing time in tableau and bitter response time in the worksheet
in the visualizations. And here we have
another use case for the data source filter is to hide sensitive informations from the worksheets from the viewers. All right, so now
the question is, what are the main
differences between the extract filter and
the data source filter? Those two filters
are really similar, but still we have
some differences. The extract filter
as the name says, it could be applied only on
the extract connections, while the data source
filters could be applied in both extract and
life connections. Filters could be found only
on the Tableau disto version. But the data source filter, we can find it in both Tableau
disto and tableapablic. And the main purpose
of the extract filter is to optimize both of the performance of
loading the data and as well the response
time indivisualzations. While the main purpose
of the data source is to optimize the response
time indivisualizations, and as well to hide
sensitive informations from the viewers
from the worksheets. All right. So now
we're going to move one more step to
the right side to the next station where the data is now inside our worksheets, and here we can use a very
unique tableau filter called the context filter. In tableau if you create
a context filter, what you are doing is creating an additional layer
inside the worksheets, where Tableau going to take the result data from the
data source and create a new optimized tembral table based on the filter
inside the worksheet. And then the visualization
is going to get the data from this temporal
new table or subset. And here, the downside of the context filter is we
are losing performance because Tableau can
spend resources and time in order to build
this temporal table. Now you might ask
me, why do we need context filter if we have
a data source filter. We can easily use the
data source filter in order to reduce the size, and with that table, don't
waste any resources or time in order to build this
layer, this extra table. Well, the answer for
that is flexibility, because once you apply
a data source filter, you are filtering
all the worksheets that are connected
to this data source. And in some scenarios, you cannot use the
data source filters. Because you have
different requirements and different focus
in each worksheet. So you cannot set up one filter that is suitable
for all worksheets. And here comes the power of the context filter
where you can fulfill all the different
requirements by defining different filters
for different worksheets. So you are flexible with the requirements, and
at the same time, you are reducing the size of the data to optimize the performance of
the visualizations. And here you can go and
decide for each worksheet, whether you want to
reduce the data using context filter or you want
to have the whole data. Having this option going to give you a lot of flexibility. For example, in the
worksheet number one, we could use a context
filter where we can reduce the number of
records to seven K. In the second worksheet, we could use a different
context filter with different criteria, where we can reduce the
number of records to five k. The context filter is
really unique feature in Tau, but don't forget we
have here a trade off between the flexibility
and as well losing some performance because Tau have to create
those temporal tables. So now by checking
the big picture, that's how the first category of the filters works in Tableau. We have the extract
filter data source filter and the context filter, and they share the same
goal to reduce the size of the data in order to optimize the performance of
the visualizations. These filters are
usually created from the Tableau developers
and will not be offered for the users
indivisualizations. And thus brings us to the
second category of the filters. We have the dimension filter, measure filter and the
table calculation filter. We usually offer
these filters to the users to give
them the power of slicing and dicing the data to focus on specific
subset of the data. So these filters usually
exist in the visualizations, and they share the same
purpose to enable users to do analysis and to have better
understanding of the data. And it's better to explain those three filters
directly in Tableau. Now, by looking to
the big picture, you can understand that as we are moving from
left to right, the importance and the priority of the filters are changing. For example, the most
important filter is the extract filter, and as well as the
highest prio in tableau, which means Tableau
can process it first, and the table calculation filter is the least important
and has the lowest. That means Tableau can
process it as a last one. So the order of the filters in tableau are very important to understand in order to know
where to apply which filter. The order of filters in tableau are defined
like the following. The first filter to be processed
is the extract filter. The next can be the
data source filter. After that, we have
the context filter, then we have the
dimension filter. Next, we have the
measure filter, and the last in our list is
the table calculation filter. The top filter going
to be processed first, and as you are moving
down the list, the filter is going
to be low prio and will be processed as a last. Here again, about the usage, the extract filter
data source filter and the context filter is used
to reduce the size of data, and the other three filter
is going to be used by the end users for analysis and better
understanding the data. Now the question is where we
can create those filters. The extract filter and
the data source filter, we can create them in
the data source page. The other filters, we can create them in the
worksheet page. All right, so with
that, we have learned the different types
of tableau filters and the concepts behind them. And next, we will learn how to create different
filters in Tableau.
69. How to Create Filters: All right, so now we
have the following task where we have to hide
sensitive informations. For example, let's
say that the USA data in our data set is
sensitive informations, and we have to hide
all the customers that comes from USA. And now we're going
to go and build a view from the customers. We're going to take the
location, the country. And then let's say we're
going to take the profit from the orders. All right. Now, as you can see
in the worksheet, we can see all the
countries including USA. Now we're going to go and hide this sensitive information. In order to do that, we're going to go to the data source page, and then here on the
corner on the top rights, we can see filters, and we can add a new filter.
Let's go and click on it. Then we will get a
new window codes edit data source filters.
It's really easy here. We're going to go to
the ads, click on it, and then we're going
to get a list of all the fields that are
available in our data source. Since we have to hide
the customers from USA, we need the field country. Let's go and check that.
Over here, then click next. And here we've got
another window to set up the filter
for the country. So as you can see, we have all
the countries here listed, and now we can go and select the countries that should be
included in our datasets, or we can go over here
and click excludes, and we're going to
exclude the USA. So that means we
are filtering out all the customers
with the country equals to USA. Let's
go and click OK. Now we can see over here
a quick information, so the filter is
based on the country, and the details is saying
we are keeping the values, France, Germany and
Italy. So that's it. Let's click OK. Let's
go now and check the data in our worksheets so we're going to switch
back to our view. As you can see, we cannot find
any information about USA. This can affect as well all the worksheets that are connected to
this data source. For example, if you go
over here and create a new worksheet and we
take the countries, track and drop it over here. You can see again here as well. We don't have the USA,
we have the values, France, Germany and Italy. With that, we have protected
this sensitive information. All right, guys, moving on to another use case of
the data source is to reduce the size of
data inside Tableau. This is very critical if you have a bad performance
in Tableau. Then you have to start
thinking about how to reduce the size of data
inside our visualizations. And the first step to reduce
the size of our data, we have to decide which fields we're going to use in
order to filter our data. A very common and
usual field is that. We can reduce the number of
years inside our data source. Let's go and build a view. So I'm just going to go and
create a new worksheet. Let's take the order
dates to the rows and let's take the
profits to the columns. And then let's make it as a part diagram and
show the results. So as you can see, we
have inside of our data, five years of data. So, this field is
really good candidate in order to use the data, and you have to go and
discuss it with your users. So you have to ask,
do we really need five years of data inside
the visualizations? Is it enough to have only, like, last two years
or three years? So let's say that after discussions with
the users, you say, The relevant data for
the visualizations is starting from 2020. So anything before is not relevant anymore for
the visualizations. We would like to have
everything starting from 2020. So in order to do that, we're going to go and build
a data source filter. So let's go back to
our data source page. We're going to go
again over here, so let's go to the edits, and then we're going to
go and choose the field that we're going to build the data source filter on top of it. So go to adds And then
we need the order date. So we have it over here.
Let's go and select it. Okay. And here, since it is
a date to tablec ACA fires, in which format you want
to build your filter, since we are discussing
about the years, so we are interested
in the years. I'm just going to go with the
format years and go next. So now with that,
we get a list of all years inside
our data source. So either you're going
to go and say, Okay, I would like to include
everything starting from 2020 and not select
the old years. Or you're going to
say, You know what? I'm just going to exclude
the last two years, anything before 2020, so
you're going to go with the excludes and with that we
are removing the old years. I prefer this one
over here since, let's say that we get 2023
data inside our data source. You don't have to each time
to go and click on it. So with that we are saying, the data are relevant
starting from 2020. Let's go and hit
ok. And with that you can see inside our
data source filters, we got a new filter based on
the years of order dates. And you can see some details. It says it keeps
2020, 2021, and 2022. So with that we
are filtering now, the data source based of the
order dates and the country. Let's go and hit ok. And
as you can see here, we have now two filters
in the data source. Let's go back to our
view sheet seven, And we can see that we have only the data
starting from 2020. All all data are not presented anymore inside our
visualizations, which is really great way in order to reduce the stress and the size of data that
Tableau has to handle. So that we are reducing
the scope of data, and as well we are going to get great performance
in Tableau. This is how we use the
data source filters in order to reduce the size of our data and as well to hide the
sensitive information. But here, don't forget that
all the worksheets that are connected to this data source can be affected
with these filters. Alright, so now we're
going to learn how to build a context
filter in Tableau. Let's say that we have
the following view. We're going to have
the category from the products and as
well the subcategory, and let's take for the
measure the profits. So let's take it over
here, and as well, let's change the colors, we're going to put it
over here as well. So now in this view, we
have all the categories, furniture, office
supplies, and technology. But the users want
in this view to focus only on the
office supplies. And for this specific view, all the other categories are
unrelevant informations. So they want only to focus on the office supplies by profits. So that means we want to
filter the data by category. In order to do that, we're going to go to the category over here, hold control and put
it on the filters. And then we're
going to get again the same window for filtering. And here you can see
the three values, furniture, office
supplies, and technology. For this view, we want
only the office supplies. So what we're going to
do, we're going to remove the others and leave the
office supply, then hit okay. So as you can
removed everything, and we have only with the one category,
the office supplies. The job is done right, so we have the office
supplies by profits, and we filter the data. The answer is yes,
the task is done, but we are not using
the full power of tau. Sincere, the focus is only
about the office supplies, and we are focusing on
this subset of data, we could go and reduce the whole data sets to only this category. And with that, you
can win a lot of performance in Tableau
because you are focusing only on subsets and all other data is removed
from this visualization. In such a scenario, we can go and use the power
of context filters. Now the question is how to make our filter as a context filter. As you can see now in the
filters, we have our category. It is blue pill, and it
is as well a dimension. This filter type called
dimension filter. In order now to promote
it to the context filter, as we learned before, that we have specific order
of the filters, we have context then dimension. All what we have to do
is to radically cont, and here we have the option
of adding to context. Once you do it,
you will see that our filter now has
the gray pill. The gray pills indicates that this filter is a context filter. Now you might notice
nothing changed over here, we have exactly the same view, but we optimized the background in Tableau where we created a tumberal datasets and it has only the category
of a supplies. It's really small table compared to the whole
data source. All right. So now I want to
show you how tableau process the different
types of filters. As we learned, the order of the filters are
really important. So that means the
context filter can be processed first then
the dimension filter. So the context filter is dominating the behavior
of the dimension filter. All right. So now we're
going to go and add dimension filter in
our visualization. We're going to use the
subcategory in order to do that. So right to click on it and
click over here, show filter. As you can see on
the right side, we have all those values that are included in the
office supplies. But in our original data source, we have way more subcategories as we are seeing
now from this view, and this is exactly
the effect of the context filter on
this dimension filter. So we are seeing only the
values inside this context. Alright, so now
we're going to go and change the definition of the context filter and see the effect on the
dimension filter. So let's go again to
our context filter, right click on it and it filter. Let's bring it here side by
side to our dimension filter. So we have only those values, and we have over here
on the context filter, only the office supplies. If we go now and include
as well the technology, Let's apply and see
that on the right side, the values is going to
change. Let's go there. Now as you can see, in
the dimension filter subcategories on the right side, we have more values than
before because we included in our context in our tumberal
table, the technology data. We can go and change
the values around. Let's have only the furniture,
check the right side, apply and you can see we have
only four subcategories. This, you can see that the
context filter is really dominating all other
filters below it. Understanding the
order of the filters, you can understand how Tableau works with those different
types of filters. So I'm going to bring
the context filter again to the office
supplies and hit. One more thing about
the context filter, as we learned before,
it is flexible. That means we can reduce the size of data only
for one worksheet. That means if you go to
any other worksheets, you will not find here
any context filter. So you can go and decide for each worksheet whether you want to reduce the
size of data or not. Unlike the data source filter, where it can affect
the whole workbook, any worksheet that is
connected to this data source. With the context filter, we
have way more flexibility. Now you might ask, can we use the context filter to hide
sensitive information? Well, the answer is no.
Let me show you why. Let's have a quick example. Let's take the customers again
and we have the country. City, and let's take
as well the profits. So as you can see over here, we don't have the USA data because we have the
filter data source. And now let's say that the data of Germany is now sensitive, and we want to protect it using the context filter. So
let's go and do that. We're going to take the
countries, hold control, and put it on the filters, and we're going to say we
want to exclude Germany. So I'm going to
click over here on the Exclude. And then hit okay. As you can see now in the view, we don't have any
information about Germany, and we go and promote the
country to context filter. So right click on it
and add to context. And now you might say,
okay, everything is fine. We don't have any
information about Germany. So we are secure. Well, naturally, there
is still a way in order to see the German
data in the view. Let me show you how
if you go to the city over here and let's
show it as a filter. On the right side, you will find all the cities from
France and Italy. So there is no cities
from Germany or USA. But here we have an
option on the filter. So if you go to this
small arrow over here, then we can go over here and see all the values
from the database. I'm going to explain all
those options later. Don't worry about it, but
let's go and click over here. Now, as you can
see, the filter is showing data about Germany. We have Berlin, we
have Stuttgart, that means the data are
not really protected. So that means we are hiding the sensitive data
from the view, but still we can see all
the values from the filter. That's why never
use context filter to protect your sensitive
data or confidential data. Because even if we are seeing the data only in the filters, it's still exposing the data and the data is not protected. That means if you
want to protect your data and hide the
sensitive informations, use only data source filters. All right. So now
we're going to move to the next filter in our chain. We have the dimension filter. We have already created some dimension
filter in our view, but now let's go in details and see all the
options that we have. All right. So now let's go to
the filters on the shelves, and you can see that we
have the subcategory. It is a discrete dimension. That's why we have
the color of blue. And now we not to
see all the options radically it and edit filter. And now you already
know this window. Let's just bring it over here to see the effect
directly on the view. So first, we have
here different tabs. The first one is going to be
about the minimal selection, and there is going to
be a dynamic filter. So here we have four taps, general wildcard
condition and top. The first one is going to be the manual selection of the values, and the rest is going to be
like you are defining a rule, and the filter going
to be dynamic. So here, as usual,
since it's discrete, we're going to see the list of all possible values
that we can see, and then you can go and manually select or d select
values from this list. And as you can see,
on the right side, we have clude The default
in Tableau is included. So that means anything that
I'm selecting from this list, it's going to be
included in the view, and anything that
I'm not selecting, it's going to be
excluded from the view. In order to have the
opposite effects, what we can do, we
can click on exclude. And now we're going to
have all the values that are selected
are crossed out. So that means they are
excluded from the view, and everything that
is not selected is going to be
included in the view. So here, it really
depends if you want to exclude only two values
from a long list, then it makes sense to
go and use exclude. So now if you go
and select apply, you can see in the view
the remaining values are application art and binders. Tableau did exclude
all those values. And you're going to
have the same effect. If you deselect the excludes and select only the application
art and benders. And in order to remove
our selections, we can remove
everything from here, so select none,
and we can reapply our selection on the
application art and benders. And as you can see, we're
going to have the same effect. So this is how you work with the manual selection at
the first tab general. But now, let's move to the
next one, and before that, I want to include
everything over here so we don't affect the next one. So let's apply, and then
we go to the wild card. So here we're going to
work with the white card, If you have a dimension
with high cardonality. That means you have a long list of all possible values
in the dimension. And if you go and select
manually everything, it's going to be really painful. So instead of that,
we can go and define the rule if there
is a rule to define. So here we have an input field, we can write something
like for example, A. So here we have four options. The first one is contains, it's gonna means that somewhere in the world,
there is a character A. And then the second option
we have start with. It's gonna means that the word go to start with
the character A. The next one is
exactly the opposite. It's going to end with A. Then the next one we
have exactly matches. That means the word should
contain only the value A. Let's start with the first one. If the word contains
A somewhere, then it's going to stay
in the visualization. Now, as you can
see, all the words words contains A somewhere. The application, we have it here at the start and at the middle, art as well as the starts, and here we have it in
the middle and so on. Let's try out the second one. It's going to say, if
the word starts with A, it's going to stay in the view. So let's just apply.
So as you can see, we have only two words
that starts with A. All right. So now let's
go to the next option. We're going to have ends
with, but instead of A, we're going to have S. A words, ends with S going to
stay in the view. So let's apply that
As you can see all those words ends with
the character S. Well, now, you might ask, is it a
k sensitive? Well, it's not. So if you have a big S, as you can see, it's still Tableuc and select those values. Now let's go to that one. It's going to be exact match. So if you go over
here and select a K, you will not see any data, but if you have exactly labels, Apply. You will get
only one subcategory. It is a labels, but we
don't use it usually. We use contains or
start with sidth. This is how the
white card works. Let's clear everything in
order to have the data. So we have it contains
and it apply. Now, let's move to the next
tap. We have a condition. In the previous materials
with the parameters, we have already worked with
the conditions and top. Here what we're going to
do, we're going to define a rule and table
going to go and check all the values and filter out all the values that are not
meeting this condition. For example, if you
are checking our view, we have some minus
values in the profits, and we don't want to see it. So we'll go and define
a rule that we want to see all the profits that
are higher than zero. So only the positive profits, in order to do that, we're going to select over here by field. Tablo going to show
you immediately the measure that is
using in the view, so we are using the
profit. So is correct. So we're going to go
over here and say the sum of the profit
should be higher than zero. So with us, we have defined the rule, and let's hit apply. So as you can see,
we have just removed the subcategory that does
not fulfill this condition. So that's it, this
is really easy. We're going to move
to the next one, but first let's reset everything, so we again select none, and then we're
going to hit apply. In this tab, we can define if we want to see the top
ten products or five products or the lowest
or the bottom five products. So here, again, we have to
define the rule for table and table going to filter
the data based on our rule. So here we have two options. Either we have the
top subcategories or the bottom subcategories. Let's go by field over here, and then here we
have two options, as I said, top and bottom, and then we're going to
define is a top ten, is a top five or top parameters
as we learned before. And here, we're going
to stay with the same sense we are using the profit, and that's it. Let's hit apply. And now we can see
on the view that Tau did filter our view
based on our rules. So now we have the top
five subcategories. All right, so that's it. This is the different options on how
to filter the dimensions. I'm going to deselect
everything over here, and then we're going
to go to the mineral selection and then hit ok. So instead of pre defining
the rules for the users, we're going to offer
the whole dimension as a quick filter
for the end user. You know, in order to do that, we're going to go
to the dimension, right clickrot and show filter. The user is going
to go to the quick filter on the right side and start selecting the values
that suits their needs. All right, so now, let's
move to the next one. We have the measure filter. As we learned in
the order chain, it is below the
dimension filter. Let's, we can create
a measure filter. All right. So in order to
create a measure filter, we're going to go to
the sum of profits, let's cold control drag and
drop it to the filters, then we're going to
get a new window in order to configure our filter. And since it is
continuous measure, Tableau going to ask us, do you want to filter the
original data, all values? Or do you want to
do the aggregations and then do the filters. So since it's measure, we have the following
aggregations, like sum average
median and so on. Or if you want to do only, filter on the original data, then you're going to go
and select all values. But since we have sum of profit, I would like to go with
the sum aggregation. Let's select that and
then go with next. Now we're going to
get a new window in order to configure our measure, and here we have four options, range of values at least
at most and special. Since our measure is continuous, table can be present
it as a range. It has a start end. So it's not like the dimensions
where we're going to get a list of all values
from the data source. We will get only aggregated data and we can configure
only start and end. In the first option, we can configure the starting point
of the range and as well, the end point of the range. So you can control both of them. In the next one, we can
control only one of them, only the starting point. So at least here we
can specify what is the minimum value that is
allowed in the visualizations. The next one is going to
be exactly the opposite. At most, we can define the
end point of the range. What is the highest value that is allowed in
the visalzations? Again, the range of values, we can specify the
start and the end. At least we can specify only the starting
point and at most, we can specify only the
end point of our range. Then the last one, the special
is about the null values. So here we have three
options, null values. If only you want to see
the null values from this filter, null values. That means you don't want to see any nulls inside our
data or all values, you are allowing both of them. So as a default, we
stay use all values. I'm going to stick
with that, and I would like to configure both of the end and the start
of our continuous measure. So that's as you can
see, it's really easy. Let's go and hit, and with that, you can see we've got a new
filters inside our filters, and it has, of course,
the green color. Alright, so first,
we're going to go to our major filter and show
it as a quick filter. So right click on
it and show filter. And now we can see the
range on the right side, did just make it a little
bit bicker to see the range. So now, as you can see,
we have start and end, but it is not completely
for the whole bar. Here table want
to show you that, we are not showing
all the values. We are showing only the
range of the subsets. So now what can happen if we
take the end to the right, and the end to the left? Nothing can happen on the view, we can have exactly
the same data. But here we can
see in our range, there is different colors. The light part can
indicate that. If you change the values here, nothing can happen in the view. So as you can see, if I
just move it over here, The view will not be filtered. And now, if I start moving the start inside the dark parts, you can see that now we have
now an effect on the view. So the dark color in the
slider is the relevant values, and the light part is
the unrelevant values. All right, guys. So now
we're going to talk about the last type of
filters in Tableau, the table calculation filter. It is the bottom of the chain, and you can see each
type of filters is going to have any effect
on this type. All right. So now let's learn how to build
table calculation filter. And as the name suggests,
it is a calculation, and we're going to
have a whole section on how to create
calculations in Tableau. So now, don't worry
about the details how to create
calculations in Tableau. Just follow me with the
steps now. All right. So now we're going
to go to our measure in the marks radically cont. And then here we have the option of quick table calculations. And then we're going
to have a list of all different calculations that we can do it on the table. And now we will go
with the percent of total. So let's select that. And now we can see a small
icon to the measure. It indicates that this
is a table calculation. So hold control, drag and drop it on the
filters, and release. So here since it's
a continuous field, we have to define it as a range, so let's click ok.
And now we can see in the filters two measures
for the same field. The first one without
triangle icon, it means it is a measure filter. The second one with
the triangle icon, it means it is table
calculation filter. So what we can do with that, we can offer it to the users, so we're going to write it
click on it and show filter. We can see it now as a quick
filter on the right side, and the user can go
and use the filter. So that's all about the
table calculation filter. All right, so with,
we have learned the different types
of filters in tableau and how the order of the filter in the chain
can affect each other's. All right. So now let's
have a quick summary. We can start with the
extract filter at the top. We can use it only on
the extra connections, and we cannot find it in
the tableau public version. Don't worry about it. It is very similar to the data
source filter. And then next, we're going to have the data source filter. In order to create it, we
go to the data source page. And here in our example, we created two data source filters. The first one is to hide the sensitive informations
of the country USA and the second one to reduce the overall
size of datasets. And don't forget that
the data source filter can affect the whole workbook, All worksheets that are
connected to this data source. Then the next filters, we can create them all in
the worksheet page. So let's go over there. So here you can see very nicely how the different types of filters are sorted in the
filter shelves. The first one, we have the
context filter, the gray pill. Context filter can
create a subset of data or a tembral table
only for this view. So it is something locally
only for this view. But don't forget, do not use context filter in order to hide or protect
sensitive information. Since there is possibility to show the values in the filters. The next three filters,
we usually offer it to the end users in order to slice and dice the
visualizations, so the users could
use it to specify a subset of data to
make focus analysis. Next, we have the dimension
filter like the subcategory. After that, we have
the measure filter and the last one at the chain, we have the table
calculation filter. And since those
different types of filters has a logical order, it would be nice as well to have this order on the quick
filters on the right side. So, it makes sense to have the dimension
filter at the top. Then we're going to take the
measure filter as a next, and the last one going to be
the table clculation filter. Alright, so that's all. It could be confusing
at the start. But now, after you
understand how tableau works and the logical
order of the filters, everything then go to make
sense in the visualizations. Alright, so that we
have learned how to create different types
of filters in Tableau. And next, we will
learn how to apply filters to multiple
worksheets in Tableau.
70. Customize Filters: All right. So now we're going
to talk about how to apply the same filters in
different worksheets, because if you are
building different views, you end up having exactly the
same filters in each view. And it's going to be time
consuming if you are going in each worksheets and adding
exactly the same filters. So instead of that, we can share the same filters to be applied
in different worksheets. And I to we have four different options
in order to do that. And we can find those
options in the filters. So it doesn't matter
which one you can pick. Let's go with the
context filter, for example, tic connects, and here we have the option off. Apply to worksheets, and here you can see
the four options. As a default table and leave
it as only this worksheet. This means locally
only for this view. And here we can
see other options like all using
related data sources, all using this data source,
and selected worksheets. Before we try those
options, first, let's understand those
four options. All right. So now we're going to have
a very simple example in order to understand
how to apply filters. So we have two data sources, DS one and DS two, and we have different
worksheets that are connected to
those data sources. So we have the sheet one connected only to
the data source one, and the sheet two
connected to both DS one and DS two
using data blending. And the sheet three only
connected to D is two. Now, let's say that we
are at the sheet one, and there we create a filter. So now let's learn how to apply this filter in different
worksheets using those mists. Alright, the first option we
have only the worksheets. That's means this filter
is going to be only locally available
for the sheet one. We will not find it in the
S two or in the S three, and this option is as well
a default in Tableau. So each time you are creating
a new filter in tableau, It's going to be
using this option. Only this worksheet can be only available in the worksheet
where we have created. The next option we
have in Tableau, all using this data source. So for example, the sheet
one is using the DS one. That means the filter
can be applied in all worksheets that are connected
to the data source one. So in this example, we have the sheet
one because it's connected to DS one
and as well the S two, which is connected as well
to the data source one. But the sheet three is not connected to the
data source one. It's only connected to the two. So that means this filter will not be found the sheet three. So that means we are
sharing now the filter in all worksheets that are using the same data source. Let's
move to the next one. We have all using
related data sources. If you are going to
use this option, you're going to find your filter almost in all worksheets
in your workbook. So we're going to find this
filter in the sheet one, we're going to find
it in the sheet two, and as well in the sheet three. This means if you are
using this option, we are automatically spreading our filter in almost
all worksheets. Let's go to the
last one and it's interesting one,
selected worksheets. This means we can
go and manually selecting which worksheets
can include my filter. For example, I could say, I want to see my filter
in the sheet one, and as well in the Set
three without any rule. As you can see, we have here more control where our
filter can be applied. In the last two, all using this data source or all
using related data source, there is a rule and
Tableau can go and automatically spreads our
filters in the worksheets. In my projects, I tend to use selected worksheets more
often than the other ones because I would like
to have control where my filters should be appear
in which worksheets. So that's all about the
concept of those four options. Now let's go back to Tableau
and try those options. All right, so pack
to our filters, we're going to go
to the category. We're going to stay with
the context filter tickets and go to the applied
to the worksheets. And you can see the
selected option here is only the worksheets. This one is a defaults. So with that, it means this context filter
is going to be found only in the reports. If we go to the other
reports, we will not find it. So in order to change that, we're going to go again to the context filter
iclic let's try now, all using this data
source. Let's click on it. Now, if you take a
look at our filter, we can find a small icon that
indicates this filter is used in different worksheets that are using the
same data source. In this view, we are using
the big data source. As you can see, we have it
as primary data source. An worksheet any view is
using this data source, this filter can
be applied on it. Let's go to the different
views over here. We're going to
switch to this one. You can see we have the context filter and
as well, the first one. Since both of them are using the big data source
and the filter going to be applied
automatically on it. But now let's create
a new view where we are using different
data source. Let's switch to the
small data source, and let's take anything. Let's take the first name. And as you can see,
the filter can stay empty because the
big data source is not used in this view. But now let's go and use the big data source and see
what Tableau going to do. Let's remove the first name, switch back to the
big data source and take as well, anything. Let's take the last name. A as I'm dropping in
this view, this data, you can see Table
automatically going to bring me the context filter because it must be used in all worksheets that is
using the big data source. Which is really
useful if we have different worksheets
using the same, for example, context filter. So instead of creating the same filter over
and over again, we can create it in one
worksheet and then spread it to all sheets that are
using the same data source. Okay, so that's all
for this option. Let's go back to our context filter and try something else. Let's switch to apply to all
using related data sources. Let's try this one,
so click on that. And now you can
see that we've got a new icon from
Tableau indicates that this filter going
to be applied to all work sheets with
related data source. So now let's go and
check what can happen to the other sheets
using this option. We're going to find now this
filter almost everywhere. In the first sheet, you can see we are using the
same data source. It's going to be
like this. We have the context filter
applied to the view. In the second sheet,
we're going to see again the same context because we are using the same data source. Let's go now and create
a new sheet where we're going to use the
small data source. We are using different
data source. So click on that,
and let's take, for example, the first
name to the view. Now as we can see
in the filters, we have our context filter. Even though that we are
using different data source, we are not using the
big data source. But Tableau brings this filter here because we are
using this option. But as you can see, it's red. What is going on over
here on the filter? If you mouse over it, it says, data sources that contain
logical tables cannot be used as a secondric data
source for data blending. Since these filters comes from other data source from
the big data source, Tableau has to make
a data blending between them in
order to connect it. And it will not
work if you have in the secondary data source
logical data model. As you know, in our
big data source, if you switch to this page over here, We have a data model. We have a logical model where we connected the customers
with the orders and so on. Tableau don't like it as a secondary data source to has a data model, so
it will not work. But if you have only one
table or if you have multiple joints at the physical layer,
this can be working. So if you go back again, it's going to stay
red as long as the secondary data source
has a logical data model. But if you have one table,
everything gonna be fine, you will not get this
error. All right. So with this option,
as you can see, whether you are using
the same data source or different data source, our filter going to appear. Now let's go and check
the last option. Let's go back to
our view over here. Go to the context
filter to click on it, apply to worksheets,
and now we're going to go to the
selected worksheets. Let's click on that. All right. So now we have a
very simple table where we have a list of all worksheets and as well descriptions about the data
sources and some details. So now we can go
and manually select which worksheets can
include our filter. So as you can see, we have, everything is
selected because we use the option of
related data sources. I don't want that,
so I'm going to deselect everything and
start from the scratch. So I would like my filter
to be the first one, the second one and
this one is like grade out because we are currently
in this worksheets. It's way selected,
and the other ones, I'm going to leave
it de selected. That's all. Let's go and select. Now if you check
the filter again, we can find a new icon that
indicates this filter now is used in different worksheets that we manually selected. Let's visit the first report. We can find our context filter, the second one, the same. The third one anyway
because we have here created this
context filter. But now if you go to the
different worksheets, you will not find
this context filter. As I said earlier, I use this
option a lot in my projects to have control in which worksheets I want
to see my filters. So, generally speaking,
those options are really great way to
share your filters in different worksheets and
solve the problem of having creating the same filters
over and over again. All right, guys. So now
we're going to talk about how to customize
our quick filters. But first, let's understand
what are quick filters. Any filter that
you are presenting in the view in the
visualizations for the end user to interact with the view considered
to be a quick filters. For example, all
those filters on the right sides in the
view are quick filters. We have the subcategory, the sum of the profits. Those stuff are quick filters. And the users can go and
start selecting the values inside those quick filters to interact with
the visualizations. Now in order to customize
those quick filters, we're going to go over here in this small arrow
and click on it. And here we will
get a long list of many options on how to
customize our quick filter, and they are as well
slit it into groups. The first group is about how to customize
the quick filter. The next set of options is
about the filter modes. Then we have here and
many options about which values can be presented
in the quick filter. So we have Only relevant values, all values in context, all values in database. Now we're going to go and focus on these groups of options. But first, we have to understand the concepts behind them. All right, as we learned before, we have a data source
and worksheet. Inside the worksheet, we have a context filter
and visualizations. The data going to be sent from the data source to
the context filter, and then the visualization
going to be quaring the context data and the result going to be sent
back to the visualization. Now, inside the view, we can create a filter. Now the question is,
which data going to be presented
inside this filter, and here we have many options. The first one is We're going to get the values
from the database, all values in database. So with that, the values can be queried directly from
the data source. With that, we are skipping
anything inside the worksheet. So we are skipping the data in the context filter and
as we individualization. So does this matter what we
are doing in the worksheets? The values can come directly
from the data source. All right. This is
for the first option. When we say database, it means the data
source informations. The next option we have
all values in the context. This time, the values and
the filter are going to come directly from
the context filter. As we learned before,
the context filter can generate a tumbral
view or timbral data. Inside the worksheets. Here, the values can come directly from the
context filter, and anything that is
going to be done inside the view will be not considered in the
values in the filter. With that, we are skipping
the visualizations level. We are getting the
data directly from the context filter and
not from the data source. All right. That's
all for this option. The next one going to be
only relevant values. The values for the
filter now can come directly from the view
from the visualizations. That means, Any interaction that we are doing in the view, any filtering can affect directly the values that are
presented in our filter. So as you can see, those
options are really helpful, and Tableau gives us
now the control in which data can be presented
in our quick filters. Because as you can
see in Tableau, we have different layers
and different stages, and the subsets and the size of the data can be different
from one to another. So normally the
size of the data in the data source is way bigger
than the context filter. With that, you are defining
and you are controlling, which data are going to be presented in my
filter. All right. Now back to overview. Now in order to practice those options, what I'm going to
do, we're going to bring new quick filters to view. Let's take the
country, click on it, show a filter, and we're going
to get as well the city. Let's go over there, and we can change the order over here, so we're going to bring first the country then the city
and the subcategory. I'm going to remove those
measures from the filters, let's just remove them. And with that, we
have those filters. So now we're going to go and
check which options do we have inside the quick filter
city, go to the arrow. And as you can see,
the current value is, all values in the hierarchy. And that's because the city is part of the
location hierarchy. But now we're going
to go and change it to only relevant values. Let's go and do that.
Now if you take a look to the values
inside the cities, we can find almost all the
values from the data source. So nothing changed yet. But as we start now
interacting with our views, the values in the city start
reacting to our selections. For example, let's go
to the country over here and start removing
some countries. So we're going to deselect
France, Germany, USA. As you can see,
the values inside the city is reacting
to our selections. So it's like those
two quick filters are connected to each other. And this is exactly
what the option of Only relevant values does
to our quick filter. This is exactly the
purpose of this option. Only relevant values. Anything that we are
doing in the view, the values inside this
quick filter can be refreshed and updated with
the current selection. Now, of course, if we go and deselect Italy, what's
going to happen? The filter city going to be completely empty like our view, it is reacting to
our interaction. Now we're going to go and
change it to another option. Let's go over here on the arrow. Now we're going to change
it exactly to the opposite, show all values in the database. Let's click that. Now
what's going to happen, Tau is going to go to the
data source and bring all the information about the city and put
it on the filter. Regardless what we have
selected in the view or whether we have a context filter and so on. Now we have a list all values in the city that is available in our data source, and it will not be refreshed or updated if we are clicking around or interacting
with our view. For example, if I'm adding any other cities or I'm
changing any other filters, for example, I'm removing
all the subcategories. You can see it's static. Nothing going to be changed in the city because let's
go to the data source, get all the data from there. That's it. This
is really nice in order to optimize the
performance tableau and reduce the resources that are used in those quick filters. Now let's go and
check something else. We're going to go and select the all values in the
context. Let's click on that. That means the values inside the cities is responding
only to the context filter. Since our context filter
is based on the category, we have to bring it to the view in order to change the values. Let's go to the category, radicli on it and show filter. Now we have our context
filter on the right side. All other filters are
dimensional filters. Now, the values
from the city can interact only with the category, not with the country
and the subcategory. Now let's try that. For example, if I go to the country, I remove all the values. You can see the
values in the view did disappear because we
are not selecting any data, but the values in the
city still are there. So let's go and select everything the same
for the subcategory. If I remove everything
from the subcategory, you see the city
is not reacting. So it's still static because it comes from
the context filter. Now let's bring everything back. But now, if I go to the
category to our context filter, and let's remove
office supplies. Once I remove it,
you can see now the city is reacting
to our view, so we don't have any
values because we are not selecting anything
from the category. So here you can see there is connection only to
the context filter, but not to the other filter. And this is exactly what
can happen if you make the city the bending to the
context filter. All right. So with that, we have learned the three main
options in order to control which value
is going to be presented in our quick filters. But as we started with the city, we saw that there is
another option called, all values in the hierarchy. It was the default one. Let's go and select dots. Once we do it, what
we are doing now, we are connecting the dimensions that are in the same hierarchy. If you check our data bin, we have hierarchy that
we created previously. It is the location hierarchy, and inside it, we
have four dimensions. We have the continent,
country, city postal code. Now, all those four dimensions, if we use it as quick filter, they're going to be
connected to each other's. Let's
check the example. Now we have the city
and the country in the same hierarchy and they
are connected to each other. In the category, it's
our context filter, it's empty, but still the
city is showing values. That means the city now
is disconnected from the context filter or from any other filter that is
not in the same hierarchy. If I go and select any values
in the category, you see Nothing is changing in the city, even if I remove everything. But the city can react once and start deselecting or selecting values from the same hierarchy. So if I remove France, Germany, USA, you can see now we have
only the cities from Italy. So they are connected
to each others. But here we have something
special about the hierarchies. Since as we learned, we
have dimensions levels, so the country is higher
level than the city. So the lower level dimensions will not affect the
higher level dimensions. Only a higher level dimension
can affect the lower one. What I mean with that,
let's go to the country, select all the values. As you can see now, we have here in the cities all the values. But if I start deselecting
any values from here, you can see the country is not reacting for it because
it's higher dimension. Even if I go and
deselect everything, I still have the four countries. That means since the city is lower level than the country, it will not affect the country. But if we bring now a higher
level than the country, which is the continent, let's see what's
going to happen. We're going to go
to the continent radically connect
and show filter. I'm just going to
bring it over here. Now as I start the selecting stuff in the
continent, as you can see, the values in the country are affected with my selection
because of the hierarchy, the continent is higher
level than the country. With that, as you can see, This is what can happen if we have all values
in the hierarchy, you have to pay attention to the levels of the dimensions, and those dimensions is going to be connected
to each other. With that, we have covered all those options
that we could use in order to control the values
inside our quick filters. Okay, now we're going to talk about different group of options that we could use in order to customize our quick filters. We have the filter modes. So we have single value list, single value dropdown, slider, custom list, and so on. In order to learn that, we're going to have
the following example. What we're going to
do, we're going to go and clean up our filters. I'm going to remove
the country, the city, and the continent, and we're going to have the
subcategory and category. We're going to bring as well the product name as a filter. So right click on it, and
let's go with Show filter. And now we have the
quick filters on the right side. We
have the product name. I'm just going to
bring it over here, so it looked like the hierarchy. So it started with the category, subcategory and product name. Let's show all the
values over here. And for the product name, I'm going to change the modes to a drop down or
a list. All right. So now let's start with
the first quick filter, the category and
try those modes. We're going to go to the arrow, and as you can see as a default, it is multiple values list. So as you can see,
we have the list again here as a single value. So we have the same option. Once a single value and
other is as multiple value, the same goes for drop down. We have dropped
down, single value, and drop down as
multiple values. So let's try those stuff out. We're going to go to
the single value list. And as you can see now, the visual of the filter, the change to radiotals. And now, as I'm selecting those values inside
the category, As you can see, we can
select only one value. As the name says, it's
only single value list. So that means we are making
some kind of restrictions. Only one value is allowed. But if you want to have
multiple values as a list, we're going to go and change it back to multiple values list. And here, of course,
you can choose different values and
different categories without any restrictions. So this is about the modo list, single value or drop down list. Okay, so now let's go
and try another modes. We go to take this time
single value drop down. Let's switch to this
one, and as you can see, with the drop down, you will not find all the values
immediately in the view. You have to click on the
drop down menu over here, and then you can
select the values. Since it's single value again, here we can select
only one value. We cannot select
multiple values. I can select one
category at a time. And as you can see,
It is working. Let's switch now to
multiple values drop down. We're going to have again
here the same thing, we have the drop down menu. But inside the menu, we can select multiple values. So that's it for the drop down. All right. So now let's move
to another filter mode. We have the single value slider. Let's select that,
and with that, you can have a slider. We can move it to left and right to have
different values. But it is not really interesting for a dimension
with string values. We can use it for
numeric or dates because this is not really nice to have a
slider for values. It's better to use the drop down or a list for string values. So that is for the sliders. I really use it in the projects. So now let's move
on to another one. We have the custom list, but I will not use
it in the category. Let's go for the product
name and use a custom list. Click on that. Now
as you can see, now the product name
don't have any values. We cannot see anything. We
have only a search box. So now we can
search for a value. Like for example,
let's search for Apple. And then hit Enter. You can see now a list of all products that
contains the name Apple. It's like searching
inside this field. If you can go over
here and start selecting the values that you
want to be in the filter. As I'm clicking over
here on those boxes, I'm going to see a list of all
values that I'm selecting. With that, we have created our
list using the search box. But here we are not seeing any data because of the category, so I'm just going
to switch it back from the slider to
multiple values list. I'm going to select
everything, and now we can see that we are selecting only the subcategory phones because we selected
over here the Apple. So with this type of list, the customers can go and
select their own list. So we can go and
add more stuff like Samsung over here. Let's search. I'm going to add those
products as well to the list, and with that, we are abanding or adding more
products to the list. If you want to clear everything, we can go over here
and clear the list. This is really nice way to
search for specific value, especially if you have a lot of values inside
the product name. Now let's go and
try the last option that we have in
the filter modes. We have the wildcards. Let's go and select that.
And now we can see that we have again a search box
where we can enter a value. But now we are searching for specific pattern in our data. In order to show
you how this works, we're going to get the product
name as well in our view. And now we're going
to go and search for specific pattern. For example, I
want to search for all product that starts
with the character A. In order to do that, we're
going to go over here. Inter A, after the A, it doesn't matter
which character going to comes after that. That's why we're going to
use the character star. Let's go with that
and then hit Enter. We can see at the
product name Tu did filter the data depending
on our pattern, our search pattern, so
we can see over here all the products that starts
with the character A. Let's go and have
another example. Let's say we want
to start with APP. Then doesn't matter
which character going to follow up, we're
going to have the star. Let's hit enter. We have here only four products that
follow this pattern, and it is the word of Apple. Or we can search for
the last characters. So let's say that
it should end with S. So instead of having
the start at the end, we're going to have
the star at the start. So we have star, then S,
then let's hit enter. All those products end
with the S character. So if I just like
move it over here, Some of them are
really long names. So you can see,
for example, here, book cases, it ends with S, and all those products
ends with the character S. This is how this mode
works, the wild card. We can use it in order to search for specific pattern
in our data. Again, this is really
helpful if we have a dimension with
a lot of values, we can use this search box to find the specific
data that we need. With that, we have covered all different modes that we have in this category in order to
customize our quick filters. All right. So now let's
move to another set of options to customize
our quick filters. In each quick filters, we have a lot of informations. For example, we have this
extra bottom called A, or we have a title, or we can
search for specific value, or we can reset stuff and so on. So we can customize all those
informations in Tableau. Let's go over here again, and then we can go to the customize and now we
can see all those options. So show all values. This is exactly the first
value that we can select. So if you deactivate it, we're going to have
only the values from the dimension
from the filter. But sometimes it's really nice, for example, here
in the subcategory. If you are like, you want to
deselect a lot of values. So you just can go
and deselect the all. With that, you are removing
all the selections, and then you select
specific stuff. So with that, we can select
the values really fast. Let's move to the next one. We have this small search icon. So if you go over here, you can search, for
example, for arts. Hit enter, then you're going to get the value inside
this dimension. And if you want to hide it and tur it for the users
for some reason, you can go over here
on the customize. And then deactivated. Once you deactivated, you can see the small
icon disappeared. But I think it doesn't harm to have it in each quick filter. Let's activate it again. As you can see with
those options, we are customizing
our quick filter. Let's check another option. Let's go to customize. Here it's really interesting to have the show apply button. Let's select that.
Once you do it, you're going to get two new
button, cancel and apply. As I'm selecting
now in my filter, As you can see, nothing
is changing on the view. So that means it will
not send any query to the data source or the context
filter to get the data. So nothing is changing as long as I'm not clicking
here on the apply. So once I click on apply, the filter going to send a query to the tableau and table
can answer with data. This is really nice if you are going to select a lot of values. So each time you are
selecting a value, Tableau going to do
the calculations, maybe it makes sense. First, let me select everything and then
do the calculations. And if you don't activate this option like
in the category, each time we are selecting and the selecting
from the filter, Tableau has to react
to our interaction. With that, we are
generating a lot of calculations in Tableau as
we are clicking around. But over here, as we are
selecting the values, nothing is changed until we decide to say,
okay, I'm done. Now go and do the calculations. This is again, really
nice way to reduce the unnecessary calculations
in Tableau. All right. So what else we can customize in our quick filters is the title, so we can decide whether you
want to show a title or not, or you can either the
title name itself. So if you go over here, you
say, instead of subcategory, I'm going to have minus between them and make everything
small for some reason. So let's click. As
you can see now, the title did change, but the dataset
name didn't change. So if you go to the subcategory, the name stays as it is, we just renamed the filter name. Alright, so with us,
we have covered now almost everything on how to customize our quick
filters in Tableau. Alright, so that we have
learned how to apply filters to multiple
worksheets in Tableau. And next, I'm going
to share with you my top tips and tricks that I usually use
in my projects once I start using
filters in Tableau.
71. 10x Filter Tips & Tricks: Now, I'm going to show
you the best practices of tableau filters that I usually follow in my
projects. Let's go. The first step that
I have for you is to utilize those filters. So the extract filter
data source filter and the context filter. I saw a lot of projects where developers really
forget about them or ignore them because they are not really important
indivisualizations, but they are very important for optimizing the
performance in Tableau. My advice here is for
you to always have a discussion with
the end users about promoting one of those
filters that you have in visualizations to be
first an extract filter. If it cannot be an
extract filter, then the data source filter, and the last option to
optimize the performance is to bring it as
a context filter. Because sometimes in
the visualizations, you really don't
need all the data. You don't need, for example, ten years of data
in visualizations. So try to discuss it
with the users to say, maybe let's bring only two years of data to the visualizations, and then you can utilize an extract filter or data
source filter on your workbook, which can has a great impact on the performance
overall in tableau. So don't forget or ignore
those three filters. The second filter tip
that I have for you is about optimizing the
performance tableau, which is avoid using only relevant values
in your quick filters. So for example, if we go to
the subcategory over here, we can see that it is currently set to only relevant values. If you use this option for
all your quick filters, what can happen, the
performance tableau gonna be really pads and everything
going to be really slow. So we can go and switch
it to something else like all values in
database or in context. So we can go and switch that. And with that, you're
going to reduce the stress on the memory and
the resources in Tableau. But let's understand
why. All right. So now let's understand
what can happen in Tableau. If you're using your filters all values in database or
in context. It's the same. So once the viewers or the
users start the reports, if you're going to
send only one query to the data source and
the data source going to answer with
the results back. So that means we're
going to have only one initial query as
the user starts the view. But in the other hand, if you're using only relevant
values, what can happen? The view gonna keep sending
queries after query to the data source always to get an update and
refresh in the view. So that's means the view
going to keep sending multiple queries for
each user interactions, which can really impact the
performance in tableau. Because each time the user is clicking something or
interacting with the view, the view going to keep
sending queries to the data source to get an
update about the interaction, which go to use a lot
of resources and memory in Tableau and going to
slow everything down. Because each time the user is clicking something in the
view or and interacting, the view going to keep sending queries to the data source, which consumes a lot of memory and resources
from Tableau, and it's going to
slow everything down. Be careful with
your quick filters. If you having everything
on only relevant values, things might be slow. If the users are suffering from bad performance in Tableau, maybe think about switching
all those filters to all values in context
or in the database. I have another filter tip about optimizing the
performance in Tableau, which is avoid using dimensions with high
cardinality as a quick filters. Those dimensions might impact
the performance in Tableau. But first, let's understand
what is cardinality. Cardinality is the number of distinct values in the field. For example, in our database,
we have the customer ID. We have around 800 customer ID, and we have a lot
of products names. So those two fields
considered to be high cardinality dimensions. In the other hand, we
have another dimensions, for example, the category. We have only three
values or the countries. In our database, we have
only four countries, and the subcategory as well, we have only 17 subcategories. Those dimensions
considered to be a low cderalty if
you are using them, the performance is
going to be okay. But if you start using those dimensions
with high cradlity, the performance might be pads. The best practice here is to avoid using high cardinality. All right. So back to our
quick filters in our view. As you can see the category
and the subcategory, there are dimensions
with low cadlity. So it's fine to leave
it at the view, but the product name,
it has a lot of values. It is dimensions
with high cadlity and it's really worth to discuss it with
the users whether they really need such
a filter in the view. And if you find out
no one needs it, just remove it
from the view just to have a good
performance at Tau. Now, let's move to the
next filter tip is that, let's say that the users
really want to see the product name or
the customer ID, any dimension with high
cardinality in the view. So here the tip is to
change the filter modes. So instead of having a
drop down list or a list, we can use a wild match for dimensions with
high cardinality. So why having a list
of all the products or the customers in the view is bad in Tableau or bad
for the performance. Well, Each time
Tableau has to go to the data source or
to the database and prepare a distinct list of all the customers or all the products to be
presented in the view. So instead of having a list, we could go and change
it to Wildcard match. And as you can see, Tableau
is not preparing anything, so we don't have any values
to be presented in the view. Only if the customers start interacting with
the quick filter, then after that, Tableau
is going to go to the database and brings
the relevant values. And with that, we are
avoiding using a lot of resources and unnecessary
calculations in Tableau. So if you have a dimensions
with high cardinality, either avoid using it or
if you want to use it, just use the Wildcard match. All right, so let's move to
the next place practice in Tableau is as well about optimizing the
performance in Tableau, which is start using the apply Patum in
your quick filters. Because if you don't use it, let me show you what can happen. Each time I'm still
selecting something, it is like a query sent
to the data source. So this is one query, second query, query,
fourth query, and so on. So each time I'm
clicking on my filters, there will be generated
a lot of queries to the data source which is
consuming a lot of performance. So instead of having
such a filter, we can customize and
add the apply buttom. So as we learned before,
we can go over here, then customize and
show apply buttom. So now, as I'm clicking on
those values in the filter, No query is generated
to the data source. So we are not using any
resources in Tableau. And once I'm done
selecting what I need, then I'm going to hit OK
or apply what can happen? One query can send to the data source to bring
the result to the view. So with that, we are
reducing the number of queries that our visualizations
is generating tableau, which is really great
for the performance. So my recommendation here, if you have a filter
like the subcategory, or a dimension with
high cardinality where you are using a list, use aplibom because the users will not select only one value, they usually select
multiple values, and then at the end,
they can apply. But a filter like the category, we have only three values, it doesn't worth to
use apply bottom. It's only three, so
the user is going to maximum generate
three queries. So it's fine to not use a blipom with the dimensions with
really low cardinality. With the high cardinality or medium cdalty like
a subcategory, go and use a bliptom. All right. The next filter tip
that we have is as well about the
performance in Tableau, which is avoid using exclude and always use
include if it is possible. For example, if we go
to the subcategory, we have here the option of
using include or exclude. If you are using exclude values, those queries that are
going to be generated in Tableau are more
complex than include. More complex means
more resources and might slow down the report
or the view in Tableau. Avoid using exclude
when it's possible. I'm going to switch
it back to include, which has better performance. All right, so let's
move to the next one, and I promise you, this is the last one
about the performance, which is minimize the number of quick filters in your view. Those quick filters
is going to take not only the space in the view, but also going to generate
a lot of queries, a lot of stress going to bring the whole performance
in Tableau down. So try to avoid using
a lot of quick filters and discuss with the users each time they need new filters, whether it's really
necessary to put it in the view because I saw a lot of projects that the users always wants
a lot of filters. So try to discuss them and not always bringing new quick
filter to the table because you're going
to end up having really bad performance
in the view and no one's going to be happy having bad response time
indivisualizations. Try to minimize the number
of quick filters in table, so that everyone is happy. So now let's bring more
filters to our view. We're going to go, for example, I pick the order date. I'm going to show
it as a filter. Let's take the
location informations, the country, and as
well, maybe the city. And now we have to start
sorting those informations. I usually start in my projects
with the first filter is the date or the time aspect that we
have in the visualization. And here we have
only the order date. So we're going to drag
and drop it on the top because usually the users
can start thinking, which date, which year I want to see in my visualizations. So they're going to
focus always first, On the time and
the date aspects. After that, we have two
kinds of informations or two hierarchies in
the quick filters, we have here the
location informations, we have the city
and the country. Then here below, we have
the informations about the product and as well
they are hierarchy. Here we have to not mix them
together. Separate them. First, start with the topic, for example, the location. First, we're going
to talk about the city and the country, and then we're
going to talk about the product informations. And here follow as well the logical order
in our hierarchy. Our hierarchy
starts, for example, with the country as a
higher level then the city. Start always with
the higher level, then move down to
the lower level. For example, here, we should
bring the country in top, and then the city
should be below it. If we take, for example,
the postal code, let's have it as
well in the filter, the postal code should
be below the city. As you can see in
the quick filter, we are rebuilding
the logical order of the levels in the hierarchy. The same goes for the product, we have first the category, the subcategory, then
the product name. Here, everything is fine. So with this add, the user
start filtering the data, they start from top to down, so there's ological order of the field, which
really makes sense. All right, so let's move
to the next filter tip that we have to not use all values in dimensions
with very low cardinality. What I mean with that, for example, let's
check the country. The country has
only four values, and really it makes
no sense to use all because it's only three
values or four values, and the users can go and select those values without now selecting all or
deselecting all. So these dimensions is
really low cardinality, and we can go and
remove this option. So let's go to the
customized and remove it. With that, we have more
space to show to the users, and this option usually takes
a lot of space. All right. Let's move to the next one to the city and let's
check the values. As you can see, we
have a lot of values, and here it makes sense
to leave it as it is. We're going to leave the values, the postal code as well. It's like relative high cdonalty
we're going to leave it. The category here, we
have only three values. It's really makes no
sense to use the values. So I'm going to go and
remove it as well. From here and with that
we have now more space. We didn't waste space for that. The subcategory here, let's make it bigger
a little bit and see. You can see we have
a lot of values, and it makes sense to select all subcategories or de select. I'm going to
leave it for that. That means we just change that for the category
and the country, which is really dimensions
with very low cdalty. All right. So now
we're going to move to the final filter tip that I have for you that I
usually use in my projects, which is as well
about the design as the locum feeling in Tableau. So here we're going to use the suitable filter modes
in the quick filters. Let's see what I mean with that. First, we're going to
start with the order dates or with the date that we
have usually in our view. I usually tend to use here like a continuous field instead of
a list of distinct values. What I mean with that, I usually go over here on the
year of order date, write it click on it, and
convert it to continuous. With that, we can have a
range between two values, which can have as well, less space in tableau. Let's go and switch it. Now as you might already
notice, the order date, the quick filter did
disappear because we changed the role from
discrete to continuous. Let's go and show it again. And as you can see, now, we have the quick filter very minimum and not
taking a lot of space. So this is really nice
as a start to have a range between two values for the dates. Let's
move to the next one. We have the country.
So the country is dimensions with
very low cardinality, and here I tend always to use a list with multiple values. So everything is correct,
let's check that. So it is multiple
values, a list. So I'm going to
leave it as it is. The next one, we have the city. Here we have a lot of values. And here we can only see like three values from
the whole filter. Doesn't make sense to have
it as multiple value list. Instead of that, I
was going to say this is dimension with
medium cardinality. We're going to always tend
to use a drop down for that. So I always keep
this single value. It's like restriction
that has no meaning. So we're going to go with the
multiple value drop down. And with that as you can see, we have a minimum space. We have only one value
that we can see. So if the users want
to select the cities, so the user is going
to go and select the values that they
need and then closes. So it's really minimum and
don't take a lot of space. The next one, we have
the postal code. As well here, we have
the same situation. Dimension with a
medium catality. We have, like, a lot of values. So we will not
leave it as a list. We're going to have it
as a drop down menu. So as you can see,
the size compared to the city is really big
individualization. So we're going to go as well
over here and change it to, multiple values drop down. The next one is the category. It's exactly like the country. Only three values.
Very low cdonalty. We're going to
leave it as it is. And I think for the subcategory,
you already know that. It has medium cardinality, we're going to go over here
and make it a drop down. So now we're going to
move to the last one. We already talked about it. The product name is huge
and has a lot of values. The best practices here is to use a wildcard match
for this value. And for example, let's
take another one. Let's take the first names. So I'm going to show
the filter over here. And we're going to
bring it just down the last one beneath
the product name, as well is a huge filter. It has a lot of values, and here is well dimension
with high cad reality. So we're going to go
and switch the modes to wildcard match exactly
like the product name. So as you can see,
a lot of filters, which is urally good
for the performance, but we saved a lot of spaces as we change
the filter modes. With that, we have really nice quick filters on the right side, not taking a lot of spaces. With that, I covered
all the tips and tricks or best
practices that I usually use in Tableau projects if I'm using filters. All right. With that, you know, the best
practices that I usually follow once I start creating
filters in Tableau. Next, we will learn
the different ways on how to sort our
data in tableau.
72. Sorting Data: All right. Now we're
going to learn how to sort the data
inside Tableau. A lot of people think that sorting data in Tableau
is not working correctly, which is not really right. So we're going to remove now
this confusion and we can understand how sorting in
Tableau works. So, let's go. Okay, now let's understand what is sorting. It's very simple. So sorting is arranging your
data in a specific order, and here we have two options. Either we can as sort it
using the ascending order. Here we can arrange your
data in increasing order. That means, we're going
to start with the lowest, and as we are moving down, we're going to have
the highest value. For example, let's
take the order ID. We can sort it using
the ascending order. Then the values
can be like this, one, two, three, four, five, six, so the values are increasing as we are going down. Or if we have, for
example, the first name, we have characters, so it's going to be sorted from A to Z. So for example, we
have here, Andy, Dwight and end up with PAM. The second option is to sort your data using the
descending order. Here we go to arrange your
data in decreasing order. So that means, we always
start with the largest value. And as we are moving down, we're going to go to
the lowest value. For example, again,
here the order ID, so we start with
the highest value. In this example, it's
going to be the six five, four, as I'm moving down, I'm going to get
the lowest value. The same for the first name. It's going to be the opposite
of alphabitical order. So we're going to start
with Pam Michael James until we end up with Andy. You can see, it's very simple. We have only two options, either sorting the data using the ascending order or
the descending order. Now let's go in Tableau and understand how
we can do that. All right. So now let's create another view from the scratch. We're going to stay with
the big data source. Let's take as usual, the sub category in the rows, and we're going to take
as a measure the sales. So let's put it in the columns. Let's show the numbers, so I'm going to take
it to the labels and as well to the colors. Then we're going
to have as well in the columns, the country. Let's go to the customers
inside the hierarchy location. We have our country, and
let's put it over here. Okay, so this is
our view for now. There is two ways on
how to sort data in Tau, either directly
indivisualzations, and we call it quick sort or we can do it as we are building
the view as developers. So we're going to
start the first one where we can learn how to do sorting using quick sort
from the visualizations, and this is what usually the
users going to see and do. All right. Now for
quick sort in Tableau, there are three places
where you can sort your data directly in
the visualizations. The first one is sorting
the data from the header. If you mouse hover on the
header name over here, you can see that
we have small icon in order to sort your data. We can use it here to sort
the header informations, or the second place, we can go to the axis over here, and you can see as well there is small icon to sort the data. And the third one, the last one, if you go to the field labels. If you go to any values
here inside the header, you can see we have as well, small icon to sort the data. Those are the three places where you can sort the
data in Tableau. Sorting work with three clicks. The first click going to
sort the data ascending. The second one going to
sort the data descending, The third click going
to bring the data as it is sorted from the
data source. All right. As a default, the
data going to be sorted as the data source. If your data source is
sorting the data ascending, we can have the same
way at the view. Now as a default, we are not enforcing any
sorting in our view, but we are taking it
from the data source. As you can see, it is
sorted already in ascending fashion because we have
from the data source. Now, if you go to the
header for example, let's click on this icon
and see what can happen. As you can see,
nothing happened in the view because it's exactly
like the data source. We have it in ascending fission. So that's was the first
click that we done, we sorted now the data
in ascending way. And you can see over here, we have a small
icon that indicates this dimension is now sorted in the view
in ascending way. So let's go again over
here and click again. Let's see what's
going to happen. If I click on it,
now the data going to be sorted in
descending order, and as well, here, we're
going to have different icon. We have the tables, and then it ends with
the accessories. Now we have it descending. Now, to go and reset
everything back to the default to the
data source models, what we're going to do, we're going to click the third time. If I click again over here, the icon going to be
done from the dimension, and the data going to be sorted exactly like the data source. This is how sorting in ta
works. You have three click. The first one ascending, the second one descending, and the last one, we're
going to bring it to the default as the data
source. All right. Now we're going to go
to the second place where we can sort our
data in the view, and that is the axis. If you go to the axis over here, we can find the small icon, and here is exactly
the opposite. The first click can assort
the data in descending order. The second click can assort
the data in ascending order, and the third one can bring it back to the
default like now. So let's try that. We're
going to click the first one. As you can see now. The data and the rows are sorted
in descending order. We start with the highest sales, and as we are moving down, we're going to move
to the lowest sales. All right. So now
let's click the second one. So let's come. We are now sorting the
data in ascending order. So we start with
the lowest sales, and we end up with
the highest sales. And the third click
going to bring it to default without any order. Let's click on that and we
are back to the starts. Where the data is
not sorted at all. So as you can see, with
the header and the axis, we are sorting the rows only. So only the rows are sorted, we are not sorting the columns. So France, Germany, Italy, USA, are going to stay
at the same position. We are not sorting the columns. And now, in order to
sort the columns, we're going to go to the third
place to the field label. So we're going to go to any of those values doesn't
matter which one. We're going to click, for
example on the chair. You can see this small icon. Here again, the same as axis. The first one going to sort the columns in descending order, the second one ascending and the third one to the
default like now. Let's go and click over
here on this icon. Now the data is sorted
in descending order. That means the first column going to has the highest sales. Then the next one going
to have the lower, and as we are moving
to the right, we're going to get
the lowest value. We are sorting the columns
in descending order. As you can see as
well on the columns, we have this icon over here. Indicate that's The columns
are sorted now in the view. So now, if we go
and click it again, we're going to sort it
in ascending way where we can start with the lowest
value, the first column. And as we are moving
to the right, we're going to have the last
one with the highest value. As well, here we can see
the icon which stores that. The data is sorted
in ascending way. And the last click, as you know, we're going to go
back to the default. The data is not sorted at all. Alright, so that's all
about Quicksort in Tableau. It's really simple once you
understand the places to sort the data and how you can click around to sort the data
in different ways. A lot of people get
confused about it, but it's really simple. Let's say that we
have the following scenario where you
say, You know what? I don't want to offer the users this possibility
to sort the data. I'm going to sort
everything in the view, and the user's going to just see the report as I
prepare it. All right. Now in order to disable the
sorting option for the users, we're going to go
to the main menu and then we're going to
go to the worksheets, and then here we have
show sort control. As a default table are
going to enable it, which makes really sense. Now let's go and disable it
and see what can happen. Now, if you go to
the visualizations, you will see that we
don't have anymore the icons in order
to sort the data. If I go to the
sales over here or I go to the subcategory
or anywhere, you see we don't have any options in order
to sort the data. This possibility is going to be completely disappear
for the users. With that, we have removed
completely the options for the users to saw the data
inside the visualizations. And to be honest, I've never
been in situation where I have to remove this
option for the users. It really makes
everything static, and this is exactly the
opposite of what we want. We want to make always
our dashboards and reports dynamic
interactive for the users, and I think it's always
really bad to make only static reports without
having any dynamic inside it. Unless maybe the users exactly
ask for this to say, okay, I don't want to sort the data, make it static as
much as you can, so you can go and
disable this option. So for now, I'm going to
go to the worksheets. I'm just going to go
and show state control and enable it again as we
go again to the sales. You can see we got
again those small icons in order to sort the
data. All right, guys. So that's all about
how to sort the data directly from the views from
the user's point of view. All right. So now
we're going to move to the second group
where we're going to learn how to sort the data as
you are building the view. In order to do that,
there's two ways to do it, either from the tool bar or
from the dimension itself. Now if you move to the tool bar, we have here two options, sort ascending and
sorting descending. Now in order to sort
those dimensions, you can click on the country, for example, now we are sorting the columns and then click
over here ascending. As you can see,
now we are sorting the data in ascending
way for the columns. If you want to sort
the subcategory, the rows, we can click over here and then
click on ascending. Or descending. So as you
might already notice, we are sorting the data always by the measure by the sales. So if you most hover on it, it's going to say sort subcategory descending
by the sales. So we don't have
any option here to sort the data by the header. So it's only sorted by measures. All right, so that
it's about how to sort the data
from the tool bar. The second method is to sort the data directly
in the dimension. So let's go for example,
to the subcategory, right click on it,
and as you can see, we have here two
options about sort. We have clear sort and sort. Clearsord going to reset
everything to the default. Let's go and do that to
start from the scratch. I'm just going to clear
everything for the subcategory. Then right to click on
it, and let's go to sort. With that, we're going to
get a new window says, We are sorting now the
dimension subcategory. I will just move it to
the left side in order to see how Tug act to my selection. Okay, what do we have over
here is two sections. The first one is about how to sort the data,
the sort methods. The second one is
about the sort order, ascending and descending. Let's see which
options do we have. We have five options. The data source order, alphabetic, field manual, std. Let's start with the first one. The data source order, here, we have it as ascending. We are sorting the values
inside our header, the subcategory, in ascending
way in alphabetical order. We can reverse it by going
to the descending order. As you can see the
values can switch. Now if we want to go
and reset everything, we can go over here and click clear to go to the
default settings, and that's it for the
data source order. Let's move to the next one. We're going to have exactly
the same effect because we have it as well at the
alphabetical order. Let's go over here,
as you can see, nothing going to change because
we have it at descending, and let's go in alphabetical
order to the ascending and the hydrogen to switch, exactly the same effect. All right. Now let's
move to the third one. We're going to go to the field. Now we can go and sort the data by any field from the
whole data source. The field doesn't have
even to be on the view, but of course it makes
no sense to do that. If as a default,
tableau is selecting the sales because it's only measure that we
have in the view. It makes sense, and the data
is sorted in ascending way. But if you want, you can
go and sort the data by the number of customers
inside each category. Subcategory. We can go over here and select the customer
ID and the function can be counor the total number of customers inside
each category. Now those categories
are sorted in ascending way depending or based on the
total number of customers. We have this ability to sort the data by any field
from the data source, but it doesn't make
sense, of course, to sort the data
like this because it's going to confuse
the customers and they will not understand why
those categories are sorted like this without having a description
in their report. That's all for this
method, sort Pi field. Let's move to the next one. We have sort Pi manual, and here you have the freedom to make the order
of the dimension. For example, we can
take these machines over here and as
I'm moving it down, you can see the order in the
view is changing as well, so I can go and sort the
dimension as I want. So it's really simple. Here, we don't have any rules. We don't have ascending
or descending. We have the complete freedom to sort the values
inside any dimension. And that's it for this option. Let's move to the next one and the last one, we
have the nested. Now, in order to understand how the nested sort
works in Tableau, we have to work with
multiple dimensions. The best way is
to get hierarchy. So now let's go and
create another view. So I'm just going to go
and close this one here. Let's create let's
take the continent to the rows and let's take the
profits to the columns. And as well as usual, we're going to show the
labels of our data. Go to the continent
over here and radically, let's
go to the source. Let's say we're going
to sort the data by the data source descending. As you can see, we are now
sorting only the continent. If we drill down to the
country, you can see that. Only the continent is sorted, but the country is not sorted. If you go to the city, you can see that the city
is as well not sorted. Only the first
dimension is sorted. But now instead of
that, we can go and use the st sort in order to sort all dimensions
inside the hierarchy. Automatically. Let's go
and remove those stuff. I'm just going to drill back to the continent or we
call it drill up, right a click on it,
let's go to sort, and then we're going
to go to the nested. Now we're going to
say, so the data ascending and we're going
to use the measure, the aggregation, sum of profit
in order to sort the data. Now let's go and close it and with that we got
the nested sort. As you can see the
continent is sorted. But now if I drill down to the Country, let's see the country going to be as well sorted. So now, if you look
closely to the data, you can see that the USA is the only country
inside this continent, so we cannot see any
sort of over here, but you can see
that the countries in Europe are sorted ascending. So it starts with the
lowest value from Italy, then France, then Germany. So you can see the country inside this continent
is sorted as well, based on the listed sorts. As you can see the countries of each continent going to be sort separately
from the countries from the other continents. This is how the st sort works. Let's go and just put the
profit on the colors as well. Now let's go down in the hierarchy and drill
down to the city. We're going to have more data and it's going to be more clear. As you can see now, the
city is as well sorted, and now we are
sorting the cities in one country. So, for
example, over here, in USA, the lowest sales is in Seattle and the highest
sale is in Portland. So we are sorting the cities
based on the country. So this is one section. The next section is Italy, the next one is Germany, so each country is going to be sorted separately
from other country. So with that we have
learned this method work, if we have multiple dimensions, and it can work perfectly, if we have archy in our view. Everything going
to make sense and the sort going to be very
logical for the users. As I'm drilling down, for example, to the bustle code, or I'm rolling up
back in my view, everything going to be sorted in very logical way.
All right, guys. So with that we have
covered everything, how to sort the data inside our views from the
user's perspective, how to sort the data as we
are building the views, and I think it's really simple
and not that complicated. All right, so that's all
about how to sort our data in Tableau and we have
completed this section. In the next section, we're
going to learn about tableau parameters to add
dynamics to our visualizations.
73. Concept of Parameters: All right, e one.
Now we're going to talk about the parameters. Parameters are game
changer in Tableau. And that's because and
this is my opinion, parameters are the best feature that Tableau did introduce because parameters
in Tableau can make your visualizations
very dynamic, interactive and flexible in very unique way that you cannot
find it in any other BI. All right. So now
what are parameters. Parameters are like variables in programming languages that allows the user to replace a constant value in
the calculations, filters, a reference
line, and so on. Okay. So now what
this really means, if you are building a
view for your users, you are already making
a lot of decisions, defining a lot of values, that can stay static, and the users are allowed
only to read your views. So for example, you might create the following
calculation in Tableau, where you are defining a
threshold for your KBI. So you are saying if the
total sales is less than 400, then the KBI can to show red, Otherwise, it's
going to show green. So here, the value
of the threshold 400 is static and cannot be
changed from the users, the viewers, only can be
changed from the developer. But now you might
be in a situation where you have two
requirements from two different users where they define different
thresholds. So here you end up making
two calculations for two customers and as
well creating two views. But now instead of doing that, we can use the power
of parameters. So here we can replace the
value 400 with a parameter. And then we can offer
the parameter as an input field for the
users in the view, and now the users can
use the parameter to define the needed
value, as it requires. Using parameter going to
change the behavior of your view depending on the
value of the parameter. This go to make your views are dynamic and ready for
any requirements. And there are endless ways to
use parameters in tableau, and in this torial I'm going to show you six
different use cases. The first use case is about how to use parameters
in calculations. The second use case is
about the reference lines. The third one how to
use them in filter, and we have another
very special use case in how to switch between dimensions and switch between measures in very dynamic
way in one view, and another use case about
the titles and text, The last use case, how to
use parameters in pens. All right, guys, so that was
a quick intro to parameters. Next, we will learn
how to create dynamic calculations
using parameters.
74. Dynamic Calculations using Parameters: All right, y. So now let's
start with the first use case, how to use parameters
in calculations. So now let's create
now some kind of QBI to track the profits
by the subcategory. Okay, so now we're going to stay with the big data source, and we're going to
go to the product to get the subcategory. And then we need
the major profits. So we're going to
go to the orders and we're going to get
the profits over here. Okay, so now we're
going to show as well the labels on the view, and now we're going
to have a threshold or QBI, where we're
going to say, if the profit is
less than ten k, then it's going to be red and anything higher than ten
k, it's going to be green. Now in order to create the logic and the colors in the view, we have to create calculations. Don't worry about how to
create calculations and tableau because we're going to have a dedicated
section for dots. Now in order to create
the calculation, we're going to go
to the data pane, click on the empty
space and then choose create calculated field. Let's go there. And
now we're going to call it QBI colors. And now then we're
going to write here the expression about our logic. So it says if we need some, and then we have the profits. We said if it is less than 1,000 k, then it's going to be red. So we're going to
write the value red. Otherwise, it's
going to be green. So Let's end it. With that, we have our logic
for the colors in our view, and as you can see over here, in our calculations,
we have a constant, it is the ten k. Let's go and create that so
we're going to click. And here on the left side,
you can see our dimension. We're going to take it
and put it on the colors. Now let's go inside and assign
the values for the colors. Green, it can be green and
red, it's going to be red. So let's click. Now
we can go and give this report to the users and they can view it and
interact with it. But now, as you can see,
the calculations of the QBI is really static and
they cannot customize it. In order now to
give to the users the option of defining what
is red and what is green, we have to use parameters. Now in order to
create parameters in tableau, there is
two ways to do that. Either you go to the
data ban and create your parameters or you created in the place
where you need it. For example, if you
are creating a filter, inside of the creation
of the filter, we can create parameters. Now let's see first how we can create parameters
in the data pane. In the data panes, there's two
ways to create parameters. Either you go to the empty
space and write a click on it, then you can see here
create parameter, or the other option is that, you go to the head
of the data bane and you have here small arrow. If you click on that, I see exactly the same drop
down and here we have the option of
creating parameter. Let's select that,
and now we have the window of
creating parameters. First thing, first, we
have to give it a name. We're going to call
it choose threshold. Next, we have to define the
data type of the parameter, and if you go over here, you can see a list of all data types. But here you know all of them, but Table decided to
go with float and integer instead of number
hole and number decimal, but they are exactly the same. For now, we're going to
go with the integers. We don't want to have
decimal numbers in the KPI. Then once you do that, we can
define the display format. Here for each data type, there are different formats
to represent the values. As you can see, we have
automatic number standards, percentage, currency,
customized. I'm going to stay
with the automatic. And then in the next one, you have to define
the default value that's going to be
show up in the input. Here I would say it's
going to be the 10,000, and of course, the
users can change that. Then after that, you
have different options to limit what the
users can select. The default option here
is all that means you are allowing the users
to enter any value. But of course we limited
the data type to integers. That means the
users cannot go and enter any characters
in the input field. Or you defined for the user
a list of allowed values. Here you can go and allow, for example, five different values. Maybe to make sure that nothing
goes wrong in the view. So here you are making the
parameter more restrictive. So the list is something
like discrete. You are allowing a list
of distinct values. And the next one is
something like the pens. You are defining the start
and the end of the range, and then you are
defining the steps between those two values. So, for now, I'm going
to leave it open ended so the users can select
whatever they want. Alright. So now let's go and
to to create the parameter. And now, if you check the
data pane on the left side, let me just minimize
those tables. You can see that the
parameter is going to be created always at the
end of the data pane. So there is like a separator between your data
and the parameters. And that's because
the parameters are something that is independent
from your data source. So there is no
dependence between the parameters,
and your dataset. It's completely
something independent and only special
for the workbook. Now we have the
parameter, how are we going to show
it to the users. In order to do that, it's really easy, go
to the parameter, right click on it,
and then we have the option of showing
parameters in the view. Let's select that,
and now you can see the parameter input on the
right side of the view. Here we can see the value
of ten k as a default. Now let's go and
change the value. We're going to have it like 500, You can see nothing
change in our view. So it doesn't matter what
you are giving here. You see that the view
is not changing. That means we have
now to connect it somehow to the view, and
in order to do that, we're going to go
inside the calculations and replace the constant
value with the parameter. Let's see how we can do that. We're going to go
to our calculation, the QBI colors,
right click on it, and then let's go to edit. Now we have to go over here and replace this value. I'm
going to remove it. And now we're going to type the name of the parameter as you can see Tableau and suggest
here. And click on it. So with that any values that the user is
going to give for this parameter going to be used directly in
this calculation. Let's try that out. I click. As you can see something
changed already in the view, but let's go and play with
the values instead of five k, we're going to have
20 k. That's okay. With that, I just changed
the threshold for this KPI. Now anything below 20
k going to be red, anything higher
going to be green. Let's have another value like 50 k. Now as you can see the
threshold is really high. We have only two
values with green. As you can see, it's very
dynamic and you give the users the power of defining and customizing the
KPI as they want. With that, you're going to
cover a lot of requirements. Only one view. I just love
this feature in Tableau. Alright, so that's all for
the dynamic calculations. Next, we will learn how to use parameters to create
dynamic reference lines.
75. Dynamic Reference Lines using Parameters: All right. Now let's see another use
case of the parameters. We can use parameters
in the reference line. So we can show in our view a reference line to indicate
what is the threshold. Just it makes it
more clear where is the cut between
red and green. And here we can use our
already existing parameter so the threshold in
the reference line. Let me show you quickly
how we can do that. Now let's go to the analytics
pane and then here we have the option of creating
a reference line over here. Let's go and
Dublilyc now we have a new window to configure
the reference line. There are a lot of
options, but now we can focus on the parameters. What is really important is the value of the
reference line. Now let's check the option
that we can see over here. As you can see table here
suggesting the metric. The second one is to
create a new parameter. The third one is to choose the already existing parameter. As you can see, we can create a new parameters exactly in
the place that we need it. But for now, it makes
really sense to use the same parameter in
the reference line. Let's go and select that. Now as you can see
on the right side, we have already a
reference line in our view and we have the
label of choose threshold. Instead of showing the labels, we can show the values
of the parameter. In order to do that,
we're going to go to the liples and we're going
to change this two value. Let's select that.
That's it for now. Let's go and click
OK. As you can see, we are showing now the
threshold as a reference line. If we go and change
the value of the 50 k, two, let's say ten k. Let's go. Now, as you can see, the user can control everything
in the view. With their input
in the parameter, they are changing
the calculations as will the reference line. It's really cool
and professional to have this dynamic
on your reports. This is how you can
use the value of the parameter inside the
reference line. All right. That's all for the
dynamic reference lines. Next, we will learn how to
use parameters in filters.
76. Dynamic Filters using Parameters: All right. Now we're going to go to the next use case where we're going to use the
parameters in filters, and we can learn as
well how to create parameters exactly in the
place where we need it. Now we're going to go and create a report where we're going to show the top ten
products in our dataset. In order to do that, we're going to stay with the p data source, and let's go to the products and we take the product name. Atablicly. So now we have
a list of our products, and what do we
need is a measure. We're going to go to the orders and we're going to
take the sales. Drag and drop it over here. As usual, let's have labels, and I'm going to
sort it descending. And now we want to show
only the top ten products. In order to do that,
we're going to take the product name in the filters, so we can drag from here by holding control and then
drop it on the filters. Now in the filters over here, we want to show the
top ten products. In order to do that, we're
going to go to the tap top, and now we're going to
go and define the rule. Everything is fine, so here
you can see top ten by sales. Now as you can see,
we are defining a rule, and in this rule, it's like the calculations, we have a constant, and the constant in this
rule is the ten. Now you might be in
the same situation where you have one
user asking for top ten products and another user asking
for top 20 products. Now, instead of going and
creating two different filters, two different views, we can stay with the same view
and use parameters. Then you're going to
give the end users to define their list. Now we have to change the
value of ten to parameter. Let's click over here, and here you have always
the three options. Either the value you
enter or you can create a parameter or use already
existing parameter. Now we want to create a new
parameter for this view, and as you can see, this is the second method on how
to create parameters. We will not go to the data bin, we're going to create it
exactly where we need. Let's go and click,
create a new parameter. Now we have here,
again, the same window, where we're going to
create a parameter. We're going to call it
choose top products. Now you might notice that you cannot change the
data type because you are creating
here a parameter inside the filter for the sales, and the sales is
measure and the number. But the same here, you can
customize the display format, the current value, and as well, which values you can allow
whether everything or a range. Now let's try the range. The minimum going to be one, the maximum going to be 50, and we're going to have
a step size of five. All right. That's
all. Let's click. Now let's check again the rule. We have to then our
parameter by sales. That means we don't
have a constant value and we are using the parameter. Let's go and hit okay. Now as you can see
the report is showing the top ten products because the default value of
the parameter is ten. If you check the left side,
we have a new parameter called choose top
products. Great. Now the next step is to show the parameters for the users. Right click on it and
say show parameter. Now let's check our parameter.
Now it's showing 11. I thought I gave it like
ten, let's edit it again. Right click on it, and
then let's go and edit. Ah, right, because we
blade with those values. As you can see, it's like pens, it starts from one, six, 11, and so on, because
the size is five. What we're going to do is
to change this to zero. Then as you can see, we
have here again, ten. Let's click. Now, I
promise you we have top ten because if you check the value here on the
parameter, it's ten. Now this is something different. Instead of having input field, here we have a range slider. The user can change the slide, and as you can see,
our filter reacted, and it's showing now the top 20. The users could use those arrows in order to change the step, and as you can see as I'm
moving to different values, the filters as well is changing. So that say, this is how we can use parameters and filters. As you can see,
your view is very dynamic and you let the users to customize
what they want. All right, guys, that's all
for the dynamic filters. Next, we will learn very interesting use case
of the parameters, how we can dynamically swap between dimensions
and between measures.
77. Swap Measures/Dimensions using Parameters: All right. So now
we're going to move to the most important use
case in parameters. Can I see this use case
almost in each table project. The use case is to use
parameters to switch between dimensions and to
switch between measures. Now, let's learn
first how to use parameters to switch between
dimensions in one view. Let's say that you are building a dashboard about the sales, and you're going to
have views like sales by country, sales by category. That means you are
creating two views with the same metric but
different dimensions. Now, instead of
having two views, we're going to have only
one view for the users, and they're going to decide which dimension they're
going to use in the view. Now in order to do
that, we have to use the power of
parameters. All right. Now let's go and create our
view. We have the sales. Let's take the sales
on the columns, and then we need the countries, we're going to take it
from the customers, and then we have here the
country and the rows. Great. As usual, we're
going to show the labels. Now we want to make
the dimension country as a variable as parameter. That means we need
somehow to switch between dimensions between country and
category in the same view. That means instead of having
the dimension country, we want to have a
dynamic dimension with different values. Now the first thing
that we have to do is to create a parameter where the user is going to choose which dimension should be
presented at the view. Here we're going
to go and create a parameter from the data pane, click over here, then
create parameter. Here, the main focus of
this parameter is to choose which dimension can
be presented at the view. First, let's give it a name. We're going to call
it choose dimension. And now the question
is, what are the values inside
this parameter? It's going to be
the dimension name. It's going to be values
like country and category. So they are string.
The data type over here is going to be string. Let's go and select that. As you can see Tableau did
disabled the format, we cannot choose a
format for the string. It's like a free text. Next, we have to define the
current value, and here we're going
to have the dimension country as a default. Let's go and enter
the value of country. Alright, so now since the
data type is a shrink, we cannot build a range from it. So here we have only
two options either, we're going to have it as a
free text as an input field. And in this scenario,
it really makes sense to have a pre defined
list for the users. Since the users will not
see your data source, and they have no idea which
dimensions do we have. So for that, if we go
with the free text, it's going to be
really confusing and no one going to get the
right dimension for it. So in this scenario,
we really must provide a pre defined
list for the users. And then they're going to select the value that it's
going to suit them. So here in this
example, we're going to offer only two dimensions. It's the country
and the category. So let's go and
add those values, so we're going to
have the country. And the next value going
to be the category. Of course, you can add more
dimensions like the city, the product name, and so on. Now we're going to stick with
the example, and that's it. Let's click Okay. Great. Now
if you check the data pan, we have a new parameter
called Choose dimension, and here you can see quickly, which data type do we
have for each parameter. Now the next step is to show the parameter for the end users. Right cli, let's go
and show parameter. So now let's check our
parameter on the right side, we have a list. It makes sense. We have created a
list parameter, and at the end, we're going
to have a list for the users. Inside this we have
only two values, country and category. Now if you go and switch
between those two values, nothing going to change
in the view because this parameter is not yet connected to our
view. All right. Now we're going to go and
create our dynamic dimension and use it in the view
instead of the country. That means we have to create a new field in order to do that, right click over here and create calculated
field. Let's go there. Now, let's call it dynamic. Dimension. We can use
here the case win. Don't worry about it.
I'm going to explain everything in the
section of calculations. The syntax start with case, and then we have to
specify the field name. In this situation, we're
going to enter the parameter. Our parameter code choose. Here, as you can see,
as you are writing, Tableau is suggesting
stuff for us. Our field code choose dimension. Next, we're going
to go and specify an action for each
scenario for each value. Let's have a new
line and write win. The first value going
to be the country. You need to be really
careful here to write it exactly as we wrote
it in the parameter. It was capitalized in the parameter and it should
be as well here capitalized. Otherwise, it will not work. Now what can happen if
the value is country? Then we have to
specify the action. If the users choose country, what can happen the dimension
country should be used. Let's go and write over here
country, and as you can see, as I'm writing, T is suggesting, we need the dimension country. You can see it from
the icon over here, let's select that. All right. Now let's move to the
next scenario that. The user going to go and
select the value of category. It's exactly the same stuff. We can write here
when the value is category. Then what can happen. The dimension category
should be used. So let's start here category. And as you can see,
we have suggested over here the
dimension category. Let's select it. So
that says this is the scenario that could
happen to the parameter, and we have to end the
case win like this. So as you can see in
this calculation, we are just mapping
between the values of the parameters and the dimensions.
So let's go and click. Now, as you can see, we
have a new dimension on the left side called
the dynamic dimension. It is calculated field. And now we're going
to go and remove our static dimension,
the country. And instead of that,
we're going to add our new dynamic dimension. All right. So now let's go
and check with the icon work. As you can see the
value is now category, and in the view, we see the categories,
which is really good. Alright. So now let's change the value of the
parameter to country. As you can see the dimension
in the view did change. So now we have country
instead of category. So as you can see parameters
are really powerful, and you are going full
dynamic in your view, where the users can
define the level of details in the view by
changing the dimension. So imagine now you are making
a dashboard with sales, and you have ten dimensions, Here you are going
with only one view instead of having ten reports. Alright, so that says
for this use case. This is how you switch between dimensions using parameters. Alright, so now you have
the following tableau task. The task says to create
a dynamic measure using parameters to swap
between three measures, sales, profits, and
quantity in the same view. You can pause the video
right now to do the task, then resume once you are done. All right. So now, let me
show you how you can do that. We have exactly the same
steps as the dimensions. We have first to create
the parameter and second to create the logic
in the calculated field. Let's start with the first
one to create the parameters. We're going to go
to the data pane. Click over here and
create parameter. We're going to call
it choose measure. Here we have to think about
the values of the parameters, so it's going to be the
name of the measures, which means the data type
going to be a string, and here we have to
define the default value. Here we have three values, sales profit and quantity, and we're going to have the
default value as sales. Here again, about the values, the users don't know
about your data source. So they don't know the exact
name of your measures, so you have to go and create
a pre defined list for them. Let's go over here.
We have three values. So we're going to have
the first one sales, the second one profit, and the third one going
to be the quantity. So that's it. Let's go and hit ok. As you can see
on the left side, we have our new parameter, and the next step is to show the parameters for
the end users. In order to do that, right click on it and show parameter. Let's check our
parameter over here. You can see it starts
with the sales since it's our default, and you can switch
between those values. But as you can see, nothing
is changing at the view. So the view still
showing the sales. The next step is now to go and create the calculated field. In order to do that, we're
going to go to the data pane, right click over here, and then select Create calculated field. We're going to call
it dynamic measure. And here, again, we can
use the same syntax case, then the name of the parameter, choose, we're going to
select the measure. Now we're going to go and
define the scenarios. When the value is sales, then the action going to be
selecting the measure sales. Write sales and
select the measure, a new line, and
we're going to go now and map the next value. That's going to be the profit.
Then the measure profit. Profit and let's go and
select the measure. We map that. We're going
to map now the last value. We have the quantity. If the user select this
value in the parameter, the quantity measure
is going to be selected as well.
Let's go with that. That's it. This is
our three scenarios. We're going to have
end at the end. Now as you can see,
our calculation is valid. Let's go and hit. If you check the
data bin, we have new calculated field
called dynamic measure. Now what we can do, we're
going to go and remove our static measure and replace it with the
dynamic measure. All right. So now let's go and change the values
in the parameters. Let's start with the sales. As you can see now, we
have the values of sales, and if you switch it to profit, you can see the axis and the values in the view are
changing to the new measure. But now let's go to the
last one to the quantity, and as you can see, we
don't have any data. Well, if you have
something like this, then we have an issue either in the calculations or
in the parameter. Let's find out
where is the error. Let's go to the
calculation again, click on it, and
then go to edit. Here we have to
compare the values. As you can see, we
have her quantity and we have the
dimension quantity. Everything is correct.
But as you can see the value over here in the
parameter is quantity. So here I have a typo, and that means for Tau, we didn't define any
scenario for this value. In order to correct
that, we're going to go to the parameter
on the left side, tally correct, then go to it, and then we're going
to go to our list and change this value, so double cit and write
it correctly quantity. That's it. Let's go okay. Now as you can see, we have
data for the quantity. So it's really important to have exactly the same values from the parameters inside
the calculation. So as you can see,
it's really sensitive. With that, we have
a dynamic dimension and a dynamic measure. And we can switch
between those stuff, as the user wants. All right. So this
is how you can use parameters to swap between
measures in a view. It is just great.
All right, guys. That's all on how
to swap between dimensions and between
measures using parameters. Next, we will learn how to use parameters in titles and text.
78. Dynamic Titles & Texts using Parameters: All right. So now we can move quickly to the next
use case where we can create dynamic
titles using parameters. Now, if you look to
our previous example, we have an issue. You see, we have the
title sales by country, but the view is
showing category by profits because we chose over
here category by profits, and now the title is
wrong and misleading. So how we can solve
this problem. We can use parameters to switch this static title
to a dynamic title. Let's see how we can
do that. Let's go to the title and Dublic. We have a new window to
customize the title. Now the rule as a default, is going to be the sheet name. That means the name
that you gives to the worksheet going to be
the title of your view. In this example, I call this worksheet as
sales by country, and we have it as
well as a title. But now we have to
change this rule to be measured by dimension.
Let me show you how to Let's just remove this rule, and the first word in our naming convention going
to be the measure. Now in order to
insert the parameter, we're going to go over
here on the insert. Then you will have a list of
different table functions, and we have here a section
for all parameters. Here we need the parameter for the measures. So
let's click on that. Now the next word in our
naming convention going to be by, space, by, space. Now, as you can
see, by don't have any background color
because it is static. And the parameter
has a gray color to indicate that this
is a dynamic value. And then the last word of our title going to be
the parameter dimension. Let's go and insert
that in the same way. Click on insert, and our
parameter going to be over here, Parameter choice dimension.
Let's click on that. The first word going to show the value of the
parameter measure, then we have by, then we have the value from the
parameter dimension. Let's go and click. And now, as you can see, the title of
our view did really change. So now we have it correct. Profit by category. Now, as usual, we're
going to go and play with the values
of the parameters. Now let's have the
dimension country. And you see, now we
have profit by country, and the same for the measure, we can go and select quantity. So we have quantity by country. As you can see, it's really
amazing and you can add parameters in
everything and you're going to have really
awesome views in Tableau. Let's have quickly
another example. We can do the same in the
parameters and filters. Here we can make as
well a dynamic title. Let's double click on the title. Let's remove these parts. We're going to call it top, then the value going to
be from the parameter, it's going to be top
30, top 40, and so on. We're going to go and insert the parameter that you
are using in the filter, so it's going to be the
choose top products. Then we can add
the word products. That's it. Let's click. Now as you can see, we have the title top 30 products because the value in
the parameter is 30, and as you are changing the
values in the parameters, you can see the title is as
well changing accordingly. I just love parameters
in tableau. All right, With that, we have learned how to use
parameters in text and titles. Next, it's going to be the last use case of the parameters. We will learn how to create
dynamic pills in histograms.
79. Dynamic Bins & Histograms using Parameters: All right, so now we're going to move to the last use case. We can use parameters in pens. In the last tutorial,
we created pens and histogram about the
scores of the customers, and we have decided that
the size of the pen is ten. Let's go and rebuild
this view quickly. It's really easy. So let's take the scores and put
it in the columns, and then we can
take the count of the customers and
put it on the rows. With us, we have
an histogram and the size of each of
those pens are ten. Again, we have a constant
value inside our view. Let's go and make it dynamic. We're going to go
to our pen score, right click on it,
and then edit. Here you can see the
size of pens is ten. This is what we have defined. But now instead of that,
we're going to create a parameter, right click on it. Again, we have here the option of creating a new parameter. Select that. Now we're
going to call it choose size of pens. Now again, Tableau did the
side on the data type. It should be based
on the scores. Here we have the default value is ten, I'm fine with that. Now we have to go and choose
which values can be allowed, either all the values
or list or range. Here I recommend to
use that a range because if you look at
the parameter range, it really looked like
a small pens As well, it makes sense to define
the range for the users. Here we have the minimum five, the maximum 25, and the
step size can be five. I'm fine with that. I'm
going to leave it as it is. Let's go and click OK. Now
you can see instead of having the size of pens
ten, we have a parameter. Let's go and hit
ok. As you can see, nothing's changed in our
histogram because previously, we have the size of ten and the default value in the
parameter is as well ten. Let's go and test everything we have first to show
the parameter, right click on it
and show parameter. Now in the right
side, we have ten, And if we are just moving
between those two values, you can see that our histogram is as well changing accordingly. And with that, the
customers can go and customize the histogram
as they want. And here, always,
don't forget to make a dynamic title because it's really cool. So let's
go and do that. Double click on it. As usual, we're going to remove
this from here and we're going to
call it histogram. So this is the static
part, isochrm score, and now we're going to
add the size of pens, we're going to have inserts, size of pens, and then
we're going to close it. That's it, with that,
we have a dynamic name, and now you can see the
selected value from the parameter is now
showing in the title. If the user is changing
the size of pens, as you can see the title is
as well changing accordingly. This really makes a
lot of fun working with Tau. All right. So now let's summarize.
I think parameters are the best feature
that we have in Tableau, and parameters are like
variables that allows the users to replace the constant value
in the calculations, filters, reference
line, and so on. Another unique thing about
the parameters of that, they are independent from your dataset from
your data source. The main purposes
of parameters is to make your visualizations
more interactive, more flexible and
dynamic and give different users the
possibility to customize the visualizations for
different ways and requirements without having
to create multiple versions, of the same visualizations. I just love parameters. All right, y, so with that we have learned everything about the parameters and how to
make our views dynamic. And in the next section, we will learn more techniques about interactivity in Tableau, and we're going to focus
on tableau actions.
80. Concept of Actions: Tableau actions. They are really great feature in
Tableau where it can add more interactivity and
dynamic to your dashboards, which is going to make
your dashboards very modern and interactive,
and as well, it can enable the users to do data accelerations
using your dashboards. So as usual, first,
we have to understand the concept behind
the Tableau actions. Then we got to go and practice
in Tableau. So let's go. All right, guys, now we can start with the
first question. What is action? Well, action
is a change of status? That means because of
specific event or trigger, the status of an object
can change from A to B. And the object in Tableau
can be the visualizations. The starting point,
we call it in Tableau is source sheets, and the action gonna be triggered by the
user interactivity. How usually the users interact with our views, using the mouse. So either by hovering
the mouse on the data or by selecting
or clicking on the data, and the last option
is using the menu. So so far we have
defined for Tableau, the starting point,
the source sheet. The second thing we
defined for Tableau, what can trigger the action. And the last thing that we
have to define for Tableau is, what can happen once the
action is triggered. And here we have six
different options or actions. The first one going
to be go to URL. That means Tableau can jump from tableau to an external website. So that means the target is
going to be here a website, not Tableau or not
ivisualizations. The second option is
to jump or to go to another worksheet or
to another dashboards. So here we are moving from
one worksheet to another. Moving on to the third one, we have the filter action. What this means the actions that you are doing at
the source sheets, going to affect the filtering
in the target sheets. Anything that you are clicking
on the source sheets, it's going to impact the
filter in the target sheets. And then we have another
action called the highlights. Here again, we have a target
sheet, and this time, any action that you are
doing on the source sheet, it's going to impact
and going to be highlighted in the target sheet without filtering the data. That means go to sheet
filter and highlights, you have always to specify the source sheet and
the target sheets. And then we have two
other actions where it's going to impact the
values of something. Here we have change set value. So anything that you are
doing on the source sheets, it's going to affect
the members or the values of the target sets. This is going to
make the set very dynamic and interactive. The last one we have
change parameter values. So again, here, any interaction that you are doing in
the source sheets, it's going to impact the
values of the parameters. So that we have now all
the options that you can define as a consequence
for the action. So as you can see,
it's really easy. We have to define
the source sheets, we have to define the trigger, and then we can define what can happen once the
action is t Alright, so that was a quick introduction
to the Tableau actions. And next, we're going to
start with the first type of actions that go to URL.
81. Actions: Go To URL: All right, guys. So in T, we
can create actions either in the worksheet page or
in the dashboard page. In order to do that, we're going to go to the main
menu over here. We can find the
option worksheets. So let's go there, and then
we have here the option of actions in order to
create new actions. Or we can go to the dashboards, and as well, we have the
same option actions here. But since we are now at the worksheet page,
it is grayed out. So now we're going to
learn how to create actions in the worksheet page. And we're going to start
with the go to URL. So let's go back to the
worksheet and the main menu. Then let's go and
click on the actions. With that, we're going
to get the first window. So what we're going to
see at the start is an empty table because we
didn't create any actions yet. But once you start
creating actions, you will get a list of
all actions that you have inside the workbook
or inside the sheet. So now in order to
create a new action, we're going to go over
here, add an action. Then we're going
to go to Go URL. So let's select Dodge. And here we're going
to get a new window in order to set up our action. In our example, we want
to jump from tableau to external page to a Wikipedia. So we have to give
it first a name. The name of the action,
is going to be go to more details. Then as we learn, we have to specify for
Tableau three things. First, we have to
defin for Tableau, the source sheets, the
starting point of our action. Then we can specify for Tableau, what can trigger our action. And then at the end, we
have to specify the target. So let's start with
the first one. We have to specify
which worksheet is going to be
including this action. So here we have to select first, which data source, it's going
to be the big data source, and stop we're going
to select immediately, the current worksheet,
sales inside source. So that's all for
the source sheets. Then we have to
specify for Tableau, what can trigger our action. And here we have three options, either mouseover,
select or by menu. Let's leave it as a menu first. Then we have to
define for Tableau, what is the URL targets. In our example, we
have to specify here, for example, the Wikipedia page. And here we have two options, either we're going
to create a new tab or we're going to
create a new window. All it's really easy.
All you have to do is to specify the
starting point, what go to trigger our action, and what can happen once
the action is triggered. So let's go and hit okay. And with that, you
can see, we have now one action in this table. Let's go and hit okay
again, and let's test it. So so far, nothing changed
in our visualizations. As you can see, we have the
subcategories by the sales. But now, once the user
clicks on the marks, so for example, let's go
on the chairs over here. We will see here a new link. It says, Go to more details, and this is exactly the
actions that you have defined. So here the interaction
from the users, they have to go to the marks, they have to click on the mark, and then go to the menu. So once click on
the link over here, double going to jump
to a WikiD page. That's it, this is how it works. Now let's go and try
different triggers. I'm just going to close this. Let's go back to the worksheets and then go to the actions. Let's go to our action
over here and go edit it. Now instead of using Menu, I would like to have select. Let's see the effect of that. Let's click and then again. Now the trigger for the
action is going to be by selecting by clicking
on the marks. Once I click somewhere over here, let's
go to the storage. I'm going to go and
click on the mark. We're going to go and
jump to Wikipedia. As you can see here, it's a
little bit more sensitive. Once you click on the marks, you're going to jump to the URL. So here we don't have a
menu where we have a link. We're going to jump
immediately to the link. Let's go and try the hover. It's going to be more extreme. Let's go to the actions
again to our action, and then let's go to the hover. Here you have to be
careful as you are mouse hovering because you're
creating a lot of web pages. Let's go and ho.
Now, very carefully, once I mouse hover on the paper, T going to go and jump to Wiki BD. I didn't
click anything. Mouse hover. So as
you can see now, the action is very sensitive
to the user's interactions. By just mouse hovering
on the marks, W going to go and
execute the action. So with the menu, the users
have the chance to think whether they want to execute the action or go
to the URL or not. With the select, it's more aggressive where the users
can select on the marks, they can jump immediately
to something else. With the hover, it's
very aggressive. Just by how mouse
hovering on the marks, the action can be triggered. Now let's go cloth this and be very careful where
you are mouse hovering, because once you hit any marks, TO going to go and
open a new web page. Let's go back to our worksheets and then go to the actions. Let's remove it because
it really doesn't make sense to have a mouse
hover to go to any URLs. The best way is to do that is to go to the menu. All right. Now since we are
working with URLs, we can add a lot of
stuff like values, filters, parameters to the URL in order to make
something more dynamic. For example, I would
like the users depends on which
subcategory they select, they're going to go and find more descriptions about
this subcategory. We can do that.
First, we're going to go to the URL over here, and we're going to add Wiki. Then we have to add the
value of the subcategory. In order to do that. Let's
go to the insert over here. Then we will get a list of all fields that we have
inside our data source. So we are searching
for the subcategory, and we can find it over here. So let's go and select
on the subcategory. So as you can see, it's like
dynamic inside our URL. And now I would like
to make the name of the link as
well more dynamic. Let's go and call
it read more about, and then we have to add the subcategory to
make it more dynamic. So we have as well
here an insert, and we're going to go and search for the subcategory,
we have over That's it with that we have
a dynamic name for the link, and as well a dynamic link. Let's go and hit and try dots. And again, K. Let's
go for example, to the tables over here, click on the mark, and you can see here we have
the following link. It says, read more about tables. It's read the value from the subcategory that we
are currently selecting. Let's click on dots. And here we're going
to jump immediately to the Wikipedia page that
describes the tables. Let's go and try something else. Let's go to the
storage over here. As you can see the name of
the link is very dynamic. We have read more about storage. And once you click over here, you will get more information
about the storage. This is really amazing in
order to add more context, more informations inside of our visualizations and to
make it more interactive. That's all now for
the go to URL action. All right, that's all
for the first type of actions that go to URL. Next, we're going to learn
how to use actions in order to jump from
one sheet to another.
82. Actions: Go to Sheet: All right, guys,
Nick, we're going to learn how to use actions in order to jump from one
worksheet to another one. In this example, we have the source or the
starting point, the sales insights, and the target going to be
the profit insights. So now, we'd like to
make an action in order to jump from the
sales to profits. In order to do that,
we're going to go to the worksheets in the menu. Then we're going to
go to the actions, and we're going to go
and create a new action. This time, we're going to
go and select two sheets. Let's go and select dots. And here we got our new window in order to set up the action. It is very similar
to the URL setup. So first, we have
to give it a name. We're going to call it
go to profit insights. Then here we have
the three things, the source, what going to trigger the action
and the target. The source is going to
be the sales insights, and the action this time
going to be as well by in. Let's go and selic dots. Then we have to specify
the target sheet. It's going to be
the profit insight. Let's go and selic dots. We have our setup. Let's
go and hit K. That's all. Then as you can see, we got
a new action in our table. Let's go and hit OK as well. Now let's go and test it. Let's go to one of those marks. Let's go to the machines. And then we get our menu. So we have now two links. The first one says, go to the profit insights or read
more about the machines. So this one is going
to take us away from Tableau to an
external web page. The first one go to move us to another worksheet
inside Tableau. So let's click on G
to profit insights. Now, as you can see
Tableau executed the action once
we click on that, and we jumped to
another worksheet. Now we are at the profit
insights. All right. So that's it as you can
see, it's really easy. We have to just specify
the source sheets, the target sheets, and what to trigger the action. All right. So that's all for
the type Go sheet. And next, we're
going to learn the action filters and as well, how to use a quick actions.
83. Actions: Filters & Quick Actions: All right, guys, when we on
to another type of actions, we have the filter action. So what can happen
here that's anything that you are selecting
in the source sheets, it's going to be relevant
in the target sheets. That means in the target sheet, we will see only the data, only the information that you have selected in
the source sheets. So let's see how this works. We're going to stay
with the same examples where we have one
worksheets about the sales, it's going to be
our source, and we have another worksheet
about the profits. It's going to be our target. Let's start with the source. Let's go to the
menu, worksheets. Let's go to the actions, and let's go and
add a new action. The first one is going
to be the filter. Let's go to the filter.
Here we go again a new window in order to
set up our filter action. It can be very similar
to the previous ones, but here we have a
little bit more options. First, we have to
give it a name. We're going to call it filter. Profit insights. And here, as usual, we have to
define the source sheet. It's going to be
the sales insights. I don't want to have all sheets. And then the trigger
it's going to be let's say that's going to
be the select this time. Then we have to define
the target sheets. It's going to be our profit insights over here, the filter. So here in the filter access, we have more options about
the interactivities. We have to define for tableau, what can happen
once the users de select the data once they
clear the selections. Here we have three options, keep filtered values, show all values,
exclude all values. The best way in
order to understand this interactivity is
to have an example. So now we're going to
stay with the default, keep filtered values. Let's go and hit okay. With that, we got our
new action over here. Let's hit k again
and try the action. The best way in order to understand how
this filter action works is to bring both of the
worksheets in dashboards. Let's go and create
a new dashboards, and let's go get the source and get the target
as well below it. I would just remove
this legend over here. So now let's go and start
interacting with the report. So again, here, once we select
something from the source, it's going to affect the
data on the targets. So, for example,
let's go and select for example, those
subcategories. So as you can see,
my interaction with the source can have an
effect on the targets. Now we can see, Only
the subcategories that I have selected
in the source sheets. With that the user
is going to get the feeling that everything
is connected together, everything is interacting
together is alive. Anything I'm selecting
in those worksheets, it has an effect
in the next one. I for this type of action, we mostly go with the
select instead of the menu. It really makes sense
to select something in the dashboards and to have immediate interactions.
The next one. So as you can see, it's
really easy, right. So now I want you to understand another type of interactivity, what can happen once I deselect, what I have selected, or
once I clear my selections. So we have selected
show filtered values. So once I, for example, here click on the
MT over here to deselect, nothing
going to change. So with that, we have
kept the filtered values, and this is exactly what we have specified inside our action. But now, if you
say, you know what, once I deselect
stuff in the source, I would like to have
all the values as well, deselected from the targets. In order to do that, we're going to go back to our action, and we're going to go and
edit our filter action. So now, if the users go and clear their selections
or deselect, we want to show all the
values for the target sheets. So let's switch it like this, click Okay, again, k,
and let's try this. So, for example, I'm going to go and select only the storage. And as you can see, we
got only the storage, Once I clear my selections, once I d select
anything in the source, you can see we'll
get all the values again in the target sheet. In this scenario, it makes more sense to use these options. If I'm not selecting
anything from a source, nothing should be
filtered in the targets. Now let's go and check
the last option. Let's go to the worksheets, actions, and to the filters. Let's go and exclude all values. Let's select that, and let's
try what can happen now. Now at the start,
nothing happened. We see all the data
from both sheets. Now let's go and select, for example, those
subcategories. As usual, we will get all data filtered in the target sheets. But now, once I select, everything going to disappear
from the target sheets. That means the target sheet
will only show the data. If I select something
in the source sheets. So that means nothing
here is relevant as long as I'm not selecting anything
in the source sheets. And once I start selecting something in the source sheets, the data going to be shown. Otherwise, if I select it
now, don't show anything. One more thing that
I would like to show about the filter actions. If you go to the target
sheets over here, you can see that we
don't have any data, and Tableau can
indicate that there is an action that is filtering the data
inside the worksheets. And you can see in the name of the filter, we have
the word action. Tu want to indicate
that this filter is really depending on the
actions from the users. An value that is
selected from the users, is going to impact this filter. For example, if you go
inside it and it the filter, you can see nothing is selected, and that's because
in our interactions, we didn't select anything
here in the dashboards. Once, for example, I
select those values, you can go back to
the target sheet and you can see those values as well selected
in the worksheets and if you go inside the filter, you can see those values are as well selected
inside the filter. Anything that starts with
the action and the filter, this comes from an action
filter and the values inside it can be defined depending on the interactions
that you have done. That we have covered everything
for the filter actions in Tableau. All right, guys. Now I'd like to show
you how to create a quick actions in Tableau
using the Dashwards. For example, let's say that we have the sales and the profits, and they are disconnected. There's no actions between them. But now I can go and create a filter actions between
them very quickly. If you go, for example, to the sales over here, we can find a small icon
for the filters. It says, U as a filter. So if you click on that, you can see now it's filled, and now if I'm
clicking on anything, Inside the sales,
as you can see, the profits can be filtered. Now, if you go to
the main menu to the dashboard to the actions, you can see that table jd created automatically
a new actions, and it's usually the
name of generated. So we have here
filter one generated. This one is created
automatically or quickly as we clicked in this small icon over
here on the dashboard. Of course, you can
go over here and change the options if you
don't want to have select, you can move it to menu
to hover, and so on. Of course, you can do the same thing for the profit insights. Let's go and close everything. Let's go to the profit
insights, and we can say, Okay, the profit is going to
filter as well the sales. Let's go click on
that, now let's select everything and anything that I'm selecting
in the profits, it's going to filter the sales. This is really nice
and quickly in order to create
actions in Tableau, but this is only for
the type filter action. That's all for the
action filters. Nick, you're going to
learn another type of actions. We have
the highlights.
84. Actions: Highlight: All right, guys. Now
we're going to talk about another type of actions.
We have the highlight. The highlight is very
similar to the filters where the user is going to interact with the source sheets, and in the target sheet, we're going to focus on a subset of data that we selected
from the source. But the main
difference here that the reliving data will
not be filtered out. All the data going to be
exist in the target sheets, but only what we are selecting
going to be highlighted. The target sheets. And the best way in
order to understand the highlight action is to have a dashboard with two worksheets. So now let's go and create
a highlight action. As usual, we're going to go
to the main menu over here, but this time we're going
to go to the dashboard. Then let's go to the actions, and let's add a new action. So we're going to go over here, add an action, and then we're going to pick this
time the highlight. As usual, we have to
define the source, the trigger, and
the target sheets. So let's go and give it a name. It's going to be
highlight profit insight. And then the source is
going to be our sales. So I'm just going to remove
the profit from here, and the best way to work or to trigger a highlight
is to have a hover. So I'm just going to run
this action on the hover, and then the target going
to be our profit inside, so I'm just going to
remove the sales inside. And then we have some
options to define which field is going to be
included in the interaction. A the default going to be all the fields or
dates and time. Then the last option you
have selected field, so you can specify which field going to be included
in the action. I'm going to stay with
the default field. So with that, we
have everything. Let's go and ok. And with that, we got as well our action. Let's say okay again. So now let's go and test the action. Let's go to the source sheets that trigger going
to be mouse hover. So now, as I'm mouse hovering
on those informations, you can see that Tableau is
reacting in the target sheets and focusing on the data that
I'm like mouse hovering. So if I stay on the storage
sheet with my mouse, you can see that Sta is focusing on the storage
in the target sheets, and you have a highlighter
with the yellow color. You can see it's really nice.
It add more interactivity, more dynamic to your
views as the users are interacting worksheets and other worksheet is
getting highlighted. It's really nice. Now you
might say, you know what? I would like to have the same effect in
the profit insights. As I'm mouse hovering
on those data, I would like to have highlights in the source in
the sales insights. Both of those reports or those worksheets can
highlight each other's. In order to do that,
it's really simple. Let's go to the main menu again, the dashboards actions, and let's go to the
highlight action. Then let's include everything in the source
sheets and as well, everything in the target sheets. With that, all those worksheets can highlight each other's. So let's go and hit K, and then again and let's check. So now as you can
see, as a mouse hovering on the profit insights, the highlight is going
to be in the sales, and the vice versa as
I'm moving on the sales, you can see, the
highlights going to be, the profits. So now the
mouse hover going to highlight both of the
worksheets. All right, guys. Now generally speaking about
the highlights in Tableau, there are different
options where we can add highlights or control
the highlight option. For example, if you go to
the quick menu over here, you can see that
we have an option to edit the highlights. If you go over here,
you can see that we can disable the highlights,
we can enable it. We can define which fields can be included in
the highlights. For example, if I
go over here and say, disable work Pook, highlights what can happen that the highlight action
can be disabled. In order to enable it,
we're going to go again to the quick action over here and enable the workbook highlights. So as you can see now, I can
highlight on those stuffs. And in Tableau, we can add highlights to the worksheets
or to the dashboards, if you go to the main
menu to the analyses, and then here we
have highlighters. If you go over here, we have
the subcategory since it is the only dimension
that we have in the dashboards or
those worksheets, Let's go and click on that. Now, if you check
the right side, we cut something like a filter, but it's not really a
filter, it is a highlighter. So if you click on
this box over here, you will get a list of all distinct values
inside the subcategory. Now what you can
do, you can just mouse hover on
those informations, and as you can see, the dashboards going
to be highlighted. So this is another way to trigger the action
highlights inside your dashboards or worksheets by adding the highlighter
on the right side. So for example, if I just
go and click on that, it's going to stay
highlighted all time since we have selected
this value over here. Of course, if you want to get everything back to the normal, you can go over here, click on the x and remove the value. With that, we got everything back without highlights.
All right, guys. So that's all about highlights
actions in Tableau. Alright, so that's all about
the action highlights. And next, we're going to
learn how to use actions in order to change the
members offsets.
85. Actions: Set: All right, so we go to another type of actions,
we have the sets. As we learned before
previously in the sets, it can split your
data into two groups, the in group and the out group. Now, the one who is creating the dashboard or the worksheets, go to define which member is going to be in and which
member is going to be out. But in order to make your
visuals more interactive, we can give these options
to the users so they can define which
members is going to be in and which
members going to be out. In order to do that,
we're going to go and create action sets. So first, let's create
a view and the sets. In order to do that, we're going to stay with the P data source. Let's take the sales
to the columns. Profit to the rows. And here in the
middle, we're going to go and get the customer ID. So with that, we
got data points, but we still don't
have any sets. But first, let's go and make
those points a little bit bigger in order to
understand the members. And then I'm just
going to go and change the shape as well to
be field circles. So that sets Let's go
now and create a set. In order to do that,
I'm just going to go and select
those top rights. Customers, and then
we go over here, and then we say create sets. All right? I'm just going
to leave it as it is. And with that, we
got on the data ban a new dimensions
for the sets. So now we're going
to go and add it to our view as the colors. So let's go and move it
to the colors over here. So as you can see
the blue going to be the n and the outs
go to be created us. I'm just going to
change those coloring. So let's go to the colors
and the n going to be, let's say the green and
the outs go to be the red. Let's go and hit apply, and. Now, as you can see, the one
who's creating this view is deciding which members are in
and which members are out. But now let's go and give
these options to the users. In order to do that,
we're going to go and create an action set. As usual, we're going to go to the main menu, the worksheets. Let's go to actions, and
let's add a new action. This time we're going to
use change set values. Let's go inside. And here, we have the usual stuff.
We have the source. What can I trigger the
action and the target? Let's just give it
a name. So change. Customer ID set. And then we're going to go
and define the source sheets. It's going to be the action
set that we have it, and then we have to
define the action. I'm just going to
leave it as select. The target is going
to be the target set. So in order to do that, we
have to click over here, and then we will get here all the sets that we have
inside our data source. In this example, we
have only one set inside the big data source. So we have it over here. Customer ID sets. So let's go and click on dots. And now here we have more
options about the sets. The left one going to be what
can happen to the set once the users start interacting
or selecting data points. And on the right side here, we have options about what
can happen once the users Clear the selection.
Once the user deselect stuff in
the visualizations. So now we know to
understand those options, we have to play
around those values. So on the right side, I'm just going to say, keep set values. So if I deselect anything in the view, nothing can happen. Now in this left group, we have assigned values to set, add values to set, and
remove values to sets. We're going to start
with the first one. So once the action is triggered, we can assign values to
sets. What this means? If you choose this one,
what table going to do go to empty the n group, and anything that you
are selecting going to be the members of the N group. Let's see what this
means. Let's go and hit O K, and then again. Again, here we have to select in order to trigger the action. As you can see, we
have those members are inside the group. Now, let's say that
I would like to select those four
members over here. Once I start selecting those
members, what can happen? Only those members going
to be in the n group. As you can see those
points are now out. That's means Tableau is removing everything and starting
from scratch and anything that you
are selecting can be the only members
of the N group. That's it for this option,
the selection going to define the members
of the n group. Let's go and change it
to the second option. Let's go to our action. The change customer ID. Now let's move to this one. It says, add values to sets. What can happen this time,
Tableau will not forget previously which members
were inside the group. Now we are just adding
new members to the sets. Let's see how this works.
Let's go and k and again. Now, currently we have those
four members in the group, and let's say that, I would
like to add two new members. Let's say that, I
would like to add those two members over here. Let's go and select them. With that, you can see, we
still have those members in. We just have added
two new members. That set, it's
really simple right. Let's go and try the last one. Let's go to the action and as well to the
customer change ID. This one, we can say,
remove values from sets. So now what can
happen, it can be exactly like adding new
members to the sets. But this time, anything
that you are selecting, it's going to remove those
members from the sets. Let's go and try that out. Let's go and hit k and again, ok. Let's say that, I would like to
remove this member from the N group and move
it to the out group. In order to do that, let's go and just select it
and click on it. So as you can see now it's red. And it is not anymore in
the group. So that's it. So this is about what can happen once we
trigger the action. But now, let's learn
about what can happen once we start the
selecting the action. So let's go to the actions over here and go back
to our set action. So on the right side, we
have here three options. Keep set values, add
all values to set, remove all values to sets. And so far we have always worked with the keep set values. That means if you
clear the selections, nothing going to happen. The members that you
have defined with your selection is going
to stay in the group. But the other two it's going
to destroy your definitions. So let's say that add
all values to sets. So if you deselect, going to add all
values to the group. So this option means if you dis select everything
going to be in. And exactly the opposite, we have removed all
values from sets. So if you dis select
everything going to be out. So let's go and select this one, add all values to sets
and try this out. So correctly, we have
those five members in the group and the t is out. And I'm interacting
with our reports, and I select this point to be
removed from the out group. So now, once I dselect or clear my selection,
what can happen, all the members are going
to be in the group. And the other option can
be exactly the opposite. If I deselect everything going to be red and
going to be out. All right, guys. So that's
all for the set actions. As you can see, it's
really nice feature where you're going
to give the users the freedom to choose which member is going to be in, which member is going to be out, in order for them to do focus
analysis instead of us, the one that is creating
the dashboards, so it really adds more dynamic and more interactive
to your views. Alright, so that's all
about the action sets. And next, we're going
to learn the last type, how to use actions in order to change the values
of the parameters.
86. Actions: Parameters: All right, guys.
Now we're going to move to the last
type of actions, we have the parameters. Again, here, we can use
actions in order to change the values
of the parameters. So now let's have an example in order to understand
how this works. Let's build now sales by months. Let's go and get the
sales over here. Let's go and get the
order date to the colons. I'm just going to change it
to the months over here. And let's go and add the labels. So now what I would like
to build in this view. As I'm like selecting
data from the view, I would like to get the
total sales of my selection. So whether I choose one point or I choose different
group of points, I would like to get the
total sales of my selection. Now in not to do
that, we're going to go and create another worksheet where we want to show the
total seals of our selection. Let's go and create
another worksheet. The first thing that
we have to do is to go and create a new parameter. Let's go to the data pain to
the empty space over here, right it click on it and
then create parameter. Let's give it a name. It's
going to be the total sales. So inside this parameter, we're going to have the total
sales of our selection. So we're going to have the data type floats, the
display formats. Let's move it to a
currency standard, and the current value
can be let's say zero instead of
one. So that's all. Let's go and hit or K adicli
on it show parameter. Currently, it's zero and
nothing in our view. So now, I would like to have
one sentence here, it says, total sales, and then we can have the value of the parameter. In order to do that,
we have to go and create a new calculated field. So let's go over
here in this arrow, create a new calculated field. So in order to do that,
we're just going to go to our parameter
from the data pane, drag and drop it to
our calculations. So why we are doing this
because we cannot use directly the parameter in
our aggregations or in our view. So we always have to
create a new calculated field, and inside it,
we're going to have the value from the
parameter. So that's all. Let's go and hit ok.
Now on the left side, we have a new calculated
field, our new measure. Let's go and put it inside
the text over here. And as a default, we
can have it as a sum. So as the user are
selecting different points, we're going to have the
sum of all our selections. So this aggregation is correct. But now here in the
view, we have only zero, but I would like to
have a sentence, total sales, then the value. In order to do that, let's
go to the tex over here, then to the three
points, and now we have a new window where we're
going to customize. Text. We're going
to say total sales, and then we have the value
of our new calculated field. But let's just make
everything bigger. Total sales, let's move it to 20 and the parameter or
the calculated fields, it's going to be as well 20, and I would like to
make it more bold. That's all. Click Okay. Can see, we have total sales
and the value is zero, which comes from the parameter. Now let's go and change this
value to, for example, 100. Now as you can see, we got
the total sales of 100. Now, I would like
as well to change the format of the total sales. Let's go to our calculated
field. Rad click on it. Then let's go to formats. Then here on the left
side, we have numbers. If you click on the options, we can go to the
currency standards, and then let's move
to United States. It's going to be
somewhere over here, English, United States, and with that we got
the dollar signs. All right, Now the
next step is that, I would like to bring
everything in one dashboard. So both of the worksheets, Let's go and create
a new dahward Let's get the total sales, and then we're going to
get the sales by month. Let me just make it
a little bit bigger, and let's remove the title
from the total sales. So now, as you can
see, the total sales, value comes from the parameter. So now so far, everything
is disconnected between those two worksheets and thing
that I'm selecting here, it will not be reflected
inside the parameter. So now here comes the magic. I would like to change the
value of the parameters depending on my actions or my interactions from this view. So in order to do
that, as usual, we're going to go
to the main menu over here to the dashbords. Then let's go to the actions. Then let's add a new action
and choose this option. Change parameter values.
Let's go inside it. So here we have the usual stuff, the source, the trigger,
and the targets. Let's give it a name change
parameter total sales. Let's define the source. It's going to be
the sales by month. Let's just remove the
sheet seven from here. The sheet seven is
the total sales, and then the action
going to be the select. I would like to
select and trigger, the action, and then here we
have to find our parameters. So we have only one. So the total sales,
let's select that. So on the right side,
what's going to happen once we clear
our selections. So I would like to say, okay, let's set it to zero if the users are not selecting
anything. All right. So now with the last one, we
have to do five for Tableau, which field going to control the values of the parameters. By the sales by month, we have different informations. As you can see over here, we have the month and we
have the sum of sales. Of course, the sum
of sales going to be controlling the values
of the parameters. So let's go and select
this value over here, and the aggregation
going to be the sum since we are finding
the total sales. So that's all for now. Let's go Then again. Now, as you can see, we have the 100 value
comes from the parameters. But if I select, for example, these data points over here, you can see that the total sales comes from my
selection, the 64,000. Now if I go and select all
those values from the view, Tlax can go and summarize all those sales
from my selections, and put it in the
parameter value. So with that, we have
connection between the parameters and our
actions to the view, which gives a lot of dynamic and interactivities to
your dashboards. All right, y. So that's all
for the parameter actions. It's really nice
feature in Tableau. Alright, so that's all
for the action types. And next, I'm going
to share with you my tips about the
action triggers.
87. Choose The Correct Trigger: All right, guys. Now, I would like to give
you quick tips about when to use which type
of triggers of actions. For example, if you
want to jump from your worksheets to
another worksheets or to go to an external website, it's better to give the
options to the users to select this
option using menu. First, show the menu, slit the users see the link, and then if the users
wants to go there, they're going to select
the link and click on it. It's always better than to surprise them by
select if the users like select on something and suddenly you go somewhere else. It's really not nice.
So go with Menu, if you go to URL or go to sheets. And if you are
using filter action, the best way is to use select. It's like more interactive. So once a user starts
selecting from one worksheets, the other worksheets
can be filters. So I usually go with select if I'm using the filter actions and table used as well as a default if you are
using a quick action. So for filter action, I usually go with select, For the last one,
the highlights, I really recommend you
to go with the hover. As the users are most hovering
inside one worksheets, the other worksheet is
as well interacting. It's really nice and
more like modern. Really be careful
about when and how to trigger which
actions don't surprise your users by jumping
somewhere else if they are using go
to RL and sheets. Be careful, talk with your users about it how they
would like to see it, and then maybe together
make a decision about the interactivity and actions
together with the users. All right, so that's all
for me about actions in All right, so that's
all for the tips about the action triggers, and with that, we have completed this section, the
tableau actions. And in the next section, we're going to cover a
very important topic in Tableau, the tableau
calculations. We can learn there how to
manipulate the data in Tableau, and we can learn many
tableau functions.
88. #12 Section Introduction | Tableau Calculation: Table calculations.
We will cover now over 60 different functions in tablelo in order to
manipulate your data. You will not only understand how to use all those
table functions. Also, you will understand the
concept behind them using very simple sketches
and examples in order for you to understand how those table functions works, cause some of those calculations
are really complicated. So we will start
first by covering the basics about
table calculations, and then we can dive into the most used functions
in the four category, row level calculations,
aggregate calculations, LOD expressions, and
the table calculations. So let's start first by
having an introduction to the basics of tableau
calculations. So now, let's go.
89. Introduction to Tableau Calculations: All right, everyone. So
now we're going to talk about the calculated
fields in Tableau, and we're going to start
with the first question. Why do we need calculated
fields in the first place? As we learned before, as we are building our visualizations, we always go to the data
pane to the data source, and we grab those fields
that we see to the view. So now let's imagine
that you are in scenario where you need
extra information, informations that are not
available in our data source. Or you would like to
manipulate and transform those informations to new
information to new fields. Let's say that we are building a very complex
logic in our views. For all those scenarios, we can go and create a new calculated fields in Tableau to be placed
in our data source. Calculated fields in Tableau are user defined fields that are created using formulas
or expressions. There are additional
fields that you can create based on the original
fields in the data source. All right, everyone. Now we're going to move to
the next question, how to create new calculated
fields in Tableau. There are five methods on how to create calculated fields. Four of them are globally. That means once you create
the calculated field, it's going to appear
on the data source on the data pane to be reused in any other worksheets or in any workbook that is
connected to the data source. We have one local method
in order to create one calculated field only from one view and we call
it quick calculations. Now let's go and explore
those five methods. The first way to create
a new calculated field, we can go to the data
pane on the left side, right click on the white space. Right click over here, and the first option is
curreate calculated field. Once we go over here, we get a new window where we can
write our expression. That's it. This
is the first way. Let's move to the next one. I'm just going to close this. If you go over here, we have a small arrow
near the search. If you click on it, we will
get exactly the same list. So as you can see,
the first option, create calculated field. The third way in
order to do that, if you go to any of those
fields inside our data source, let's say that we go
to the addresses, write a click on it, and then here we
have the option of curreate The first one called
Create Calculated Field. Once you go there,
we're going to get exactly the same window. But this time,
we're going to get the field name prepared
in the expression. Because here we went
specifically to the address and we create from there a new
calculated field. Let's close this, and
I'm going to show you the first method in order
to create calculated field. We're going to go
to the analyses in the menu over
here. Click on that. And here we have the option
of create calculated field. So once we click on that, we're going to get again
the same window. So those are quickly the four methods on how to
create a new calculated field. You will get always
the same result. Only if you go to
the field and you go from there and create
calculated field, you will find the field
name inside the expression. So now let's go and call
it my first calculation. And I'm just going to
give anything here inside the expression,
let's just type one. Let's go and hit.
Now we can see on the data bin that Tableau did
create for us a new field. It is like a field
like any other fields that we have on the database
in our data source. It has as well a data type. It is continuous
measure because I enter the one, so
it's like a number. You can treat it exactly
like any other fields. But here to understand
which fields are calculated and which
fields are original, you can see on the
icon over here, it has the equal sign. That means if you
see the equal sign near the data type
icon in any field, That means this field
is a calculated field. It is not original field that
comes from the data source. Someone went and created
this calculated field, and it is based on
the original data. With that, you can
quickly identify which fields are
original data that comes from the source
systems and which fields are calculated fields
created from the users. So with that, we have created
our first calculated field, and it is a global field. That means if you go to
any other worksheet, let's go for example to new one. We can find again our
calculated field. Now let's move on
to the next method where we're going to create
a local calculated field, relevant only for one view. In order to do that,
we're going to have first something
on the view. Let's take, for example,
the customer's first name and put it on the rows. Now in order to make quick calculated field
locally for this view, we're going to go inside the
field inside the dimension, and we can do that
by double clicking. Once you do that, you can
see we are now allowed to write something
inside this field, and we are writing now
the calculated field. Let's say that's
okay, we have now capitalized letters
of the first name, and I would like
to manipulate it and transform it to upper case. I would like to see
everything as an upper case. In order to do that, we have the function in
Tableau called upper. So now I'm writing
the function name. And it's going to
transform the first name. So that have created calculated field
inside the first name. Once you go outside, click somewhere outside
or click Inter. Now we can see on the
results that this function did change the first
name to Abercse. What that we have done
a quick transformation, quick calculations
inside the view, and if you grab the first
name again from the data bin, you can see that
nothing's changed. We didn't change anything
on the data source. We just changed it
quickly for this view. This is how we can create
quickly new calculated field in the view without
affecting the data source, and it's going to be locally
only available in this view. Now, let's say that this transformation here
is interesting, and I would like to reuse it somewhere else
in other viels. Now in order to make it available in our data
source, what we can do, we can grab this field from the visualizations and just
put it on the data source. So let's release. So with this, you can see that Table added a new field inside
the customers, and we know this is calculated field by checking the data type, you can see we have
the equal sign. So Table offer us
here to rename it. I would like to
leave it as it is. And if you go inside it in
order to edit the calculation, radical and edit
the calculation. And again, we got the window. Where we can configure the
calculation. Alright, Kai. So that I've showed you all the methods on how to
create a new calculated fields in Tableau. All right. And the next step, we're
going to go and learn the basic options that we have inside the calculated window. So let's go to our
calculated field, my first calculation, and first, let's show the
value in the view. So let's drag it to
the text over here, and as you can see, we
have the value number one. So let's go and edit the calculated field in
order to get the window, right it click on it, and
let's go to the edit. So what do we have
over here? First, we have the name of the
calculated field, and we called it in this
example, my first Calk. But of course, you can
go to the data pane or the data source and rename
it directly from there, or you can do it inside
the calculated window. Okay, the next information, we have the name
of the data source where we are creating
the calculated field. In this example, we created the calculated field inside,
the small data source. This is really
important if you have multiple data
sources and you are creating a lot of
calculated fields. It's really nice to
know where I'm creating now this calculated
field. So it's nice info. Now moving on to the most important section
in this window, this white area
where you can write your expression to define
the calculated field. Currently, we have one, but we can go and use different stuff. We can use the field names, parameters,
functions, and so on. For example, we
created last time. The upper function
for the first name. With that, I have to find what should be done inside
this calculated field. This is my expression. And now, don't worry about
the syntaxes that I'm writing inside the expressions because
in the next tutorials, we're going to learn everything
about the syntaxes about difference functions in Tableau, don't worry about it now. Next information that
we have is we have the info of the
calculation is valid. Here Tableau gives us a
quick information whether the expression that I just
wrote is valid or invalid. Currently, I wrote the
calculation in correct way. That's why we have everything
fine from Tableau. But now let's make
something wrong. Now we will get a red
message from Tableau saying the calculation
contains errors. And here we have small arrow. If we go over here,
you'll see the message, it says, Tableau is expecting
here a closing parenthesis. Here Tableau show
us a quick message to know what's wrong
in our calculation. If I go and add the parenthesis, you can see that the
calculation is valid. So we have quick
info from Tableau. Moving on to the
next information that we have in this one, it says one dependency
and small arrow. Let's click on that and
see what we have here. It says, changes to this calculation might
change the following sheets. Sheet number one. Here
table gives us a warning. Anything that you
are changing in the expression inside
this calculation, it might has an effect
on the sheet number one, and that's because we are using this calculated field in the view in the
sheet number one. This is very important
information, especially if you have different
work sheets and you are using the same calculated field
in different work sheets. This happens a lot,
especially if you are focusing on the content of one view and you go and
change the calculated field. Here it's like a reminder a
warning from Tau tells you, if you do this change, you can affect the following worksheets. Recommendation for you is always to go and check
the dependencies to make sure that
the changes that you are making currently to
the calculated field, it is still relevant
for the other sheets. Alright, so moving
around, we have two simple buttoms
that apply and okay. I don't have to talk
about it, I think. Then we have here a small arrow, and this is very important. So let's go and click on
that. What do we have here? This extension is
documentations or a catalogue of all the functions
that we have in tableau. So, for example, let's
go and search for the function upper that
we use in this example. So Search for upper, and now we can see
on the right side the documentation
of this function. So here we have three
informations from Tableau. The first one is the
syntax of the function. Syntax it starts with
the upper keyword, then it accepts only field, and the data type
should be a string. The next information we have is short description
of the function, so it says it's going to convert a text string to all
upper case letters. The third information, we
have an example of yours. So here it says, if you have an upper for the value product, everything in lower case, the output the result can
be a product in upper case. So here we have a nice, short, quick descriptions about all functions that
we have in Tableau. And this is very useful, especially while you are
writing the calculations because it doesn't make sense to memorize everything right. I tend as well always to
check whether I'm using the correct syntax or even a using the correct
like functions. So I always check the
examples and say, Okay, this is the
one that I need. One more thing that you
can see in this window, this drop down menu, and here we have different groups of
functions in tableau. For example, we have here the
group of string functions. If you go inside it,
you will get a list of all functions that's going to manipulate the string fields. So we have here at the
end, as you can see, the upper function that we
use in our calculation. All right, K. So
with that we have covered all the options that you can see inside the window
of calculated fields. All right, so that
was an introduction to calculated fields in Tableau. And next, we're going to
learn the basic components of tableau calculations.
90. Based Components of Calculations: All right guys. Moving on, we're going to talk about
the basic components of calculations in Tableau. That means what kind
of information we can add inside the expressions
inside the calculations. The first thing that we can add inside the calculation
is the comments. Comments are really useful for you and for the others to have some context or
small descriptions why you are doing
the calculation. For example, in order to
add comments to this code, we can go on the start and we have the forward two slashes. Then we can write anything. Anything after the
forward two slashes will not be executed
in the calculation. For example, we can write here. Calculation to
change first name. Upper case. So anything I'm writing over here will not
be executed and as well, will not be checked
from Tableau. I really recommend
always to add comments. So for you if you visit
this calculation later, you understand why you write
this expression. All right. Moving on to the
second information that we can add inside the calculations that are the fields from the data source. So those are the orange colors. So we have it over
here the first name, but let's just remove
everything as s from scratch. If you want to add a new field inside this calculation field, you can start writing
the field name. As I'm writing now, Tableau can make a
list of suggestions. Here Tableu defined
three things. The first one is a function. As you can see, there is
a small icon like an F. This indicates that this is a function or the
second information, it says the first name, and beside it, there
is a data type icon. This data type icon can
indicate this is a field name. The third information
is as well, the first name with the icon. So that means it is field. But here Tableau writes it. This is from the big data source because those two fields
has the same name exactly. So here Table show for us that this field comes from
different data source. The first one comes from
the same data source. That's why Tableau don't
have to say, okay, it is from small data source because it is from
the current one. But since the second one comes from different
data source, To indicate that this is a different field from
different data source. Now, since we won the first name from the current data source, we can go and select
this one over here, and with that, we have inserted a field inside our calculations, and as you can see it
gets the orange color. Another way to add fields
inside our calculations, and that is by drag and drop. Let's say that, I would like to get as well the last name, so I can go to the
last name over here, drag and drop it inside
the calculation. You can see with that,
we got our second field, and again, it is
the orange color. Of course, the fields
that we are add to calculations could
be an fields, ample. Let's go and add the sales. The sales is a measure. We go to the orders
and we have the sales. We can just drag and drop
to the calculations. So you can see tableau accept as well measures inside
the calculations, and they can have as
well the same color, the orange color. All right. Moving on to the next and
very important component, we have the tableau functions. Tableau functions are built in operators that could be used in order to manipulate to transform to change the content
of one field. For example, what we
can do with the sales? We can go and calculate the
total sales inside our data. In order to do that, we
can use the function sum. Before the field sales, we can start with the sum, and then we have the open
apprentices and then closets. As you can see this component, those functions in Tableau have always the color of light blue. So now what can happen Table
going to go and summarize all the values inside the sales and presented
as the result. Let's go and he or care. We're going to get an
error here because we have changed the calculation. Let's go and remove it, and let's get it again
in the text so that we got the total sum of
sales inside our data. Now let's go back to
our calculated field and see the next component. We have the logical expressions. We can use the logical
expressions in order to check whether a condition
is true or false, and they have as well
the color of plaque. For example, let's say
that we want to create the calculation where we are
checking the sum of sales. If it is higher than 1,000, then we want to see the
value high at the end. Let me show you how
we can do that. We're going to use
the F statement. It's going to start with
the keyword F. As you can see it is black because
it is logical expression. If the sum of sales
is higher than 1,000, we're going to use here
the operator higher greater than 1,000, then
what's going to happen? Have the value high. Then we're going to go and
end the logical expression, and we can check over here
that the calculation is valid. So here we have our
logical expressions, F, then and d. Don't
worry about the syntax. We're going to learn everything
in the next tutorials, step by step with
very simple examples. All right. So now
we're going to move to the last component that we
can add to our calculations. We have the parameters. Parameters are like dynamic
fields so that we can add to visualizations in order to make everything dynamic in the
views or the calculations. Again, there will be a dedicated
tutorial for that later. But now let's see, we can add the parameter field
inside the calculation. So first, we have to create
quickly a parameter. In order to do that,
I'm just going to close our
calculation over here. And then we can go to the
arrow and the data pane. Then we can have the
create parameter. Click on that. Here,
we're going to get the window in order to
configure the parameters. We're going to call
it, choose a number. That's it. Let's close
it and say, okay. Now on the left side,
we've got a new parameter, right click on it
and show parameter. What that we got on the
right side and input field, where you can add a value. For example, we have it now
as a one, we can add like 1,000. Now nothing can happen in the view because
we don't have anything, but we're going to go and add this parameter inside
the calculation. Let's go back to
our calculation, my first calculation,
right click on it, and then go and edit. Now what we're going to do
instead of having 1,000, we're going to get the
value from the parameter. We make a dynamic
calculated field, so the user is going to go
and control this value. Let's go and remove the 1,000
and we're going to start writing the name of the
parameter like any other field. It's going to be choose
and we get it over here, click on that and with that, we have added our parameter
inside the calculation, and as you can see, parameters in Tableau has the
color of purple. That's it for the last
component, and with that, we have covered all
different components that is possible to be
used inside calculations. Now let's go and try the output. I'm going to go and hit ok. And then I'm going to
remove this one, it's red. Let's get the products. To the rows. So next, we can go and get our
new calculated field. This time, it's going to
be a dimension because the output of the calculated
field can be a string value. Let's check the results, and as you can see over here, we have two products with the value high. There
is going to be null. Now let's go and get
the sales in order to understand why
those values are high, and that's because
of our calculation. So anything above 1,000, we can get the value high. Anything below, it can be null. And with the
parameter, the users are controlling the calculation. So if I go over here and say, instead of 1,000,
let's have 500. So with that we have included as well, the other products. So all the products now has the high value in the
calculated field. So with that we have
generated new information to our visualizations.
All right, guys. Now let's quickly summarize the components of
the calculations. In this example, first,
we can see the comment. So this comment is
going to help us to document the purpose
of the calculation, and it will not be executed. It's going to be as
well in the gray color. The next component,
we have the field. So any field inside
our data source, whether it's
dimension or measure, we can add it to our
calculation like this one, we have the sales, and they
have the orange color. The next component, we
have the functions, they are the build in operators in order to manipulate our data, and they have the blue color. The next component, operators. In this example, we
have two operators, the plus the
arithmetic operator, and as with the
comparison operator. It is the higher than, and they're going to
have the black color. The next component, is going to be as well with
a black color. We have the letter expressions. Those are static values that we can insert inside
our calculations. It could be a number like here ten or it could be string
like here the high. And here, don't forget to add the double or single
quotation marks, in order for Tableau
to understand, this is a value, not field or a parameter or function
or anything else. And we can add as well
date values. All right. Moving on to the next component, we have the logical expressions. We have F, then and they
can help us in order to evaluate conditions
inside tableau and then to decide whether
it's true or false. And the last component
that we have inside the calculations, we
have the parameters. They are the dynamic fields that we can use inside calculations. All right, so that's all about the components of calculations. Alright. So with
that we have learned the main the basic components of the tableau calculations. And next, we're going
to learn how to nest one calculation
into another.
91. Nested Calculations: So I'm going to talk about the nested calculations
in tableau. In tableau, you can nest calculations by
using the result of one calculations as an input
for another calculation. And that's because sometimes you might be in
situation where we have complicated calculations
with different steps. So for each step, we can
have one calculation. So as you are
implementing those steps, you're going to end up having
multiple calculations, and they're going to be
nested inside each other's. So now, let me show
you an example. Alright, now we're
going to go and create a new calculated field to manipulate the values of the field country to
have specific format. So in this example, let's
take the first name of the customers and as
well the countries. Now we're going to go
and create a new field for the country with
different format. Let's go and create a
new calculated field. And then we're going
to start with the first calculation where we can make all the letters of the field country
with the upper case. So we're going to
have upper function. And then we're going to
manipulate the field country, so we're going to
start writing country. And here it is our field. So that sets for the
first calculation. Let's go and hit OK. So that T going to go and
create a new calculated field, new dimension inside
our data source. Let's go and check the
values. As you can see, the litters all the countries are with the upper
case. All right. So now we're going to
move to the next step in the transformation
where we want to show only the fair
three characters of each values inside this
new calculated field. So in order to do that,
we're going to go back to our calculated field, and
we're going to edit it. And this time, we're going
to use the function lift. So you can go and
search in the catalogue to see the syntax of
the lift function. As you can see it
except two fields. The first one is going to be the string that we want
to manipulate. Then we're going to
have the number of characters that we want to show. Let me show you now step by
step how we can do that. Let's go first to a new line, so we're going to have left. Then it needs two arguments, the field that we
want to manipulate and the number of characters. The field that we want to
manipulate is going to be the result of
the upper function. It's going to be
this one over here. I'm going to just cut it. And inserted over here. So with that, we have
the first argument. The second argument
is going to be the number of characters
that we want to show. It's going to be
three characters. That's why we can specify three. So this is how we can st
functions in Tableau. The first function
to be executed go to be the one inside. So the upper function going
to be executed first, and then the result of this function going to
be used as an input, the function outside
for the function lift. That means first, we're
going to go and make all the values inside the
country as an upper case. Then we're going to go and
execute the lift function, where we're going to show only the first three characters. Now let's go and hit apply
to check the results. With that, you can
see, we have now only three characters inside
the values of the country. Again, the function inside is
going to be first executed, then the function
outside, and with that, you can further expand this calculated field
to more functions. For example, let's
say the third step we want to go and calculate the
length of the characters. In order to do that, we
can use the link function, so we're going to
add it as a starch, and then the input
of the field can be the output of
those two functions. As you can see, it's very easy to st functions in tableau. Let's go ahead apply
and check the results. As you can see everywhere
we have the links of three. Again, the order of execution
going to be the one just deep inside
the upper function. Then the left function,
then the last one to be commuted is the link
function. That's it. This is one method on how to create nested
calculations in Tableau, but there is another
method on how to do that. That's by creating a
second calculated field using the first
calculated field. Let me show you what I
mean, we can go and close this one over here and let's create a new calculated field. We're going to call it
second calculated field. What we're going to
do inside it is to use the output of the
first calculated field. This example, it is the country. This is our first
calculated field, and then we're going to multiply it with two, for example. So here, again, the order of
the commutation going to be first do has to calculate
the first calculated field. So we can calculate the
upper left and link. And then at the
end, it's going to come over here and
multiply it with two. Let's go and hit. And with that, we've got a new
calculated field. Let's track and drop
it on the view. So as you can see,
there is going to have the value of six. Window I use the first
mesode and window I use the second mesodeight I'm going to show you how I
use your decide on this. Let's go to the our
first calculation, and as you can see those
intermediate steps. They are not important steps, you don't want to use them
in any other visualizations, then it doesn't make
any sense to create for each intermediate steps a
field inside your data source, then the data source can explode
and you're going to have a lot of fields that
are not necessary. In this situation,
I'm going to have all those intermediate
steps in one calculations. But there are another
scenario where you have a very complex calculation where the code going
to be very huge, and it's really hard to maintain everything
in one calculations. There I try to split
it into steps and each step going to have one
field in the data source. The last scenario where
those intermediate steps are really important
for something else for different
visualizations or maybe as well for any other
different calculations. In order to not
repeat myself and doing the same calculations
over and over, I go and create a
dedicated calculated field for each intermediate steps, only if they are important. All right, guys. That's all
for the nested calculations, and that was an introduction
to calculations in Tableau. They are really important to
make great visualizations, and don't worry on
the next video, we're going to
learn more and more about calculations in Tableau. Alright, so with that,
we have learned how to do nested calculations
in Tableau. And next, I'm going to give
you an introduction to the four types of
tableau calculations. We have the row level
aggregate table and LOD calculations.
92. Types of Calculations: In Tableau, we have many
different functions that we can use inside
the calculations. And in Tableau,
we can categorize them into four different
types of calculations. In this tutorial, we're
going to talk about them. But first, we can have a very simple example to understand how they work and how they interact with each
other's. So let's go. All right. Now, let's
say that you have the following product table inside our data source where we have information
like the product, prices, quantities, and so on. Those data are the original data that we can find inside
the data source. Now let's say that we
need a new field inside our data source to show
the data of their revenue. In order to do that,
we can simply create a new calculated field
where it's going to multiply the prices
with the quantities. Now with that table
going to go and create a new field inside
our data source, to store the result of the
calculations inside it. Table going to go row by row by multiplying the prices
with the quantity. So for example,
for the first row, it's going to
multiply 20 with two, and table going to go and
store it at the new field. Then table can jump to the next row and do
the same exact thing. So as you can see,
table is processing each row individually and
independently from each others. When the calculations is
happening on one row, we don't care about
the information that is present in
the other rows. Table can focus only
on one row at a time. This type of calculations, we call it row
level calculations, and the level of details we
have it here is the lowest. So we have level of detail
from the data source. It's very important
to understand that this type of
calculations is the only type that
will not go and aggregate the rows
of the data source, and as well, the
only type that can store the results
and the data source. That means T will not go and calculate the result
of these calculations. Each time you are using
it in the visualizations, so it's going to precalculated and store it in the data source, and the calculation will not be done on the
fly. All right. So now let's move to
the visualizations, and let's say that, I would like to show the total
revenue of each product. For that, we can use the function sum to summarize
the values of the revenue, and we can go and add the
dimension product to the view, and table here is going to show only three rows in the view, a row for each product value. That means we're
going to have P one, P two and P three. Now, this time table will
start summarizing and aggregating the rows
in the data source. That's going to be at the
level of the dimension. For example, table can start for the first
product, the P one, and table can summarize the first two rows
from the data source. We have 40 plus 60, tablet add the output 100
directly in the visualization. Then we're going to
move to the next row. We have the P two. Here we have only one
row at the data source, and the summarize of
that is going to be 20, for the product three, the P three, we have here
three rows in the data source. The summarization of
40 plus 25 plus 15, Table going to have the answer
80 at the visualizations. This time, as you can see to
is not processing the rows of the data source one
by one and individually. Instead, table going to
go and summarize group up the rows of the data source
at the visualization level. This type of calculations, we call it aggregate calculations, and it's going to be
calculated on the fly. That means the result
of these functions of those calculations will not be extra stored inside
the data source. And now it's very important
to understand the level of details of this new table
that we have, in the view. It has lower level of
details as the data source, and the one who
controls the level of details is the dimension
that we have on the view. So the dimension that
we use in the view, going to control the level of details for the
aggregate calculations. And that's why we
have another type of calculations because of that. Let's say that we have another scenario where you
say, You know what? I would like to control
the level of details. I want my calculations to show the total revenue
of each category. So here we can use
different functions like the fixed function, so we're going to
have fixed category, and then some their revenue. So that we are telling Tau. Find the total revenue, but this time it's
going to be fixed, it's going to be connected
to the dimension category. So let me show you
what can happen. Table going to go
and check, okay, what is the category of pay one? It is the category A. And now the next question, what is the total revenue
of the category A? Here Tableau can summarize
40 plus 60 plus 20, and the result can be 120. And here table will not show the total revenue of
the product pay one, but instead of that,
we are showing the total revenue
of the category, A. The same thing can happen for the next product, we have p two, it belongs to the
same category to A, so the total revenue of
category A is again 120. And then the last
product, p three, it belongs to different category
this time to category p, and the total revenue of that
can be 40 plus 25 plus 15. The output can be 80 as a total revenue for
the category B. So now who is controlling
the aggregations, it's not anymore the dimension
that we have on the view, but instead, it's going to be the dimension that we
specify on the calculations. This type of calculations, we call it L O D expressions, level of details expressions. And here the same thing
like the aggregations, It's going to happen on the fly. Nothing going to be stored
inside the data source. Alright, so now moving on to the last calculation type
that we have in Tableau. Let's say that after I got
the result in the view, I would like to
calculate the rank of the products based on the data that is
displayed in the view. And in order to do
that, we can use the function rank of the
summary of the revenue. So what can happen this time, Tapl will not go and
query the data source. Instead of that, T can go and query the
visualization itself. So it's like we are
aggregating the aggregation. So based on the value that
is displayed on the view, we can find that
the product one, P one has the rank one, then P two has the rank three, and P three has the rank two. These type of calculations, we call it stable calculations, and it is unlike
all other types, it is based on the
context and on the data that is
displayed on the view, and it will not go directly
and query the data source. It is as well
commuted on the fly. That means, result will not be stored inside
the data source. And if you are talking
about the level of details, it depends as well on
the visualization. So it can depend on the
dimension products. All right, guys. So that we have now
a big picture about the four different types of
calculations inside Tau, and we can see how
Tableau can compute the calculations and present the data at the end
in the results. All right, so we're
going to start with the first type of calculations. We have the row
level calculations. And here we have a
lot of functions under this category if you
compare to the other types. So here we have the
number functions, string date, null,
logical functions. There are a lot of functions, but we're going to cover them
all in the next tutorials. So now let's go in Tableau and try a few of those calculations. Okay, so now back to Tableau, we're going to go to
the small data source, and then we're going
to go to the orders. As you can see, we
have here the quantity and as well, the unit price. Now we're going to go and
calculate the revenue, where we're going
to multiply the quantity with the unit price. To do that, we're
going to create a new calculated fields
in the data source, and this going to be row
level calculations type. So let's go and create a
new calculated fields. We're going to go to
the data pan right click on the empty space, crereate calculated fields, and let's give it
the name revenue. And then the formula
for this going to be quantity multiplied
with the unit price. Now you might ask me where
do I find in Tableau all the functions
that are related to the type row
level calculations. Well, there's no
specific place for that. But there's like
orientations for it. So if you go to
the documentation over here and check
those groups, you will not find directly the
types of the calculations, but you will find some groups that are similar to those types. For example, if you
can see over here, we have the table calculations. If you go inside
it, you can find all the functions that we
could use in this type. And then we have another
group called aggregate. And you will not find only
the aggregate calculations, but as well, you will
find the LOD expressions. The last one, the last type is the row level calculations
is actually the rest. So all other like the number, string data type conversions, all of those stuff are row
level calculations. All right. So now back to our calculations. Let's go over here and hit. And with that, you can see
that table did immediately create a new field
in our data pane. Now, as I told you, if you are using row level calculations, Dub log and do the pre
calculations and store the results immediately in the data source. Let's
go and check that. Either you can go to
the data source page or we can go to this
small icon over here. It says view data. So let's go inside and
check the results. Here we have to
switch to the orders. And now let's scroll
to the right. You can see we have
the original field. We have the quantity and
as well, the unit price. But we have as well, our
new calculated field, which is like any other field that we have in the data source. We have the revenue over here, and as you can see table
did immediately stole all the results of this calculated field in
the data source. Even though that
we haven't created anything yet in the
visualizations. So that means tabled prepared
for you in the data source, and we can check the
result, for example, here, we have the quantity one,
the unit price, 215, we're going to get
the same course, and here the things are
multiplied with two. As you can see, we
are now multiplying the quantity with
the unit price. Now we can see very
clearly that the role the calculations will be
calculated and performed. On the row level individually and independently
from each others. So the information that
we have in the other rows will not affect the
calculations of the first row. All right, guys. So that's it. This is how the row level
calculations works in Tableau. Okay, so now we're
going to move to the next type of calculations. We have the aggregate
calculations. And here we have
few calculations if you compare to the
role level calculations. We have Max Min average count count distinct sum
and attribute. Again, all of those can be covered in details
and nextoorials, but now we're going to go in Tableau and try a few of them. All right, everyone. So now we're going to
go and build a view where we have the total
revenue by products. In order to do that,
we're going to go and get the product name from
the small data source, and let's put it in the view. Now, it's really important
to understand the concepts. So now the product name
is the dimension that can define the level of details
in the visualizations. So that means in this view, we have five rows, and this is completely
controlled by the product name. So now I want you to understand
how to pick which type of calculations we're going to use now to answer this question. We start always with
the first question, do we have to
aggregate the data? Since the task saying,
the total revenue, that means there's an
aggregation and summarizations. Well, that means we cannot use the row level calculations, then we have to use the other
types for aggregations. Then we are left with
the three types. Now, the next
question going to be, do we have all the
data in the view? Well, as you can
see in our table, we have only the
dimensional information. We don't have anything
about the revenue. So that means no, we don't have all the data
inside the view, and that's going to
mean we will not use table calculations type because the table calculations types
always depend on the view. So if you don't have
the data in the view, you cannot use
table calculations. With that, we are left
with two options. Either we can use the
aggregate calculations or the LOD calculations. Well, the last
question you can ask, does the level of
details that we have in the view can fulfill
my requirement? Well, in this example, yes, because we want to have the
total revenue by products. So we are talking
about the products and the dimension that we have inside the view exactly fulfill the level of details. That means we can stay with the level of calculations
that we have inside the view
and we don't need to use any LOD expressions. If you follow those
three symbol questions, you can easily
identify which type of calculations you need
to solve your task. In this example, it's going to be the aggregate calculations. Let's see how we can do that. Since the aggregate
calculations are the default methods
in Tableau in order to aggregate any
data or any measure, it's going to be
really easy to create. All what we need is the revenue, drag and drop it here on
top of those numbers. With that, table going to create immediately and
aggregate calculations. We can see it over here
the sum of their revenue, and that's because it is the default method
on aggregating data. Table goes for each product
inside the data and start aggregating all the revenues that are related
to these products. Now the next step
what I usually do, I go and validate some examples. I go and pick some
of those products and start summarizing
the value to check whether the value that I'm seeing in the
visualizations is correct. Let's go and create a e sheets. Here we want to go
to the lowest level. In order to do that, we're
going to take the order ID, the view, and let's take
now the product name. We can take the
categories as well. Then let's take the revenue and put it on the APC over here. Let's make it a
little bit bigger in order to see the names, and then we can go and
sort the product names. So now we can go and pick any of those products in order
to validate the answers. Let's take the LG F HD monitor, as you can see the total sum
should be more than 3,000. Let's go back to our aggregations
and check the LG f HD. You can see it is
about the 3,000. That means everything is fine, and with that we got the
total revenue, by products. And of course, we have
done this in the quick way where we drag and drop
the field to the view. But if you want to do it
as calculated field in order to reuse it later
in different sheet, we can go and create
new calculated fields. Let's call it total revenue, and then we're going to
have the same syntax. So the sum of revenue. At this time, we're going to
use the nested calculations. So we have it already in
another calculated field. So let's go and click on that. And as you can see the
calculation is valid, let's hit ok, and we got with that a new measure
in our data pain. So if you go and replace it, you will get exact results. So as you can see in the
results, nothing changed. The only advantage
to you this is, reuse it in different sheets and as well different
workbooks. All right, guys. So that's all for the
aggregate calculations in Tableau. All right, guys. The third type of
calculations in Tableau, we have the LOD calculations or the level of
details expressions. And here we have only
three tau functions. We have the fixed,
include and exclude. Now let's go in Tableau and create one of those
functions. All right. Now we have the following
task where we want to show the total
revenue by category, but using the same view. So we're going to stay with
the same informations. We can have the product name. We're going to have the total
revenue by the products. But I want to see side by side. The total revenue by category. So let's go again through
the three questions. The first question, are
we doing aggregations? Well, yes, that means we cannot use relevant
calculations. Then the next question, are the data that we have in the view enough? Well, it's not. Here, it's not the total
revenue by category. It's by the products. Well, that means we cannot
use the table calculations. Now we come to the
last question. Does the level of details
in the view going to support me to solve the task?
Well, the answer is no. And that's because
the level of details inside the view now defined
by the product name, and it has higher level of
details than the category. We want to have
the total revenue. Pi category. So the level of details that we have in the
view will not support me. That's why I cannot use here
aggregate calculations, and I have to go and
use LOD expressions. So as you can see,
verle questions, and it's going to
move you exactly to the right type of
calculations in Tableau. And now you might
say wait weight it. I can go and add the category
information to the view, and then I have the level
of details of the category. Well, this will not work, and that's because
the product name has a higher level of details. Let me show you what can happen if you bring the category. So let's go and grab the category to the
right side of our here. You can see nothing
going to change. We still are at the five rows. And that's because
of the product name. Even if you move it to the
left side of our here, we don't have here two rows
we have here five rows. If you can check the
details over here, we have five marks. So that's why even if you
are adding the category, nothing going to
change, we are still with the product
level of details. So now let's go and create
a new calculated field. To use the LOD expressions
or calculations. So let's go to the left side and create a new
calculated field. We can call it total
revenue by category. And the syntax, don't
worry about it, we're going to learn it in a
separate tutorial about it. So it's going to have the
following syntax fixed. Then we have to specify
the dimension that's going to control the level of
details of the results. It's going to be the category. And then what we are doing, we are aggregating the revenue. We have to add here sum of revenue, and then
we have to close it. That's the calculation is
valid and everything is fine. Let's go and hit. As usual, we're going to get a
new calculated field in our data bin over here. Let's get the result
and let's drag it over here to see the data. We can see for each row the total revenue
by the category. For the first one,
it's going to be the total revenue
by the accessories. The second one the
same because it belonged to the same category,
the third one the same. But the fourth one,
you can see it belongs to different category, and that's why we're going
to get different numbers. That's it. This is why we need LOD
calculations in Tableau. Okay, now we're going to move to the last type of
calculations that we have, the table calculations. And here we have as well,
a few calculations. So we have the
running window rank, first last index lop, and so on. Again, here we can
have dedicated tutorial for those stuff. But now let's go and
try one of them. All right, everyone.
So now we're going to move to the last
task for this view. We want to show
the running total of the revenue by the products. So here we're going to ask
again the three questions. Are we aggregating? Well, yes, because we are having the
running total of the revenue. So we cannot use the
row level calculations. The next question is, are
the data that we have in the visualizations are enough to solve this task. Well, yes. And that's because we
have the total revenue by the products and the view. And based on those informations, we can build up
the running total of the revenue by the products. So we have actually
everything in the view in order
to solve the tasks. And that's why we're
going to go and use the type table calculations, and we will not bother with the third question whether it's aggregated calculations or LOD because it is table
calculations. So let's go and create
a new calculated field. We're gonna call it
running total revenue. The syntax for that is
as well, very simple. We start with the running. Then we have to select
which aggregation type. It's going to be the sum. Then we have to go and specify
which data are going to be calculated inside
this table calculations. Here we have only
two informations, either we're going to
use a total revenue or the total revenue by
category, the LOD. But we are talking about the
total revenue py products. That's why we're going
to include it over here. That's going to be the sum of
the revenue, and that's it. The calculation is valid. Let's go and hit, and
we're going to take our measure and put it as
well on the view to check s. So that we can see very nicely, the running total
of the revenue. It's very simple. It starts with the first value from
the total revenue. Then the next value
can be based on the previous value plus
the total revenue. Those two values are
going to be added to each other in order
to get this value. Then the next one, the same. So the previous value plus
the current total revenue. As you can see, we
have nothing here. That's why we are
getting the same value. As you can see, as
we are moving down, we are adding more total
revenues to the total number. Now, it's very
important to understand that the table calculations are very sensitive to the data that is
displayed in the view. Any change to this structure, we're going to get different
numbers at the output. This is not the case
for the aggregate or the LOD calculations. Let
me show you what I mean. For example, let's
go and just change the sort of the data
inside the product name. So let's go over here and make it descending, for example. You can see that the
aggregate calculations or the LOD, the values
are the same. I'll just change the sort. But the values inside the table calculations did
change completely because we have now different
sort and tableau can to recalculate the running
total based on the view. That means any interactions
in the visualizations, it's going to affect the
table calculations functions, and it's completely
based on the view. That's it for now, this is about the table calculations in tableau. All right, guys. So now we can talk about
the order of commutations of those different calculations types that we have in Tableau. So now let's say that we have
the following calculations, and it's very similar to
the nsted calculations. Here we have different types. So we have the rank for
the table calculations. We have the sum as an
aggregate calculations, and we have the
quantity multiply with the price as row
level calculations. So the fair thing
to be executed is always the row
level calculations. So The first one going to be quantity multiply
with the price. Then the second type
to be executed in Tableau going to be the
aggregate calculations, it's going to be the sum
function in Tableau, and the last type
of calculations that's going to be
executed in Tableau going to be the rank function,
the table calculations. Again, roll level
calculations as the first, then the aggregate
calculations and always the last one,
the table calculations. Okay. So now let's
go and quickly recap how to choose the
right calculation type. Here we have three questions. We start with the first one. Do you have the aggregated data? If no, then go and use the
row level calculations. We are at the low level. If yes, then we jump
to the next question. Is all the needed data already available in
the visualizations? If yes, then we can use
the table calculations. If no, then we have here the third question
is the level of details in the visualizations matches the question
or the requirements? If yes, then we can use the
aggregate calculations. If no, we can go and use the LOD expressions
or calculations. So if you follow
my decision tree, you can simply find
an answer for that. All right, so that you
have now an overview of the different types
of calculations that we have in Tableau. Next, we're going to do deep
dive in each type of them, and we will start with the
row level calculations. Here we're going to cover a lot of functions in Tableau that are very important to do data manipulations
and transformations. And generate as well in new information that you need
for your visualizations.
93. Number Functions | Round Functions: CEILING, FLOOR, ROUND: So now we're going
to start with the first type of calculations, the low level calculations, and in this statorial
we're going to cover the number
functions in Tableau. The main purpose of the number
functions in Tableau is to manipulate and transform
numerical values. We can use them on field
with the data type number. The most important use case for the number functions is
to simplify the numbers. Here we have three functions. We have the ceiling, floor, and round in order to round
the numbers to similar form. As usual, first, let's understand the
concept behind them, then we can practice in tableau. Let's go. All right. Now, let's say that we have
the following scenario. We have built a view from the subcategories and
the sum of sales. Now, if you take a
look to those numbers, you can see that they are large numbers with a lot of
fractions, a lot of details. We have three
decimals over here. Those details are going
to make it really hard to read those
numbers in the view. Instead of that, we can round those numbers to
make it easier to read and hide those
small details that are unnecessary here. If you take the cells,
the rounded cells, you can see now we
have smaller size in the numbers and we rounded
all those fractions, all those decimal numbers. With that, you can see if you compare the right to the lift. It's easier to read it right. So now let's learn
how this works. Each decile number,
like, for example, 1.4, it has always two
integer neighbors. Think about it like
we have a room. It has a ceiling and floor. In this example, the 1.4 has the ceiling of two
and the floor of one. And here we might be
in a situation where I don't want to deal with those details with
those fractions. I would like to have a
whole number two or one. And here exactly we
have two options. Either we're going to move it to the ceiling to the
higher number, or we're going to move it to the floor to the lower number. So if you decide to use
the ceiling function, the number is going to be two. So what you are
doing here is we are rounding up the number to the higher value
to the ceiling. Or we are moving
it to the floor. That means we are
rounding down the number. The floor function going to
round down the 1.4 to one. Now you might say,
You know what? I don't want to decide
whether it's going to go to the ceiling
or to the floor, I would like to
have it automatic. So it should go to
the nearest integer. And here we can use
the round function. Let's have the
following example. Let's say we are at 1.3. If you use round, we're going to go to the
nearest neighbor. The nearest neighbor is
going to be the one, the round going to
move the value to one. But now let's take
another value, 1.7. Here the nearest neighbor is not the floor, it
is the ceiling. So it's more near to two. If you use the round function, it's going to convert it to two. And now, let's say
that our value is exactly in the middle of 1.5, what can happen to the
value of I use round because it has exactly
the same distance to the ceiling and to the floor. And here what can
happen is it's going to be rounded up to the ceiling. We have to have only one value. So 1.5, the round of
that's gonna be two. So as you can see, this is how those three functions works. All we think about,
it's like a room, you have a ceiling and floor. All right. So now let's compare the three functions
side by side. We're going to start
with the ceiling. So the ceiling go
round up the numbers. The syntax in table gonna
look like this, ceiling, and it accept only one
argument, the original number. For example, the ceiling
of 1.2 is going to be two, ceiling of 1.8, going to be two ceiling of 1.5, can be two. We are always going to the higher number. Let's
move to the next one. It's going to be
exactly the opposite. So the floor going to round down the numbers to lower value. The syntax here is floor, it except as well,
only one number. The examples are floor
1.2, can be one, 1.8, can be one, and 1.5 can be as well, one. We are always going to the lower Let's go to the last
one. We have the round. It's going to round the numbers
to the nearest integer. The syntax for that is going to be a little
bit different. We have round then
the original number, then we have a decimal. Here it's option, of course. Here we can decide as well, whether we're going to see,
for example, one decimal, two decimals, and if
you leave it empty, it's going to round
it to a whole number. Let's go to the examples
for the same numbers. If you round 1.2, it's going to go to the floor,
the nearest going to be one. If we round 1.8, the nearest going to be the ceiling, it's going to go to the two. If we round 1.5,
exactly the middle, it's going to be rounded up to the ceiling, so we have a two. That's it. This is how
the three functions work. Now, let's go back
to Tableau and start practicing. All right, guys. So back to Tableau,
let's create now view that we're going to show
the orders with the sales. So we're going to stay with
the small data source. Let's take the order ID, put it on the rows, and let's
grab the sales to the view. So as you can see the sales
don't have any fractions, and that's because not that
the numbers are rounded, is just the format is different. So in order to show
the real values, we have to change the format. So in order to do
that, we're going to go to the major
sales of our here, right click on it and
go to the format. Then we're going to
go to the lift side. We have here
numbers. Let's click on this menu and go
to the standard. So once you do that,
you can see that. We have the raw data as we
have it in the data source. Now we want to
round those numbers to make it similar
to read in the view. In order to do that, we
have the three functions, and we can start
with the ceiling. Let's close this over here and create a new calculated field. Right click over here
in the white space, create calculated field. We're going to call
it sales ceiling. The syntax is really easy. It's starts with the ceiling
kard and then inside it, we have to have our
field, the number. Our field is the sales, and as you can see the
calculations is valid. Let's get o. As you can see, we have now the field, the new calculated field
in the data source. Let's bring it to
the view. Let's go and drag it over here. As you can see now we
have our new field. Let me just make it
a little bit bigger, and all those
values are rounded. Let's take the first value. We have 215 88. As we are rounding up, we're going to go to
the next higher value, which is 216.
Everything is fine. Let's check this over here, so we have 56 11. And as we are rounding up, we're going to go to the
next integer, which is 57. Everything is fine and
the ceiling functions is now working. All right. Next, we got to go and
do exactly the opposite, we're going to round down
the numbers to the floor. We're going to go and create
a new calculated field, and we're going to
call it sales floor. The syntax is as
well really easy. The keyword is floor and our
value going to be the sales. That's it. The
calculations is valued. Let's click, and our new field is already in our data source. Let's grab it to the view. The first value was 215 88. As we are rounding down
to the integer below it, it's going to be 215. This value over here,
we have it 56 11, as we are going to the floor, it's going to be 56. Everything is fine,
and as you can see, it's exactly the
opposite of the ceiling. Next, we're going to
go around the numbers automatically to the nearest
neighbor using the round. We're going to go and create
the third calculated field. We're going to call
it sales round. The functions is really easy. So it starts with round
and accept two arguments. The first one is must, it's going to be
our number sales, and the second one going
to be optional in case we want to decide on the
number of decimals. So here we don't want to use it. We're going to leave
it as default. We don't need any
decimals or fractions. So we're going to
leave it as like this, sales, and that's it. As you can see, the
calculation is valid, and we're going to
go and hit okay. Third calculated field
as well in the data pin, let's just grab it to the
view and check the values. So now, the first value, 215 88, it is near to the ceiling. That's why the round
going to take it to 216. The next one we had 56 11. It's really near the floor. That's why D or the round
function going to take it 2506. So as you can see,
everything is fine, and the numbers are moving
to the nearest neighbor. So now let's say that we want to see the sales in our view, but having only one decimal, not two decimals like
here in our example. In order to do
that, we can round those numbers to
only one decimal using the round function. Let's go and create a
new calculated field. Let's call it sales, round one, and we're going to use as
well the same keyword rounds, the number going to be sales, and then we're going to define how many decimals do we want. In this example, we
want only one decimal, so we're going to type here one. So that's it, as you can see,
the calculation is valid. Let's click OK. And here
we have our new field. Let's bring it to the view. And now you might say, You
know what? Nothing changed. We still have everything rounded to a whole number.
There's no decimals. Well, that's about the format. So let's go and change that. We're going to go over here, right click on it, and
then let's go to format. And here, we're going to
bring it to the standard. Once we do that, as
you can see, now, we have only one decimal value. We don't have two
decimal values like the sales like the original
field in our data source. But now you might say, maybe the round as well as decimals. So let's check the formats. We're going to go
to the round over here and let's click formats. And now if we bring
the standard, as you can see,
nothing is changing. So that's means we don't
have really no decimals. We have only a whole
number. All right. Now you might ask me, when do I use ceiling and when
do I use floor? Well, there is no rule for that. It's really depend on the use case and on the requirement. For example, if I'm building a dashboard for budgeting
to plan a budget, I would go always
with the ceiling to make sure that I'm
not forgetting anything, and I'm not short in
the budget at the end. On this use case, I
tend always to use ceiling and never
use floor or round. It really depends on the
requirement and the use case. As you can see those three
functions really makes the visualizations easier to read and more simpler.
All right, everyone. So so far we have learned
how to simplify the numbers in tableau using the
three number functions, ceiling, floor, and round. And that's it for
the first group, the number of functions. Next, we can learn the
string functions in tableau.
94. String Functions | Change Cases: LOWER & UPPER: Now we're going to focus on the second group of functions in Tableau under the category
row level calculations. We have the string functions. And the main purpose of
the string functions in Tableau is to manipulate and
transform the text values. A field in our dataset
with the data type string. There are many use cases and reasons to use string
functions in Tableau. For example, we can
use it to clean up our data and bring our
text to standard cases. For example, we can change the case to either
lower or upper. The next use case as well, is about to clean up our data in tableau by removing
any unwanted spaces. Here we have three functions, the left trim, right
trim and trim. Moving on to the next
group or use case, we have here three functions to extract specific
substring from a text. We have left, right, and med. The next use case is to
search for specific patterns, and here we have five functions. Start with width, contains
find and find in. Then we have another
use case for the string functions to compine and split data inside tableau. Here we have the concat operator and as well split function. Last use case is to replace specific substring with
another substring. Here we have the
function replace. As you can see, we have a lot of string functions and
tools to manipulate, transform, clean up the
text values in talo. Now we're going to start
with the first use case about the string functions, how to clean up our data
and bring our text to standard case using the two
functions lower and over. But as usual, first
we have to understand the concept before we
start practicing in table. Let's go. All right. So now let's go and
check the following data quality issue in our view. If you check the dimion
products over here, we have three values
for the same word. So we have keyboard three times in the view,
which is really wrong. And that's because
the data quality from the source system where we get the data from is simply low. This happens if you have a
lot of people working in a p projects and you
have a lot of products, so they may enter different
names for the same products. So here we have a case
issue in the product name. And what I usually
do in my projects. I go and contact the
source systems and tell them about the data quality
issues that they have. But sometimes it might take
long time until they fix it. So indivisualizations, we can go and fix and clean
up those stuff. And in Tableau, we have a
lot of tools and functions to manipulate and clean
up the dimensions. So for example, we
can use the upper or the lower functions in order to bring standards
to the values. So if we go and use the lower, we can have the
following results. So we can have in this example, only three products in
the visualizations, and although three values
can be aggregated for the quantity in only one row,
which is really correct. So now, if you compare the first view with
the second view, you can see that
we have improved the data quality in
the visualizations. Now, let's go and understand how those two functions works. Now, let's have the following example about the customer's name. The names could be
written like this. The first character
of the first name and the last name is capitalized or everything has an
upper case or the opposite where we have
everything in lower case. So you can see we can write the customer's name
in different cases. Now, in Tableau, we have to bring those names in standards, and we have two ways to do that. Either we bring everything to
lower case or to Aber case. Now, if you decided to go with the upper case for the customer's
name, what can happen? The first customer can be converted completely
to upper case. The second customer is
already an per case, so nothing can happen, it's
going to stay the same. The third one, it is low case, so it can be converted
to upper case. But now, if you want to go with the lower name for
the customers, this is what can happen. The first one, the
first customer can be converted to a lower case. The second one as well, can be converted from upper to lower, The third one, nothing
going to happen because it's already lower case. As you can see with
this function, we are forcing the names to
be either upper or lower. We bring standards to
the visualizations. Now we're going
to go and compare those two functions together. We start with the upper,
it's going to convert the characters to per case. The syntax in Tableau
going to be the following. It starts with the
keyword upper. I accept only one field, the string, the output
can be as well string. For example, if we
take upper Maria, the first character
is capitalized, the output can be string, Maria in upper case. Now,
let's go to the lower. It's going to be
exactly the opposite, so it's going to conver the
characters to lower case. The syntax can be
similar to here, we have lower than
one field the string. The output can be
as well a string. The example here is lower Maria. Maria can be in the
output as lower case. Those two functions are
simple and easy to use, but still they are
very important. I tend to use them a lot in my projects to
clean up the data. Now, let's go back in Tableau
and start practicing. All right, for those
two functions, I have prepared an
extra file with the low data quality
in the product names. So in order to
connect this file, we have to create
a new data source. So let's go to the data
source page over here, and then we're going to go
and create a new data source. Then we're going to
go to the text file. You can find it inside
the small folder. So we have here a CSV file
called products low quality. Let's go and connect it.
It's only one table, and if you check the
data grid over here, you can see we have problems
in the product one. You can see we have here
keyboard in uppercase, keyboard in lowercase or with the first
charter capitalized. Now let's go back
to our sheet and start checking the data
as well from there. Now let's go to the
database and make sure we are selecting the
new data source. We have here a product one. Here we have the case issue. Let's bring it in the view
and check the values. As you can see, we can
find five products. But in reality, we
have only three, So here we have the keyboard three times monitor and mouse. We should have only three
keyboard monitor and mouse. So we have data quality
issue in the product names. Tableau is case sensitive, so it can present data exactly as it is from
the source system. Let's take the quantity
and put it in the columns. And as you can see,
those three varies will not be aggregated together, since Dlo going to think those are three different products. Let's show the values
here and the lapels. Let's take it to
the color as well. So now we're going
to go and clean up the data using the
lower function. In order to do that, we have to create a new calculated field. So let's go to the
data pin over here, right click on the empty space. Create calculated field. We're going to call
it products lower. So it's start with
the keyword lower, and it accepts only
one value, the string. So we're going to have the
products one, and that's it. So as you can see the
calculation is valued, and the output going to
be a string the products. Let's go and hit k. Now if
we check the data pain, we have here our new dimension,
the calculated field. Let's bring it to
the view and the rose to start
comparing the values. The first one, as you can see, it is an upper case, so the output can be a
lower case of the keyboard. The next one is already lower case, so nothing
going to change. The third one is
completely upper case from the original data, but the output is lower case. So as you can see, we
have all the names here in a lower case. Now, if you go and remove
the product one over here, you can see we can end up
having only three values, only three products,
which is correct. So with that, we have cleaned up the data using the lower case. So now let's go and clean
up the data this time, using the upper function. We're going to do the same.
We're going to go and create a new calculated field. Let's call it products upper. So we're going to use the
function upper over here, and it accepts only one
field, our products. So products one, and that's it. So the calculation is
valid. Let's click. Now if you check the data bin, we have a new calculated
field, new dimension. So let's bring it to the view and start comparing the values. I'm going to bring as
well, the original field. The first one is capitalized, as you can see, the output
can be an upper case. The second one is
completely lower case, can be as well,
completely upper case. The third one,
nothing can change. As you can see, all the
values now in upper case. Now I'm going to go and remove the others to see
the final results. As you can see, we have only three products
and the visualization, which is really
correct, and with that, we have fixed the data
quality using the upper case. All right, so now
you might ask me, should I use a lower case
or upper case in my views? Well, if you're asking
an IT guy like me, I'm going to answer
like this. It depends. It depends on the fields that
you are using in the views. Let's have the
following example. So here we have two views, the left one with the lower
case on the products name, and the second one is
with the upper case. So if you take a look
now to those two views, what do you think it
is easier to read? Well, if you have a normal text or a long text like
the products name, the customer's name, and so on, It's always better
to use a lower case. The lower case are easier to read compared
to the upper case. The upper case is going to
take as well more space. It's more aggressive and
really hard to read. So for this scenario,
I would go and recommend you to
use the lower case. In modern design, they tend to use lower case
since it's provide more slick and
minimalist look in the website and in the and feeling for the
visualizations. The lower case is easier
to read. It's more modern. If you compare it
to the upper case, it's hard to read, and it's
like someone is shouting. Let's take now another example. We have here an aggregations for the country abbreviation. So here we have it
as a lower case and as well at the upper case. This time, if you
compare them together, you can see that maybe it's more better to use
the upper case. And that's because
since it's very short the abbreviations has maximum
maybe three characters, it's really hard to see
indivisualizations. They are really small. So if you have it like
a big characters, it's easier to read. So with the abbreviations, I always tend to use upper case. The abbreviations if they
are written in upper case, they can bring
standards and they can avoid misinterpretations
of the data. If you look to the
right side over here, you can understand immediately, here we are talking
about countries. But if you are on the left
side, you might get confused. For example, are we talking
about USA or the word? The same goes for Italy. Is it like the it, that
we use it in sentences in the pronoun or is it like
the abbreviation of Italy. Here if you write
it in lower case, you might introduce
some misunderstanding and misinterpretations. So for the abbreviations, I always tend to use upper case. It's more clear and easy
to read for short names. So that's why the answer
that comes from the IT. It depends. It depends on the use case, the
requirements, and so on. So sometimes we go with lower, sometimes we go with the upper. But 90%, I go with
the lower case, for the names and so on, but only for the abbreviations,
I go with the upper. So with that you
have at least some orientations in
your visualization. All right. So that's
all about how to clean up the data by bringing our text to standard case using the two functions,
lower and per. Next, you can start talking
about the three functions, left rim right rim anim.
95. String Functions | Remove Spaces: LTRIM, RTRIM, TRIM: All right. So now
we're going to talk about another string functions in Tableau to clean
up our data by removing unwanted spaces using the three functions left
rim, right rim, and trim. Of course, as usual, we have to understand first the
concept behind them, and then we're going to practice
in Tableau. So let's go. All right. So now we have the following
scenario where we have again a bad data
quality in our view. If you check the products, we can see that we have
four times the keyboard. So what is going on? We have here no case issue, all of them are capitalized
on the first character, so there is no lower case upper
case. Everything is fine. Why Tablo didn't aggregate
all those values in one row in one products because here we have
only three products. So what is going on
here? What happened? Well, we have the dirty
spaces in the product name. In the keyboard, there
are like unwanted spaces. It's really hard
to see individual. You can see that everything
looks fine, right, but there's spaces
inside the keyboard, and we have to remove it. Now in order to clean up the data and remove
those dirty spaces, we can use one of
the three functions. Left trim right trim or trim. And if you apply those
functions on the product name, we're going to get
the result like this, only three products, and
everything will be fine. Let's understand how
those functions work. Let's have the following
simple examples. Let's say that we have
the word monitor, but on the left side,
we have a white space. In order to remove
it, we can use the Tableau function lift trim. Lift trim gar remove any unwanted spaces from
the left side of the word. Now we might have the opposite situation where we
have the monitor, but on the right side,
there is a white space. In order to remove those spaces, we can use the function
in tau, right trim. Right trim going to remove any spaces from the
right side of the word. Moving on to the third scenario, we have the same word monitor. But this time, on the
left and on the right, there are white spaces. So in order to
remove those spaces, either we can use both
of the functions, lift trim and right rim
or we can use the third function m. If you use the trim function to
for this scenario, it's going to remove
all the white spaces from the left side and as well, all the white spaces
from the right side. All right. So now
we're going to go quickly compare those
three functions. The lift rim going to
remove any leading spaces. The right m going to remove
any trailing spaces, and the trim going to
remove both of them, the leading and trailing spaces. And the syntaxes in
Tableau are really simple. So for example, we have here, the left trim keyword, then it accept only
one string field. The output is going
to be a string value. So for example, let's say we want to lift trim this value. We have aria, on the left side, we have a white space and
as well on the right side. So if you use a lift trim, I go to remove only
the leading spaces, so it can just remove the
space from the lift and go to leave the space that we have on the right because it's
only left trimming. Let's go to the next one.
It's exactly the opposite, but the syntax is
almost the same. So we have right trim. I accept the field string, the output going to be
as well, a string value. So if we stay in
the same example, it's going to remove
only the trailing space. So the space on the left side going to stay in this example. Now, let's move to the last one. I think you already got it. We're going to use only the trim here, not a left or right. So both of them, And it accept
as well a string field. The output going to
be a string value, and the example can
be the following. Maria, with the lift and right
spaces, what can happen, we can remove the lift space
and as well the right space. So those functions are
really easy to use and very important to improve your data quality in
the visualizations. Let's go back to Tau
and start practicing. Okay, first, make sure to
select the right data source, so we can stay with the
products low quality since I prepared the examples, and now we're going to
go with the product two. So just drag and rub
it here in the view. And as you can see, we have now four products for the keyboard. Now, it's really hard to see where are those white spaces. For the first two,
you can see they are little bit
shifted to the right. But for the second
two keyboards, we are not sure
whether they are on the right side, a
white space or not. And the situation
can be really bad if we switch to different
visualizations. So let's take the quantity
and now in the bar diagram, it's almost impossible to see whether they are like
any white spaces. So if I'm facing this
situation in my projects, I go first and start counting how many characters do
I have in each product? So I calculate the
length of each word. In order to do that,
we're going to create a new calculated field. Let's go and create a new one, and we're going to call
it products length. The keyword for the
arts to calculate the links is L N and that sets. Then it accepts only
one field string field, and the output can be in number. So our field going to
be the product two, make sure to select
the correct one. And that set the calculation
is valid. Let's click. And since the output
going to be a number, Tableau going to go and
create a continuous measure. I'm just going to remove
the quantity from the view, and let's bring our new
calculated field to the view. The link of the
first one has nine. This means we have
only one white space. The second one has
two white spaces. The third one is correct. The first one is as well, has a one white space. So with the link function, we can easily detect
whether there are dirty spaces in our worlds. So now, in order to remove
and clean up those problems, we're going to use
the trim functions. So let's start with
the lift trim, and we're going to go and
create a new calculated field. Let's go and do that. We're
going to call it products, left trim, and we're going to start with the
syntax, left trim. And I accept only
one string field. It's going to be
the product two, make sure to select
the correct one, and that calculation is valid. Let's go and hit ok now
we notice that Table created a new dimension because
the output is a string, let's go and put it
here in the view. Now, what can happen to the
values inside the products, all the spaces
from the left side going to be removed or trimmed. But again, here, it's
really hard to see from the view whether
everything is fine, so we're going to go again and calculate the length
of the new field. Let's go and change
the calculations inside our calculated field. Instead of having
the broad act two, we can remove it and
insert the new dimension. Let's click Okay. All right. So now let's check the result. As you can see, we
have some values fixed so the first one. We have it as eight.
The second one we still have is space. The third one is anyway correct. The third one is
as well incorrect. As you can see, the situation
is now a little bit better, but we still have spaces. That means we have spaces
on the right side. In order to fix
this, we're going to go and trim from
the right side. Let's go back to our
calculations, the left trim. Let's edit it and add the right trim. So we're
going to go over here. We're going to have
nested calculations. So right trim. And we want the results
from the left trim. Let's go and hit, but
maybe I'm going to change the name to. Let's hit. What can happen to the
values inside the product, we are trimming everything from the left and as well
from the right. As you can see now, the
length is as well, correct. All those values has
the links of eight. In order to test this as well, we're going to remove the
product two from the view. And we have here
only three values. Of course, the links doesn't make any sense here
because we are summarizing the links of all the products
inside the orders. Instead of having
it as a measure, maybe we can convert it to dimensions to not have
any calculations. I'm just going to remove it from here and just add
the product length. As you can see,
everything is fine. Now, of course,
for this scenario, we have an easier solution. We can just use trim instead of using left and right
trim in one calculation. Let's go and do that.
We're going to go back to our calculation and edit it. So we're just going
to remove everything. We're going to use
the keyword trim, and then it accept
only one field, go be the product two. And as you can see, the calculation is
valid. Let's click. So as you can see, nothing
going to change in the view, we're going to get
exactly the same results. So with that, we have
cleaned up the values inside the products by removing any
dirty or unwanted spaces. All right. I want to show
you one more methods on how to detect whether there is bad equality in your data
by having unwanted spaces, and that's specially if you
have a big data source. If you have a lot of values, it's really hard to detect those stuff if you are
using the link function. I'm going to show you
now how I usually do it if I have a
big data source. What I usually do
if I have suspicion about one field where I think the users are manually
entering the values. If that's I go and count the distinct value
inside this field. Now let me show you
how I usually do it. Let's go and create a
new calculated fields, and we're going to
call it products counts D. The syntax for
that is going to be counts. And then the word
D, we are counting the distinct value
inside our products. The field going to
be product two. The output for that is
going to be a number, so the calculation is valid. Let's go and hit a k. So you
can see on the left side, we have a new
continuous measure, it's going to count how
many distinct values we have inside the products.
Let's see the results. I'm just going to go and remove
everything from the view. I'm going to take the count
d and put it on the text. Now the results
going to say I have six different products
inside my data source. But I have suspicions about it. Now what I'm going to do,
I'm going to go and start trimming the values
inside the products, and my expectation going
to be the following. If the number is going
to stay the same, then we don't have any spaces. But if the number
going to go smaller, then we have unwanted spaces inside the products.
Let's start testing that. We're going to go
to our calculation and start adding our trims. We start always with the
lift trim or right trim. Why we don't go
immediately to the trim? Because if you are trimming everything from
the lift and the right, this can have a
bad performance in Tableau because it
needs resources. So if you are only lift trimming
or only right trimming, it's going to be easier
for Tableau to do it. But if you always go
immediately to the trim, you might have bad performance. That's why I always start
with the lift trim. So let's go to the lift trim. And check the
results. So I'm just going to add it to the
product over here. So with that, we are first
lift trimming the product two. Then we are counting how
many distinct values we're going to see
inside this database. The calculation is valid, let's. Alright, so now we
moved 6-4 products. This is alerting for me. That means there is
like leading spaces. So now the next day, what
I usually do is to go and test whether we have any right
spaces on the right side. For that, either
I'm going to add right trim or I'm just
simply go to use the trim. Now, if we add the
right trim and the trim and the number
going to stay the same four, that means we have only
problem with the lift spaces. But if the number is
going to go smaller, that means we have as
well right spaces. Now what we can do, we're
going to go again to our measure and edit
the calculation. Instead of having lift trim, I'm just going to have now trim test as well the right spaces. So let's go and hit K. Now, as you can see, we went 4-3. That means we have as
well, right spaces, not only left, but
as well right. So the total number of
products went 6-4 to three. So this is how I usually do it to decide
whether I'm going to use only left trim or
right trim or both of them. Instead of using immediate trim, I saw a lot of
projects and a lot of developers tend to
overreact with this. So if they see like
a string value, they go immediately and
trim it just in order to have a correct result add
that tableau visualization. But believe if you
do this always, you're going to have
bad reaction in Tableau and you're going
to have bad performance. So take a little
time investigating whether it's really
necessary or not. All right, so that's
all about how to clean up our data by removing unwanted spaces
using the three functions, lift rim right rim and trim. Next, we're going to talk
about another group, the lift right and mid.
96. String Functions | Extract Substring: LEFT, RIGHT, MID: So now we can cover
another group of string functions in
Tableau to extract specific substring
from the text using the three functions
left, right, and med. As usual, let's
understand that concept, then we can practice in Tableau. Let's go. All right, everyone. So in real scenarios
and real life projects. The data that comes from the
source systems usually are way more complicated than the data that you
can find in samples, tutorials, courses, and so on, because the processes and real projects are way
more complicated. The example that
you can see here could be the broad name
inside your projects. So here you can
see, we have a lot of information in
only one field. For example, we have the canon. This could be the product name. The next one, we
have the product ID, and the third one is
the product code. All those informations,
we might find it underneath the product
name in only one field. So Indivisualizations,
we might be interested in only one piece of information,
not the whole thing. So we could be interested in only the canon,
the product name, or we need only the ID, 789, or we want only the code
to be individualizations. So we need in table, such a
function or tools in order to extract those pieces of information and split the
one field to three fields. In table, there are
a lot of functions and ways in order to
achieve this goal. One of them is to use the
functions left, right, and mid in order to cut this
field into multiple fields. So we're going to start
now with the first one. Let's understand the lift. The first thing to
understand is that, Each character in our string
has a position number. For example, we have the C. It has the
position number one, the A, two, three, and so on. Until we reach the
last character five, it has the position 14. So we are counting from the left until we
go to the right. And now in this example, we are interested only on
the product names. So we're going to focus
only on this one, and as you can see, it ends
with the position five. So the syntax tau in order to do the lift is the following. It starts with the lift, then it needs two arguments. The first one is
the field itself. So the string itself, then the numbers of
characters that we want to keep the output the result
can be a string value. For example, we're
going to take left then our value and the number
of characters can be five. So we are keeping
five characters from the left side. Let's
see how this can work. So we're going to
start counting from the left and we
move to the right. So the starting character is C. So we start
counting one, two, three, four, five, and this is exactly the
number of characters, and we make a cut here. Anything after the five or
after n going to be removed, and we keep here only
five characters. We can have the output of canon. So in this example,
we are cutting all the values after the character with the
position number five. All right, so this
is how the lift function works in Tableau. Let's move on to
the next function. It's exactly the opposite. We're going to have
the right function. Let's say that we
are not anymore interested in the product name. We would like to have and
extract the product code, the last four characters
of our string. And now, if you're
considering to use the right function,
what can happen? The position number
of the characters can be exactly the opposite. We're going to
start counting from the right side as we
are moving to the left. So the first character going
to be the character five, the second one R, the third, and the last
character, number 14, can to be the C. So now we want to focus on
the product code, and we're going to use
the right function. The syntax for the
right function is very similar to the lift. So it starts with
the right keyword. Then we need our field,
the string field, then the number of characters. The outward going to be
as well, a string value. This time can be the
example like this. It's going to have
right, our string. Then the number of characters
that we want to keep from the right side is for let's
see how this can work. So the right function
can start counting from the right side and
we move on to the lift. So we start counting
from here, one, two, three, four, and that's
it. Here we make cut. And all the characters
after the position number four will be ignored will
not be part of the results. So at the end,
you're going to get only four characters from
the right side, CE R five. So this is how the right
functions works in Tableau. We start counting
from the right side, and we keep only, like, for example, here,
four characters. Alright, so now we're going
to move to the third one. We have the mid function. Now we want to extract
the last piece of information that we
have in our string, the product ID, the
one in the middle. We are not interested
in the first part, the product name or the
last part of the code. We want to get exactly this
information in the middle. If you are using med, we're going to count from
left to right, exactly like the lift function. The first character going to be the C and the last character
going to be the five. The syntax in tau is slightly
different as left or right. We start with mid Then
we have three arguments. The first one as usual, the string value that
we want to manipulate. The next one here is new. We can define the start
point where we can start counting how many characters we can leave. Then we
have the length. Here, it's like the
number of characters, but this time, it is optional. So if you leave
it, we're going to consider everything
after the start point, or if you specify it, we're going to have
exactly the same number of characters that you define. The output going to be here
as well, string value. Let's take here an example. We can have mid then our value. We want to start
counting from seven, and we want to keep only three
characters in the output. Now let's see how this can work. The start position to count the number is the
position number seven. So we're going to
start from this value, and we're going to
count three characters. So one, two, three, and cut. So now what we are doing, we are cutting two things. The starting position
and the position. That means all the
characters before the starting point will be ignored will not
be at the results. And as we all the characters after the final one at
the cuts will be ignored. So the output going to be 789. So with that, we extracted an information in the
middle of our string. So this is how the met function. As you can see, with
those three functions with those three
tools in Tableau, we can cut anything in our
string and generate new data. Now let's go in Tableau
and start practicing. There are main use cases
for those three functions. For example, let's start
working with the URL. The URL has usually a structure, and we want to extract part of the informations inside URL. In our data sources, we
have a URL in the images. So if we go to the
small data source, go to the products, and here
we have the product image. Let's drag and rub it on the rose and check
the structure. The standard URL usually
starts with the protocol, then we have a domain,
and then at the end, we have a file or something. Our files here are all images, like we practice
in the image roll. Now the first task is, extract only the
protocols from our URL. Now, as the protocols
are from the left side, I think you know already that we want to use the lift function. So we can go and count how many characters
we want to leave. So we need five characters. Let's go and create a
new calculated field because we need a new field. We're going to call it URL, and then we're going
to have that protocol. So it starts like this, the lift, and then it
needs two arguments. So the data that we need
is broad act image. We have it over here, and we
want to cut five characters. So, come on, we're going
to specify here five. So you can see the calculation is valid. Let's go
and try that out. We're going to go and to care. And as you can see
on the left side, we have our new dimension,
our new calculated field. Let's go and bring
it to the view. Drag and rub it on
the road beside it. And as you can see
now, we've got a new field in our data source, where we have the protocol
informations from our URL. So everything is working fine. And this is how we work
with the left function. Let's go to the next use case, where we want to extract, file extensions in our URL. So we want to get this part
at the end from the URL. So as we are speaking
about the right sides, what we're going
to do now, we're going to use the right function. So here we need to extract
around three characters. Let's go and create
the calculated field. So we're going to go
and create a new one. We're going to call it
URL file extension. So it's start with
the keyword right, and then it needs as
well two arguments, the string, our field going
to be the product image, and how many characters
we want, we want three. Come on. Three. With that, you can see the calculated
field is valid. Let's go and hit a K. As usual, we have a new calculated field, a new dimension in our data source just to deal
with the file extensions. Let's check the values to see if everything is fine,
and as you can see, we are getting all the file
extensions. From the URL. So as you can see,
it's really simple, and we are that generating
new informations, new fields that we could
use in our analysis, and they are based
on the original data that we get from
the data sources. All right. So now let's move to the next task where we
want to get the URLs, starting from the domain name without having the protocols. So we want to keep
anything after the double slashes
in the string. And this time, we're going to
use the table function Md. Let's go and create a
new calculated field. So we're going to call
it product domain, And here we can start
with a keyword made. It takes three arguments. The first one as usual, can be the broad act image. And then when do
we start cutting? Here we have to specify
the number, one, two, three, four, five,
seven, eight, nine. So we start cutting from nine. And the last one is optional. I'm just going to leave
everything afterward, so we will not cut anything
from the right side. That's it. The
calculation is valid. Let's it. As usual, we
get a new dimension, new calculated field and our data bin to be
used in the analysis. Let's go and grab it and put it in the rows to check the values. As you can see, we start from the domain name and the
protocol is cut it. The whole value going
to be the rest. Now next, we have the following
task for you. All right. The task is to extract the last four digits of the phone numbers
from the customers. And to go to the addresses and extract only the street name, so we're going to remove the
code and the word street. Now you can go and
post the video in order to complete the task, and once you are done,
you can resume it. All right. I think
it's really easy. Let's go to the
small data source. We're going to go
to the customers and grab the phone to the view. Now we want to extract
the last four characters. We are speaking about
the right side right. We're going to reuse
the right function. Let's go and create a
new calculated field. We can call it phone code, and we can use the
right function to cut from the left
from the right story. The string value is phone. And we want to cut four digits. So we're going to
have the number of characters going to be four. So now the calculation is valid. Let's say okay and take
it to the results. And as you can see with
that, it's really easy. We got the last four digits
from the phone number. All right. Now we're going to
go and solve the next task. We need only the street
names from the address. As you can see
over here, we have the code and then
the word street, and then we have
the street name. We want only this
piece of information. Since we want to start
cutting over here, we're going to use
the mid function to define the starting
point of the cut. Let's go and create a
new calculated fields. We're going to call
it address stretch. So we're going to use
the function mid. The first value going to
be the field address, and then the starting
point can be nine. The rest, we're going to
leave it as it is, that's it. Let's apply and
check the values. Drag and drop in the view. As you can see
with that, we have only the streets
from the address, we cut it the first part. If you solve the task using
eight instead of nine, that's because you forgot
to count the white space. If I just remove
it, and use eight, I might get exactly
the same results, but we have white spaces,
which is not really good. The spaces counts.
It should be nine. That says, This
is really simple. This is how you can extract
informations in Tableau. All right. That's all about this use case, how to extract specific
substring from the text using the three
functions left, right, and mid. Next, we can start
talking about bunch of functions on how to search for specific
patterns in tableau.
97. String Functions | Search: STARTSWITH, ENDSWITH, CONTAINS, FIND, FINDNTH: So now we're going to
move to the next use case where we're going to
learn how to search for specific patterns in our text
using calculated fields. Here we have five functions. We have start Width, end
width contains find and find. As usual, first we have to understand the
concept behind them, then we're going to go
and practice in Tableau. Let's go. All right, everyone. The search functions in Table going to be split
it into two groups. The first one going
to return whether the substring exists
or not in our text. And here we have
three functions. We have the start with
end width and contains. The output of those three
functions is going to be always either true or
false, we have a pulan. For example, we have the
function we have our string, and we are searching for dashes. So here the output going to
be either true or false. And this example going to be true since we have
it here twice. Then we have a second
group of functions where it can return the
position of the string. Here we have two functions,
find and find in. The output going to be
the position number, so we're going to get numbers
out of those two functions. For example, if we take
the function find for the same string and we are
searching for the dash, here we're going to
get the output of six. We are not getting
true or false. We are getting the
position of the substring. Here in this example,
can be the first one. It has the position number six. So as you can see,
both of them could be used to search for a
specific thing in our text, but they answer
different questions. So the first group can
answer the question, whether the substring
exists in my text, yes or no, true or false. But the second group
can answer my question. Why I defined my substring. So here we're going to get the position number of the search. So now let's go and focus on the first groups
of functions. We're going to focus on Start
with with and contains. Now we can start with the
first one, start with. Let's say that we have
the following text. Monitor LG four k. The syntax in table
going to be very simple, so it's start with the keyword, start with, and it
accepts two arguments. The first one going to
be the string field. It is the text where we
want to search inside it. The second one we'll
have the substring. Here we can specify what
we are searching for. The output as we learned, it is going to be either true
or false, so it is plian. So let's take an example. We have start with our text, and we are searching
for the word monitor. So let's see how this can
work. It's really easy. So we start searching from the left and we
move to the right. So the start position for the search going to
be the M character. So now, Table can go and start matching the monitor
here in our text, starting from M. As
you can see here, the first part of our text is matching with the substring
that you are searching for. Our text start with
monitor, which is correct. So that's why table can
return. It's true. Okay. Now let's take another
one. Here we are asking, does our text start
with the substring LG? Of course, if you're
checking our word, if you start searching from
the left to the right, Our text does not start with LG So Tableau will
not find a match, and it's going to
answer with a false? So, that's it. It's
simple, right? We are just asking a question. So we ask Tableau something and table can answer with
either yes or no. Okay, so now let's move
to the next function. We have the ends width. It's exactly the opposite. Alright. We're going to
work with the same example, and the syntax in
Tableau is very similar. So here it starts
with the ends with. Here it accepts to
argument as well, the string field where we're
going to search inside it, and the substring here, we can specify what
we are searching for. The output can be as
well, true and false. So let's start with
the first example. We are asking here. Does our text ends with? Four K. So here Table can start searching from the right
sides, moving to the left. So now here does our text
ends with four k. So yes, the last two characters
is four K. That's why Table answer was
yes. So that's it. The output the
result can be true. Let's ask another question. Does our text ends with LG? Well, if you check
the text over here, It does not end with LG. LG is in the middle. So the last two
characters is not LG. That's why Tableau can
answer with false. So the answer is no. So as you
can see, it's really easy. We are just asking questions, and Tau is answering
with either yes or no. Let's move to the next one. We have the contains. Okay, so now we are working
with the same example, and the syntax is very
similar to the other two. So here it starts
with the contains, and it accepts two things. The first one we need to specify the text that you
are searching inside it, and the next one we're going to specify what you
are searching for. The output is going to be as
well pulon true or false. Yes or no. Okay, now let's ask Tableau the
following question. Does our text contain
the word monitor? So what Table going to do is that it's going to
search everywhere. So it will not search at
the start or at the end, it's going to search everywhere. And if the word going to be found anywhere inside our text, Table can answer
with yes, withdraw. So does our text contain
the word monitor? As you can see, it's true. So Table return, yes. And now let's ask
another question. Does our text
contains the word LG? Well, if you are
searching over here, you can find it in the middle. So that's why Table can answer
as well, withdraw. So yes, Our text contains
the word L G. Okay, so let's move on and ask
the following question. Does our text contain the substring four G. So if
you check the text over here, we have the four, we have the G, but
they are not together. That's why Tau can answer no. We don't have the word
four G in our text. So now, as you can
see, the function contains does not
have any restriction. It's going to search everywhere. It's not like start
with and end with. So the substring should not be at the start and at the end. If the substring
exists anywhere, then yes, it's true. If not, then it's false. So that's this is about
the three functions. Let's go now in Tableau
and start practicing. All right, guys. Now
you might ask me what are the use cases for
those three functions? Well, I use them
in two scenarios. The first use case, when
I'm exploring a new data. The second use case is when I'm offering new filters
to the users. Now let's start with the
first one exploring the data. This is specially
useful if you are new to a project or if you
have a new data source. The first step is
usually is to explore the data and lay the
content of the data source. If you are in this
situation, you might have a lot of questions
about the data. So you have those
three functions, those three tools in order to explore the new data that you have Then let's go and explore the products inside
our big data source. We have there a lot of products, and I would like to understand the content of my data source. Let's take the product name to the rows and as you can see, table saying, Okay,
there's a lot of members. I recommend to have only 1,000, but I would like
to see everything. I'm going to say add all
members to the view. Now as you can see
we have a lot of products inside our data source, and I would like to understand
the scope of my projects. What are the content
of those products? I like to know whether we have Apple products inside
our data source. So we're going to go and create a new calculated
field to answer that. So we're going to say
products starts with Apple. That says, we're going to use
the function starts with, starts with it need
two arguments. The first one is
going to be the text where we're going to
search inside it. It is our product name. So we are searching
inside the product name. Now what we are searching
for is the word apple. I'm going to write it like
this and everything is fine. You can see the
calculation is valid. Let's click. And as you
can see on the left side, we have a dimension with the data type pulon because we have yes or no, true and false. Let's take it to the rows
and check the results. You can see over here we
have a lot of falses. And I'm going to go and sort
it in order to see the true. So we can see over here,
we have four products where the product name
starts with Apple. The others does not
start with the apple. So as you can see, now, we have a little bit more
insights about our data. Let's go and ask the
follow up question. Does the product name contains
anywhere the word apple? So not only at the start
or at the end, anywhere. In order to ask the question, we're going to go and create
another calculated field. We're going to call it products. Contains Apple. And we can use the
function contains. I need two arguments. The string that we
are searching inside, it's going to be
our product name. What we are searching
for is Apple. That's it, and the calculation
is valid. Let's say ok. Again, here we have a
dimension called products with the data type true and false p. Let's track and rob it here. But first, I'm going to go
and make it a little bit bigger to see the
header of the field. So as you can see the
first one is contains, the second one is start with. Let's sort it by contains. As you can see, we have
around seven products. Where the product name contains the word apple. Now,
let's check the results. As you can see, the first one, we have it over here,
the word Apple. The second one is over here and the third
as well over here, and the rest those
word products, they starts all with
the word apple. So as you can see with
that contains functions, we're going to get more
results than that starts with. All right. So as you can
see, we are learning more about the products
inside our data source. We have seven products
from the company Apple. Let's have the
follow up question. Does the products names
ends with the word Apple? So in order to do that,
we can create and again, a new calculated field. Let's call it products
ends with Apple. So we're going to use this time, the function ends with. And again, here we
have the product name, and we are searching
for the products. So thus the product ends
with the word apple. The calculation is valid. Again, we have here a pulin. Let's drag and drop it in the
view to check the results. And now let's go and
check the results. I'm just going to make a
little bit wider to see. This is the ends with.
Let's go and sort it. As I'm sorting, we
don't have any true. All the values are false, and that means we don't have any products where it
ends with the word apple. So with us, we understand
that the word apple exists only at the start of the product name
or in the middle. You can see those
three functions are really great to
understand our data. Now let's go and ask
the follow up question. Does the product name contains
the word Samsung anywhere. Here we are searching
for the products from the company Samsung. In order to do that, I
think you already know it, we're going to go and create
a new calculated fields. We're going to call it
products contains Samsung. We're going to use the
function contains, and we're going to search inside the field name Product name. This time we are searching
for the word Samsung. So as you can see
the calculation is valid. Let's go and hit. So let's bring it to the view. So now I'm going to just
make it a little bit bigger to see what we
are talking about. So here it's about the Samsung. Let's go and sort the results. We can see that we have a lot of products from the
company Samsung, so we have more products from Samsung than Apple
in our data source. Let's check the results again. So here we have it over
here, Samsung over here. Then we have a lot of
products where it starts with the word Samsung again
here in the middle. But it never end up
with the Samsung words. Okay, guys, there's one more
function that I usually use inside the calculations if I'm searching or
exploring the data, and that is, case functions, the upper and the lower case
that we learned before. And that is because Tau is
case sensitive in the search. So we have to pay attention how we are writing the search term. So in order to now
overcome this problem, we're going to use
the case functions. Let me show you an example. So now we can ask the question, does the product name contains anywhere
the word of black? Let's go and create a new
calculated field as usual. We're going to call it products. Black, and this time
we're going to use as well that contains the string, the product name, and we are searching for
the word black. So that's it. Let's say okay and we have it as
a new dimension. Let's check the result as usual. I'm just going to
make it a little bit wider to see the results. So now we have a lot of falses, and we have as well,
a lot of true. So there is a lot of rodacts
that has the word black. As you can see over here,
we have here black, we have over here as well, the word black at
the end, and so on. So there's a lot of rodacts
with the word black. So the case here is the capitalized of
only the character B. Let's go and change the
case in the search term. So we're going to go and
edit. The calculations. Now instead of the first
character capitalize, you can have it as small, everything in the lower case. Let's go and hit Apply. Now as you can see
in the results, we have only one product with the word plaque
as lower case. Tableau is very sensitive with the cases inside
the search term. And if we switch
everything, for example, to Abacse plaque, let's search. As you can see, all the products that we have is now false, we don't have any products that contains the word
plaque in Aber case. Tau is very sensitive about the cases inside
your search term. Now to fix this,
instead of going and changing each time the
case of the search term. Lower case, uppercase
capitalize and so on, we go to the product
name and we force it to be uppercase or lowercase
using the lower or per. So we're going to go
over here and add, for example, the lower. You can use upper if you want. We're going to have
the same results. With that, we are first, forcing the product
name to be a lower, and then we're going to
search for the word plaque. With that, I'm covering all the scenarios
inside my data source. Let's go and hit OK. With this, I will get all the products
that contains the word black doesn't care whether it is a lowercase or uppercase, we're going to get everything. With that, I'm sure that the string is containing
the word plaque, and we are not missing anything. So that's why I include the upper and lower case inside the calculations
before I start searching. That's it for the
first use case. This is how I usually use
those three functions in order to explore and learn the
content of my new data source. Let's go now to the second use case where
we're going to use those three functions in order to offer new filters
to the users. For example, let's
create a filter for the companies inside
the product's name. Let's go and create a
new calculated fields. We're going to
call it companies. And this time going
to be a little bit more complicated
than before, but we're going to
do it step by step. So we are searching first
for the company Apple. So we're going to have
contains broac name. And the search term going
to be apple lowercate, but we have as well to lower
cast the brodat name, right? So lower and we're going
to have it like this. So this is the first
one. I'm just going to copy it and paste for
the next company. We're going to have Samsung, and then we're going to
have Microsoft soft. So we are searching for those three companies, and that sets. So now we're going have
those three companies. But as you know, the output of the contains is always
true and false. But I would like
to have value in my filter called Samsung
Apple and Microsoft. In order to do that,
we're going to use the logical operations, F L statements, don't
worry about it. We can have a dedicated tutorial for that later, but we
have to use it now. So now, just follow me, we can use it to evaluate
those conditions. So it starts with F
for the first one. So I contains the product
name Apple, what can happen? So then I would like
to see the value Apple And then if it's not true, then go to the next one Ls F. Then we're going to
evaluate this condition. If it's true, then it's
going to be Samsung. Then if it's false, of course, we're going to use another LSF. We're going to
evaluate this one, and then the output,
if it's true, going to be microsoft. So that's it. If doesn't fulfill
any of those conditions, we're going to have the Ls. Let's say an. So that's what we're
going to end it. Don't worry again
about those logics. We're going to talk
about it later. With that, I'm going
to get values. I'm going to get
those three values instead of true and false, and we are evaluating
those conditions. Let's go and hit. So as you can see now, we
have new dimensions. The data type is not
polon not true and false, and that's because the output of the calculation now going
to be string values. Let's go and show
it as a filter. Now we can have those
values as you can see, Apple, Microsoft,
Samsung, and unknown. I'm going to add it as well to the view to see the results. So let's go and
grab it over here. So now the users
can go and start filtering the data
based on the companies. So let's remove everything
and start with Apple. So with that, we're going
to get all the products with the word Apple inside it, or we have Microsoft. So now we can see those
products are from Microsoft. The same goes for Samsung. So with that, we are filtering
based on the companies, and we use the product
name as basics for that. And the unknown, I
think is going to be a lot of values unknown. You can go like step by step, adding more companies
to our filters, but now I just show you
an example for that. So this is exactly the power of the calculated
fields in Tableau. We introduced new information
based on the functions. So this is all for
this use case, how to create filters based on those three
functions. All right. So now we're going to
focus on the second group of search functions in Tableau. We have the two functions
find and find in. Here we are answering
the question. Where do I find my search term? So we are searching for the position number
of a search term. This time, we are not
getting true and false. We are getting the
position number. So let's understand why do
we need this. All right. So now let's quickly
understand the differences between find and find h. Well, in find, we are returning the position number of
the first occurrence. In the find h we are returning the position number of
specific occurrence. So for example, let's say
that we want to search for the position number of the
dash inside this string. So the result is going
to be six because the first occurrence going
to be at this position. But in the other hand,
we can use the function find in for the same text
and for the same search, we are searching for the dash, but we are asking now the position of the
second occurrence. So the first occurrence
is going to be ignored. We're going to get
the position of the second occurrence, and
that's going to be ten. So this is the main differences between those two functions. I find, we are searching for
the first occurrence always, but in find in, we can specify which occurrence
we are searching for. So let's go more in details about the function
find. All right. So now we're going to
have this example. And as you know,
that each character in the string has a position. So C has the
position number one, and the character five has
the position number 14. The syntax for find in Tableau
is as well, very simple. So it starts with
the keyword find. And here we have
three arguments. The last one is optional. String is the text where we're
going to search inside it. The substring is what
we are searching for, and here the start
position of the search. So as you say it,
it is optional, the output going
to be in number. So for Let's say
that we want to know the position of the
dash inside this text. How this works,
it's really easy. It starts from the
left side always, since we didn't specify anything for the
starting position, it's going to start from
the first character. Table can start searching in the first character,
we don't find it. The dash, we can find it at
the position number six. The output is going to be at the position number
six. All right. Now let's take another
example where we can specify the start position
for the search for Tableau. We're going to have
the same thing again. But we're going to say
this time start from the position number
seven. What can happen? We're going to start
searching from here and Tableau can start
from left to right, so we're going to
find it over here. Add the position number ten. The result going to be at
the output ten instead of six because we start
searching from this position. That's all for the
function find. Let's move to the next
one. We have the find. We're going to work
with the same example. The syntax is going to be
a little bit different. It starts with the
keyword, find. The string value where we're
going to search inside it. We're going to specify
what we are searching for, but this time, we're going
to specify the occurrence. So here we have to tell Tableau which occurrence we
are interested in. Let's take an example. We
have the following question. Find the position number of
the dash inside the string, but we are interested in
the second occurrence. So how this is going to
work? We're going to start searching from left
to right, as usual. Here we cannot specify the
start position of the search. So we don't have this
option over here. It can always start
from the first one. So as we are searching
from the left to right, We have the first occurrence
of this character. So we have it at the
position number six. Here the output will not be
the position number six, because we told Tableau, we are interested in
the second occurrence, not the first one. Tableau going to go and keep searching for the
dash in the string. So we're going to find it
at the position number ten. Here is the second occurrence of the dash inside our text. So this is exactly what
you are looking for. The output going to be
the position number ten. That's it. This is how
this function works. We can search for specific occurrence in the function find, we're going to get always
the first occurrence, but there we can specify
where to start search. So now let's go in Tableau
and start practicing. All right. So now we can
have the following example. We go to start with
the small data source. Let's go to the customers, and I would like to
get their first name and as well, the phones. So now the task is to extract the country code from the phone and to put
it in extra field. So we are interested
in those informations, the plus 33 plus one
plus 49 and so on. So as we before, we can use
the function lift in order to extract the informations from the lift side in the text. So let's go and create that. So we're going to go and
create a new calculated field. Let's call it phone. Country codes. And we're going
to use the function left. We have to specify the string, so it's going to be the phone. Now the next one,
we have to specify the number of characters that we want to extract and exactly
where the problem comes. So sometimes it's
going to be like three characters and sometimes it's going to be two characters. So let's go for example, with the three, and
let's say okay. We have it over here
in new dimension. Let's just bring it to the view. And here we can find
exactly the issue right. The first one is fine. The third one is fine. But for those countries,
it's not working. We have the dash inside it, which is not really correct. Now, in order to fix this, we're going to use the
magic of the function find. So if you check over here, we want always the numbers
before the dashes, right? So we can search for the
position number of the dash, and then we can include
it in the left function. So let me show you what
I mean. We're going to go and create a new
calculated field. We're going to call
it phone. Find dash. So now we're going
to go and find the position number of the dash. So as we learned,
let's start with find, we have to specify where
we're going to search, so we are searching in phones what we are searching
for, right? We're going to have the
dash here, and that's it. We are not interested
in the start position, so we can start from
the first character. So that's it, as you can
see, the calculation is valid. Let's say okay. And since the output
going to be a number, we're going to get it at
the continuous measure. So let's drag and rob it over
here and see the results. So the position number of dash inside the
first phone is four, the second one, three, Then
443, everything is fine. So now the next step
what we're going to do, we're going to bring
those two calculations the left and find
in one calculation. So I'm going to go and covey the syntax from the
phones, fine dash, let's just cove it from
here and go back to the first calculation
about the country code. So let's go over here, edit it. And now instead of having
this three as a static, we're going to have
it as a variable using the fine function. So let's just add it over here. So now how Table can
execute this calculation, it's going to start with
the first function, find. So it's going to first find the position number of the
dash inside the phones, and then afterwards
we're going to go to the function left outside. We're going to now cut everything after this
position number. All right. So now let's go and check
the results at the string. As you can see, we
are almost there. So we have the plus 49 dash
plus one dash plus 33 dash, so the dashes are everywhere, and that's because we are cutting everything after
the dash position. So that means we are always
one step more than needed. So in order to fix it, it's really easy,
we're going to go back to our calculation. Yeah, we are getting here
the position number, which is correct, but we
want to get one step back. So in order to do it,
we're going to do minus one to go one step back. Let's okay. All right. So with this, we get
exactly what we want right. So plus 33 plus one plus 49, and with that,
we're going to get more dynamic in
the function left. If we are using
defined function. With that, we can see how we can bring those functions
together in one calculation in order to
achieve such a great goals. All right. Now let's try out the second function that
we have, the find nth. Now, let's say that we want to get the position
number of the dash, but in the second occurrence. So let's go and create
a new calculated field. We can start to the
keyword find nth. It's needs three arguments. The first one going
to be the text where we can search inside, it's
going to be the phone. And then we are
searching for the dash. And then the third
one, we're going to specify which occurrence
we are interested in. So we are interested
in the second one. That's it. The
calculation is valid. Let's click. Since
the output is number, we're going to get a
new continuous measure, let's bring it to
the view over here. Now, let's check the results. For the first phone, the
second occurrence of the dash is going to be
at the position number eight, which is correct. As you can see, the
find is number four because the first occurrence
at the position number four. For the second one,
it's going to be in the number seven, which
is as well correct. Now let's go and start
changing those occurrences. Let's go and edit it again. I would like to get now
the third occurrence. As you can see, we have
a third dash over here. So let's change it to
three and just apply. You can see now we are
getting the position number 12 for the last dash
in the phone number. So that we are getting
the third occurrence of the dash inside our text. But now, if we go and switch
it to one, what can happen, we're going to get exactly
the same result as find because find can always
bring the first occurrence. So here we are saying I'm interested in the
first occurrence. All right, y. So that's it for those who functions
find and find. They are really useful to get the position number of
specific substring, and I usually use them
in another calculation. So they are like supporting
Another function. Alright, so that we have
learned how to search for specific patterns in our text in Tableau using Tableau
calculations. Next, we can start talking
about another group on how to compile and
split the data in Tableau.
98. String Functions | CONCAT & SPLIT: So now we're going to learn
how to combine and split the text in Tableau using
the concatenation operator, the plus and the split function. But as usual, let's understand
the concept behind them, then we can practice in Tableau. Let's go. All right. So now we're going to talk about the concatenations table. It's very simple
we use for that, the plus operator in order to combine multiple
text into one text. For example, in our database, we could have the
following scenario where we have the first name and the last name separated from each other's using
different fields. We would like to
have only one field called the full name. For example, in
order to do that, we can use the plus
operator in order to combine the first name Michael
with the last name Scott. At the end result,
we're going to get the full name Michael Scott. But now, if you check
in the full name, we would like to have always a separation between
the first name and the last name in the
output inside the full name. We usually use the space between them. So we
can do the same. We're just going to
add one plus operator. We have Michael space Scott. Between Michael and space, we're going to have
the plus operator, and between space and last name, were going to have as well,
another plus operator. The output going to be
Michael space Scott. As you can see with
the plus operator, we can structure
anything we want by combining multiple string
values together using the plus. That's it. This is really easy. Let's go back to Tau
and start practicing. All right. Now we're
going to go to the small data source over here and we go to our customers. We would like to
have the first name and the last name in the view. And as you can see,
those informations are separated in two
different fields. The task is now to create only one field for
the customer name, the full name, instead
of having two. In order to do that, as usual, we're going to go and create
a new calculated fields, we're going to
call it full name. Now we need the first
part, the first name. And then after that, we're going to have the plus operator. Then we want to have a separator between them as an empty space. So we're going to
have it like this. And then plus operator, the last part going
to be the last name. Let's take the last name and put it over here. So that's it. It's important that
the calculation is valid, so everything is fine. Let's. Now as you can
see in the data being, we have a new calculated field, a new dimension called full
name. Let's check the values. We're going to drag
it over here on the rose, and as
you can see now, we have a very nice full name, George Pips, John Steel, and so on. It's
really simple, right. So now if you change your
mind, you would like to have a dash between those names. What we're going to do, we're
going to go and edit it. Then instead of having the white space over
here in the middle, we're going to have
the dash. That's it. Let's it apply, and now we
can see in the full name that the first name and the last name are separated with a dash. It's really symbolistic.
Now a quick task. The task is to combine the category and the product
using the following rule. As usual, you can pass the video in order to
complete the tasks, and once you are done, you
can resume it. All right. So now let's check the solution. It's very simple, we're
going to go to the products. Let's first see the raw data, we have the category
and the product name, and now we're going
to go and create a new calculated field. So we're going to call
it full products name. So the rule starts
with a category. Then we have a R plus operator. After that, the separator
can be the double point, but after the double point,
we have a white space. I'm just going to
add it over here. Then we have a plus,
and we're going to have that product name. Let's
check the results. The calculation is
valid. It's click. And here we have
our new dimension. Let's just drag and drop it over here and
check the results. Just go to make it
a little bit bigger so we can see the results
from here and here as well. So as you can see,
our product name now starts with the category, double point, then the
product name. And that's it. This is how we can work
with the concreteican in Tableau. It's
very simple, right. So now we're going to
learn the exact opposite, so we're going to
learn now how to split one field to multiple
fields using split. All right, so now we're
going to talk about the split function in Tableau. It's very important function, and a lot of people
get confused about it. But I think it's simple. So let's check this example. We have here one field with
a lot of informations. So we have here
the product name, the product ID, and the
product code all in one field. And in many situations in the analysis in
divisualizations, I would like to split those informations
into three fields. So instead of having one field, I would like to have
it in three fields. So in order to do that, we
can use the split function. And before we learn that we can do that with
the left, right, and mid, but the split function is easier in such a situation. So we want to split this
field into the product name, the product ID, and
the product code. And I tableau we
have the following syntax in order to do it. So we have split, and it
needs three arguments. The first one is the string, the text that's we
want to split it. So now let's go and
check the syntax in ta. It's start with
the keyword split, and it needs three arguments. The first one going
to be the string or the field that's
we want to split. The second one going
to be the demter and then the last one,
the token number. The output going to
be a string value. Now let's take an example. I would like to split this text and the delimter
going to be the dash, and I would like to have
the token number one. So here Tableau needs from
you two informations, the delimter and
the token number. The delimter is the
separator between words. So for example, we have
a separator between canon and the ID using the dash, and we have another separator between the ID and the code. Those dashes are the delimter
that splits my text. So Table he wants to
understand from you how the words are
separated inside the text. Now, let's move to
the next information that is needed the token number. Here, as well, Tableau
wants to understand which part of information
you are interested in. Is it the first part, the
second part or the last part. So here we have an ID or token for each piece
of information. So the first one go has
the token number one, the second one, we
have token number two, and the last one is the
token number three. In this example, we said, I'm interested in the
token number one. That means I'm interested
in the product name. So the output can be can. And of course, if
you're interested in the product ID in the middle, we could say, okay, I'm interested in the
token number two. So if you specify it like this, you will get the product ID. And if you're
interested, of course, and the last one in
the product code, you can specify the token number three in order to get
the product code. So as you can see once you understand it, it's really easy. We just need two information
what is the separate between words and which token number you
are interested in. So now let's go back to
Tableau and start practicing. All right, everyone.
There are three ways on how to split your
data inside Tableau. The first one is by creating
new calculated field. The second one is
automatic split. The third is customized split. So we're going to start with the first one on how to split your data using new
calculated field. We're going to take
the following example. We're going to stay with
the small data source. Let's go to the customers and
grab the phones over here. And the phone numbers
has a structure, so we have a country
code area code and the phone number itself. So now we would like to split those three informations
into three new fields. Let's see how we can do
that. We're going to go as usual and create a
new calculated field. For the first part for
phone country code. So we're going to start
with the split keyword and it need three arguments. The first one is going
to be the string that we want to manipulate. It's going to be
the phone number. I'm going to add it like this. Then the dilim The
dimter here is the dash. As you can see, those stuff
are split it with the dash. So let's just add it over here, then Tableau needs from
me a token number. The first one is going to
be the token number one, then two, three, four, we have four sections, and we are interested in
the first token number. The first one. So let's
add one, and that's it. As you can see the
calculation is valid. Let's go and hit okay. Now we can see that on our
data bin in the data source. We have our new field,
the country code. Let's go and grab it to the
view and check the results, and with that we are
extracting the first token the first part of the
phone and with that we have, our country code,
everything is perfect. Now the next step,
we would like to go and extract the code. The token number two.
Now we're going to go and create a new
calculated field. But first, I would like to take the old code because
we want only to adjust the token number because everything else
can stay the same. So let's go and
create a new one. We're going to call
it phone area codes. Then we're going to put
our code over here. The same stuff is going to
stay at the phone and as well, the dash as separator. Then we want to change
only the token number two, we are speaking about
the second part. Let's go and hit and check the results
we have here again, our new field, So track
and drop it on the view. As you can see now
we are getting, we are splitting
the second part. So we have here 555
and as well over here. With that, we got the
third part from our phone. We have now the country code
and as well the area code. Now next, we have the
following task for you, create a new field in the
data source to extract the phone number part without the country
and the area codes. Now you can pass the
video in order to complete the task and once you are done, resume
it. All right. Now we're going to go and
create a new calculated field. We're going to call
it phone number. And we're going to
have the same script. We have split phone dash, but this time, we are interested in both talking three
and talking four. How we can do that in Tableau, we can add only
one token at time. In order to do that,
we're going to go and change this two three. Since we need both of the
informations in one field, we can use the plus operator. What we're going to do,
we're going to go over here, plus and then we can add
the same code over here, but this time for the
token number four. So with that we are getting both of the tokens in one field. So the calculation is valid. Let's say, okay. And as usual, we got a new field
in our data source. So let's check the
result over here. We can see that. Now we have the phone numbers in this field. So now, as you can see, the
first one is one, two, three, four, five, six seven, and we
have it as well over here. So we have as well the
same phone number. But you might say,
You know what? We are missing the dashes right, so we can go and add them
in our calculated field. So let's go and edit it, and we just can add
new plus operator, and between them, we're going
to have the dash right. So as you can see, the
calculation is valid. Let's go and hit ok,
and with that we got exactly the same
structure from the phone. That's it for the first
methods on how to split your data using
new calculated field. You can see from one field, we have extracted
three new fields. Now let's go to the second
method where we can split the data using automatic
split. All right. Now, we can do that. We're going to stay with the
small data source. This time we need the URL. Let's take the product
image from here. Drag and drop it in the view, and we know that in the URL, there is a lot of informations, and as well, we can use the
splitter to split the data. Now instead of creating manually
those calculated fields, there's really nice
feature in Tableau where we can split the
data automatically. In order to do that, we're
going to go to our field, the product name, radically and here we have the
option of transform. We are manipulating the data, and here we have two options, the split and the custom split. The split is the automatic qua. We got now a lot of new
fields in our data source, and that's because table
automatically split the data, and as well understood
the content of the data. So you can see here we have
the product image domain, the fragment path query schema. All those informations are
part of the structure of URL. So now let's go and check
those informations. We're going to take for
example, the domain, track it on the view. And as you can see,
tablecs correctly right. We got now only the
domain information from the whole URL,
which is really nice. We can take as well
the scheme over here, and we have the protocols
from the start. So you can see Tableau
get it really correctly. Some of those fields is
going to be empty, I think, because we don't have it
as a part in our URL. Whether Tau did the
automatic split, and if you would like to learn
how Tableau did split it, you can find it as well inside this field because it
is calculated field. So let's see how Tableau
did split the domain, right clo it and go to it. So as we can see here,
Tableau is using two splits in order to get
the domain information. The first split is this one. Tableau is splitting the
protocol from the whole URL. So the separator going to be the double point and the
two forward slashes, And we are taking the token two, so we are getting
the second part. Once we get the second
part can be really easy. The separator as you can see, is the forward slash. So we want to split now
with the forward slash, and we would like to get
only the first part. It's really easy. You can
go and try it yourself. That's it. Let's click. With that, sta, in some
cases, not in all cases, is smart enough to split your data into new
fields automatically. So that's it for this
mesode the automatic split. Next, we're going to see
the customized split. So we're going to stay
with a small data source, and we're going to
go to the customers. Again, here we want to split the phones using
the custom split. So let's bring it to the view. And then in order to
customize the split, we're going to go
to the data pin on the field that we
want to manipulate, radicalli and then
here we have transfer. Before we have the
automatic split, this time we are interested
in the custom split. So let's go inside. And
then we're going to get a new window in order
to customize the split, and it's like the
calculations, the syntax. Tableau needs from
us two informations. First, the separator, second, what do you want exactly
to get the token numbers. The first one, the separator or the dilimter in this
example, can app the dash. All those informations are
split it with a dashes. So let's go and enter a dash. The second information, we
have the following options, split off, and here we
have three options. Do you want the first part, the last part or everything? Here it depends on
what do you want. If you want to split
everything you want for each piece of
information in fields, you're going to go
with the option A. Now, let's say that
you are interested only in two informations, the country code,
and the area code. The rest, you are not interested to have it in the data source. So in order to get
the first two parts, we're going to go over
here and select first, and here you can specify two. So we are interested in the first two columns and
the first two informations, the left side. But
now, let's say that you are interested in
the last two parts, so you would like
to get two fields for the last two informations. So what you're going to do, you're going to go over here and select last and as
well, select two. So that you are
specifying for Tableau, what do you want exactly
to get as a results, how many fields from the start, from the end or everything. So in this example, I'm
interested to get everything, so we're going to go
with the option A, and that's it. Let's go and hit. Once we do that,
Tableau going to go and create a
lot of new fields. Tableau did manage to split the phone number
into four parts. So let's go and check
those informations, drag and drop it over
here on the rose. As you can see, the first part going to be the country code, the second one going
to be the area code, and then Tableau split those two informations into two fields. Here it's not like the
second method where we are blindly automatically
splitting everything. Here we are specifying
for Tableau few rules, and then Tableau can go
and as well automatically split the data to get better
quality in the fields. Of course, if you're interested on how Tableau did the split, we can always go to the data pay all those informations are. Calculated fields, and we can go inside them and
check the code. So we can go over
here and do it. As you can see, the dilimter
is the dash and table gate it as a first token in order to get the country code. All right, that says, those are the three
methods on how to split the data inside
your data source. They are really
useful in order to generate new
informations and split those complex structures inside the original data source into new structure for the
analysis indivisualizations. All right, e one. That's it. This is how you combine and
split the text in Tableau. Next, you can start
talking about the last string function
in Tableau, they replace.
99. String Functions | REPLACE: So now we're going
to learn about the latus case for the
string function, how to replace specific
substring with another substring using
the replace function. As usual, let's understand
the concept behind it, then we're going to practice
in Tableau. Let's go. Okay, the replace function in
Tableau. It's very simple. It's going to replace one
substring with another one. So for example, we're going to have the
following address. And as you can see
in the middle, we have the abbreviation
of the street, T dot. So I would like to have a
normal wording of this. So instead of having
the abbreviations, I would like to have the
complete word street. And we can do that using the
replace function in Tableau. Let's check now the
syntax in Tableau. It's start with the black word, and it needs three arguments. The first one, it's
going to be the string, the original text that
you want to manipulate. The second one is the substring, the one that you
want to replace. The third one is
the replacement. So it's really clear.
This is going to be the new substring,
the new word. Here the output can be
as well a string value. In order to solve this
task in this example, what we're going to do,
we're going to use replace, then our text, then
the old one going to be the ST dot,
the abbreviation. This is the old substring, and the new one going to be the street, the complete word. How this can work,
T has first to search for the substring
that we want to replace. It's going to search
the whole text in order to find the substring. In this example, of
course, we're going to find it over
here in the middle. The next step is that
Table going to go and start replacing this word
with the replacement. Table going to take
the SD dots and can replace it with the
complete word of street. At the end we're going to
get Louis street Paris. As you can see,
it's really simple, we are replacing the old
value with a new value. At the end, the string
going to look like this, we can have a street
complete instead of ST dots. Now of course, the question is, what can happen in the
output and the results. If we don't find anything. For example, we have
this address and Paris, we are searching
for the ST dots, but we don't have
it inside the text. Here table can return the original text without changing anything,
nothing can happen. That's it. It's
really simple, right? We're going to go back
to after Tableau in order to practice the
replace function. Okay, now we're going to go and practice with the
small data source. Let's go to the customers, and we're going to manipulate the phone number again
for the customers. Now, as you can see
the structure in the phone number starts always with the plus for the prefix
for the international call. Now we have the
requirement to replace the plus with zero zero as a prefix. Now in order to do that, we're going to use the
replaced function in Tableau in order to do
the switch, the replacement. Let's go and create a
new calculated field. We're going to call
it phone replace. So it's starts with
the keyword replace. We need now the field that
we want to manipulate. It's going to be
the phone number, so we have it over here. And now we need to
specify for Tableau, the substring, the old value. The old value is the plus sign And now we have to specify for Tableau the replacement,
the new value. The new value can be
zero zero. So that's it. Tableau has the
calculation as a valid. So let's go and hit okay. And with that, as
usual, we created a new calculated field
in our data pin. Let's go and check the results. So drag and drop the rose. And now we can see the result, instead of having the plus
sign we have everywhere, zero, zero, and with that, we have fulfilled the requirements. And now we might get another requirement where they
say, You know what? I don't want those minuses
inside the phone number, so it would be nice to remove. In order to do that, we're
going to do the same thing. We're going to use the
replaced function, the old value going
to be the dash and the new value
going to be nothing. Let's see how we can
do that. Now let's go and edit our
calculated fields. We just want to add
new replaced function. Let's go edit over here. Here it doesn't matter
whether we want to replace first the
plus or the dash. Now, in order to do that,
I usually do it like this if I'm doing STD, replace. What we are replacing
the phone number. So instead of having the dash, We're going
to have nothing. So we are replacing the old
valued dash with nothing. Now in order to have it nisted, I would like to take this part, the first one and put it
instead of the phone. And with that, we are
having nisted calculations. First, we're going to
replace the plus sign, second we're going to
replace the dash sign. So let's take it to the first
row and with that T saying, the calculation is
valid. Let's go and hit. And as you can see
now in the results, we don't have any
dashes or plus sign, so we have a whole number
without any special characters. So with that resolved,
the second requirement. It's easy. It's not
that hard and we can do a lot of things
with the replace function. It's great function to manipulate the string
values in Tableau. Now for you, we have
the following task. In the big data source
in the product name, we would like to
replace the hash simple with a number
as abbreviation. Now we can pose the video in
order to complete the task, and once you are done, you
can resume it. All right. We're going to go
to the big data source this time and we're going to go to the products
and we need the product name. Let's drag and drop
it on the view. And check all values. So now we're going to
make it a little bit bigger in order to
see more values. So inside the data, we have some hashes, like
he, for example, at the start, and we want to
replace it with in point. So in order to do that,
we're going to go and create a new
calculated field. So let's go in the R over here. Create a new calculated fields. We can call it products replace. So we're going to start
with the replace keywords, and then we need the string
that we want to manipulate. It's going to be
the product name. The next, we want the old value. So it is the hash. And then the
replacement is going to be the number as abbreviation. So in our point. So that's it, as you can
see, the calculation is valid. Let's go and hit. So what do we have
a new dimension, new calculated field
in our data pane. Let's try contribute in the
view and check the values. And we see over here
instead of the hash, we have the abbreviation
of the number. So what do we have learned
that the replace function is very simple and as well, very important in
many use cases. Use it a lot once I want
to clean up the data. So sometimes we get bad
quality from the sources, and there will be a lot
of special characters. I can use always replace to clean up the
data and to remove those special characters with something more meaningful
in the visualization. Like we did in this example, we replace those
special characters with something more meaningful. Or I use it a lot as well to change the
format of something. So for example, we here
have the phone numbers, and we change the
format from having the dashes to something
else like without dashes, and as well, instead
of the plus, we have the zero zero. So with that we are not
cleaning up here the phone. We are changing the format
and how we are presenting, the phones in the
visualizations. So on the left side, we
have the plus and dah. On the right side,
we don't have them. So we usually use
the replace function in order to change
the structure, the format of one field. It is just amazing and very
important tool in tableau. All right, everyone. So that's all for the replace function. And with that, we have covered all the use cases in
the string functions. We have learned around 16
string functions to manipulate, transform and clean up
the tx values in tableau. Next, we're going to
jump to another group of functions in tableau,
the date functions.
100. Date Functions | Extract Dateparts: DATENAME, DATEPART, DATETRUNC, DAY: All right. So now we're
going to talk about the third group of
functions under the category row level
calculations, the date functions. And there are three use cases for the date
functions in Tableau. The first one is to extract specific date part
from our date, like day year and month. And for that, we have six
different functions in Tableau. The date part, date name, date trunk day month year. The second use
case is to add and subtract date values
in our data source. So here we have two functions, date add and date d.
The last use case is to find and fitch the
current date and time, and here we have two
functions today and now. Those date functions going
to give us a tool to manipulate and transform
the date values in Tableau. We're going to start now
with the first use case, how to extract specific parts from the date using
those functions. As usual, it's
really important to understand the
concept behind them, then we can practice
in Tableau. Let's go. All right, everyone. In Tableau, there are two ways
on how to manipulate transform the fields
with the data type date. The first one is to
do it globally in the data source for all
worksheets, all workbooks. The other way is to
do it locally only in one worksheet,
only in one view. For the first one, if you
are manipulating the date and you want to reuse it
in different worksheets. So in order to do that,
we can go and create a new calculated fields
using the date functions. But now, on the other hand, if that transformation
is not that important. You don't want to reuse it, you don't want to use it
in any other worksheets. You need it only
once in one view. Then instead of creating new calculated field in the data source and using
the date functions, we could just simply
go and change the date format
directly in the view, which is way easier and quicker than creating
new calculated fields. So as you can see, there
is two methods in how to manipulate and transform
the dates in Tableau, either using the date functions or changing the date format. Now if you ask me which
method should I use, You have always to ask
the following question. Is the transformation going to be needed in
different worksheets? Then, yes, go and create a new calculated field
using the date function. But if the transformation is
only needed for one view, then you have to
change the date format directly in the visualization. Now we're going to go and
focus on the date functions, since we are talking
about the calculations, and at the end, we're going to talk
about the date formats. All right, everyone. In Tableau, we've got a bunch of date functions that all has the same goal to extract date
parts from specific fields, and we can use them to
generate such a view. As we can see over here,
we have the years, we have the monss, the quarters. All those information comes only from one field,
the order date, and we can build from all
those new information that we extracted a lot of analyses and insights about our data like the one
that we are seeing here, the HTM Let's go first understand those functions, and then we come
back to Tableau. All right. Now we're
going to talk about the first date function in
Tableau, the date part. We can use it in
order to extract a piece of informations
from our date fields. For example, we have
the following date. It is structured from
year, month, and the day. We can use date part to extract
one piece of information, like for example, the year. If you are extracting the year, the output can be 2025. But if you're
extracting the months, we're going to get the August 8, And if you're extracting the
day, we're going to get 20. And here, it's very
important to understand that if you are
using the date part, the output going
to be in number. So the year going
to be in number, the month will not be August, it's going to be in number,
so it's going to be eight. Same thing for the day, so
you will get 20 as a number. So let's see the
syntax in Tableau. It's very simple. So it's
starts with the date part. The tableau needs from you two informations. The date part. Here Tableau can ask you which piece of information
you are interested in. You would like to have the year, month, a day, and so on. And the second part,
the second argument can be the date field that
we want to manipulate. And the output, the result of this function
can be in number. So now let's take an example. We're going to take date part. Now we are interested in
the information of day. So we would like to extract
the day information. Then our date going to
be looks like this. The output going to be 20. If we want the months, then we have to specify a
month at the date part, and if we do it on this date, we will get the months eight. The same thing if you
want to get the year. So here we specify the
year at the start, then our date, the
output can be 2025. That's set for the date part. This is one method on how to extract a date part
from specific date. Let's move to the next one.
We have the date name. Let's see the syntax in
Tableau, it's exactly the same. Let's start with the
date name as a keyword. The tableau needs from
you two informations, which part of the date
you are interested in, and give me the field that
you want to manipulate. But this time the output
can be a string value. Let's take an example.
Let's say that we are interested in the year
part from our date. The output can be again 2025, but the value can be in
the data type string. But this time if you
say, you know what? I'm interested in the month. You specify a month
as a date part, this time tableau can
answer with August instead of eight because
the output year is string. You will got the name of
the month as an output. Now, the next one if you say,
I'm interested in the day. If you specify in the date
part a day instead of month, you will get as well a 20, but as a string value. That's it for the date name. It's very similar
to the date part. But the only difference is that there you are
getting a number, but with the date name you
are getting a string value. This is another method on how to extract the date
parts from a date. Let's move now to another
set of functions. That could be used
as well to achieve the same goal in
order to extract. Date parts from a date. This time we have three
quick functions in order to extract quickly
the date part from a date. They are my favorite. I
tend always to use them in compared to the other two because they are
really easy to write. The syntax in table
going to look like this. The first function, it
accept only one argument, a date, same thing for the
month and for the year. The output is going
to be a number. It's like the date
part function. For example, if I'm interested in the day, I can
do it like this. I use the function day, then the date that we
want to manipulate, then the output can be 20. As you can see compared
to the others, it's really quickly to create. Here we don't have to specify
for tableau in the syntax, the date part because the
function name called day. The same thing for the month, if I'm interested
only in the month, I can just use the
function month in order to extract the
August or eight. For the last one, if I'm
interested in the year, I can use the function year. You can see they are
really easy and quick to create if you compare
it to the other two. You can see they
are really easy. Let's move on to the next one. This can be slightly
different than all others. We have the date trunk. Some facts about this function. It is a little bit complicated. A lot of people
don't know about it, but I tend to use it a lot. It's very useful function. But it is not that famous. Think about the date trunk like rounding
function in numbers. If you have a lot of
details in one date, You can round the date
to specific level. What this means, if we have
the following date time. So we have here like
hierarchy, right? We have a year, month, day, hour minute and seconds. So we are seeing in this
data a lot of information, and sometimes you are
not interested in a lot of details like
seeing the seconds, minutes, and hours, you'd like to see only at the month level. So what we can do, we can use the date trunk in order
to round those numbers. Let's check first
the syntaxing table. It's very similar to the
others. It looks like this. Date trunk, then you
specify the date part. Then the date that you want to manipulate the output this time, it will not be a
number or a string, it's going to be date and time. The best way to
understand this function is to have some examples. Let's say that we specified
at the date part a day, and then we have our time and day over here. Then
what can happen? What you are telling
Tableau dots? The time informations are
really detailed for me, and I'm interested only to see this piece of information
at the day level. I'm interested only at
the day informations. I'm not interested in the time. So what can happen in
the output of dots. Tableau can return,
the same informations, but this time, it's going to reset everything at the time. You can see we are maintaining all the information
about the year, month, and day, but anything
below the day, it's going to be
reset it to zero. As I said, it's like
rounding numbers. You are rounding the
information to specific level. Now let's move to the next level where you say, You know what? I'm interested at
the month level. You specify at the
date part a month, then we're going to have the
same information over here. What you are saying
to Tableau is that I'm not interested in
the details in the day, I would like to see my
information at the month level. That we're going to
get 1 August in 2025. Now we're going to go one more step where
we're going to say, we are interested only
at the year level. So if you go and
specify the date part, the year, what going to happen? You tell Tableau, I'm not
interested in anything else. I'm just interested in the year. So I think you already got it. What can happen? Everything
can be reset it. So anything below the year. So the month, the day, the time can be resetd to one over year than
zero at the times, and we can have only
the value 2025. So that's it for this function. It is very useful in
many calculations to use the date trunk. So now let's go and compare all those functions
side by side. We have here as a
rose, the date part. So we have year, quarter,
month, day, and so on, and then we have
here on the columns, those different functions. I don't include here the day
month and year functions because it's very similar
to the date part. So the first thing
to understand that, the date part output
going to be a number. Date name output
going to be string. Date trunk output can
be date and time. And we can work with
the same example. So we have the
following information about the date and time. So now let's go and
see the output of those functions and those different levels
in the date part. So now let's start with
the first level the year. If you say, I would like to have the date part of
this information, you will get 2025, the same thing for
the date time. But this time for
the date trunk, you're going to
reset everything. Below the year. So you
will get 1 January 2025. So let's move to the next
level. We have the quarter. The date part quarter
of this date, it's going to be three. The same for the date name, it's going to be three, but
this time it's interesting, right, because in
date time we don't have usually the
quarter informations. So this time it's going to reset to the first month
of the quarter. It's going to be the
month number seven. So let's move to the next one
we are at the month level. So if you use the date
part, you will get eight. If you use the date
name, you will get the full name of
the month, August, and if you use the date trunk, you're going to reset
everything below the month and you will get the
first day of August. Moving on to the date, if you use the date part, you
will get a number 20. The date name you will
get a string value 20, and this time at the date trunk, you are resetting
the whole time. Moving on to the next one, we have alternative for the day, and here we're going
to get the weekday, the number of day inside a week. So here we're going to
get the number four from the date part
because it is Wednesday. So if you're using
the date name, you will get the full name
of the day Wednesday, and for the date trunk,
nothing going to change. We just going to reset
the time as well. And now if you are
moving in details, if you extract the hour for the date part and date
name, you will get nine. And here as you can see,
we are resetting now only the minute and the second because you are not
interested in it. So moving on to
the next 1 minute, we'll get 45 and
date part date name. And here we are resetting
only the seconds. As you can see, only
seconds are zero. Now, let's move to
the lowest level in the hierarchy. We
have the second. So we're going to get 21, 21, and the output going to be exactly the same
value in the input. So that you can see
the big picture using those three
functions and what are the main differences
between them and what you're going to
expect if you are using them. So now let's go back to Tableau and start practicing
those functions. Okay, so now we're going to
go to our big data source. Let's go to the orders, and we will be manipulating
the order date. So let's take it to the view. Table going to convert it
immediately to a year. So we are not seeing
the original data. We are seeing only the year
part from the order date. Because T wants allowed to make visualizations,
and of course, it makes sense to
have years instead of all dates inside
our data source. But in order now to show all the data like
in our data source, we're going to go
over here and switch it back to the exact date. So let's click on it, and Table
convert it to continuous. But I would like
to see all values. So we're going to
switch it to discrete. Now, as you can see,
we get all the values exactly like the source system. So we have around
five years of data. So now we're going
to go and practice by extracting the date parts. We're going to start
with the year. So let's go and extract those years. We're going to go and create
a new calculated field. Let's call it order date year. So here we have a lot of ways in order to get
this information. We can use the date
part, the date name, the date trunk or even the
year function. All right. So now we're going to
start with the date part. And as you can see it
accept two argument, but the third one is optional. Here you can define what
is the start of the week. But I usually leave it empty. The date part that we want
to extract now is the year. Then the date that we want to manipulate is the order date. That's it. As you can see that, the calculation is valid. Let's go and hit k as we learn, the output of the date
part can be a number. That's why table going to create a new continuous measure. But I would like
indivisualization to see is distinct
values of the years. I'm going to go and
convert it to a dimension. So now, as you can see, it
jumps to the dimensions, and we have it now as
a discrete dimension. Let's bring into the view
and check the results. As we can see now, we have all the years exported, extracted from the order dates. So now let's go and
try the other methods. Let's replace the date
part with a date name. Here it's very important
to understand that. The data type going to change. So here we have it as a number, and if we switch
it to data name, we're going to get
it as a string. So let's go and change
our calculation. Instead of date parts, I'm going to have date name. So let's hit apply,
and as you can see, immediately, the data type going to switch to string value. But in the view, we're going to get exactly
the same result, right. So nothing going to change
only the data type. Now, we're going to move
to the easiest one, the quickest one is to
use the year function. So instead of the
whole thing over ear, we can write a year, and we don't have to
specify the date part. That's why we're
getting an arar. We need only our date
that we want to modify. So that's it. Let's apply. As well, nothing can
change in the view, but the data type
can switch to number because the output of these
functions is a number. So now you might ask me,
okay, which one should I use? I recommend you always to use
the quick one, of course. But what is more important
is the data type. The data type number is always faster than
the data type string. The data type string
is the worst. It is the slowest data
type from all others. So we always try to avoid the data type string
in the visualizations, not to have bad
performance in our views. So if you are thinking about
those three functions, I would always avoid
that date name. So now we are left
with two functions, date part and the
quick function. I would always go
with the quick one writes because it's
easier to write. So I would prefer
this situation to have year or the date like
I'm showing it in the view. But of course, in a lot of
situations, you want to show, for example, the day
name or the month name. So it depends really
on the requirement, but if you can avoid it,
don't use date name. That says, this is
my recommendations to you and what I usually do. Now let's close this and extract another part
from the dates. We're going to have the quarter. Here again, we have
the three options and all three deliver the
same information. I would go and create a
new calculated field. Let's call it order dates, quarter, and this time, I'm going to use as
well, the quick one. Quarter order dates. It's
really simple, right. Let's now we have again a
new continuous measure. I would like Re Tau here to create immediately a dimension. I'm going to go and
convert it again to dimension because I use it
in the view as dimension. Let's check the results
and we can see we have now the quarter number
which is correct. All right. So now
let's go and extract another formation
from our dates. We're going to get
the month. So let's go and create again,
new calculated field. We're going to call
it order dates. Month. Now, this time, we can use a month function and our field order date.
It's very simple, right. So let's go and hit okay and we're going to convert
it again to dimension. And bring it to the view. So with that, we are extracting the month information
from the order date. So everything looks fine here. We have September,
August, and that's it. And here we are usually in
this situation where the users would like to see the
month as a full name. So instead of having
the month number, we would like to
have the month name, which I really agree
because it's easier to read the month
name than the number. So in order now to change it, we can use the date
name function. So let's go and
change our cculation. So let's go and eat it. Now instead of month,
I'll just can remove it. Let's have the date name. Then the part can be month. And then we have our order
dates. So let's hit. And now, of course,
what happened, we changed the data type, and as well, the values
inside this field. So we are now getting the
complete name of the month. So we have January, February, and so on. So that's it. This is how we can extract the different dates parts from our original
field, the date. So now the question
is how to use those new informations
in our views. Alright, so now we're going
to go and create a view from three informations,
category, order date. And sales using heat map
or highlighted table. Now, the first thing
that I would like to do is to remove the order date. This is a lot of details. We
don't need it in the view. Then we're going to
have the rows the year. I'm going to leave
it, but I will take the quarter to the columns
and as well the month. Of course, what
is missing now is to fill those caps
using a measure. Our measure going
to be the sales. Let's drag and rub it over here. Now in order to convert
it to a heat map, we have to add it as a colors. So let's take the sales again
and put it in the colors, or you can hold control
and drag it to the colors, we're going to get
the same results. Now, we are almost there. I would like to have
instead of text, I would like to have squares in order to get the heat map. So with that, we got a heat map, we can change the
colors if you want. So let's go to colors, it colors, and I would like
to have it as blue. So okay. So with that, we have created our heat map using only
one field the order date. So we have the years
from the order date, we have the months
from the order date, and as with the quarter. So as you can see, those
parts that we extract from the date are really
useful to make visualizations. So now we can go and add the
final touch in this view, and that is by making
abbroviations from the month name. As you can see here
the February is really big for the
cell over here, so we can make it shorter. In order to do that, we
can use the lift function. So let's go to our calculated
field and edit it, and now before we're
going to add a lift. Then at the end,
we can add three I would like to get only three characters from each month. Let's go and hit care. Perfect. Now, we have
abbreviations for each month, and the view look
more professional. There is that thing
that we have to add, I promise you the last one. It is the category.
We forgot about it, so let's go to the categories and just drag it
before the year. So with that we got really
nicely those categories, and we can see inside it how those categories are
developing over the time. With that, we got a
really nice heat map with all those informations
from the date. Now we have in our data source
a lot of new information about the order date where we can use it almost everywhere. We have another very
common use case for those new informations, where we can use
those date parts as a filter. Let me show
you what I mean. Let's go again to our orders, and we're going to
go to the month, right click on it and
show it as a filter. The same thing we're
going to do for the year. Right click on it and as
well, show it as a filter. Now we can see those
informations on the left side, and the logical order
is very important. So first a year, then a month, and since the month
has a lot of values, let's go and switch it to a drop down with
multiple values. Now using those filters, the users can go and specify what is the scope for this view by changing the values of the year and as
well for the month. So this is very common use case for the data parts in Tableau. So that's it for
those functions. Now let's move to the last one. We have the data trunk. Okay. Now in order to see the
effect of the date trunk, let's go to the big
data source and get all the other
dates to the view. I would like to see
the exact date. Let's switch it to exact date, and I came to discrete
to see the values. All right, so next,
we're going to take the sales to the view as well. And with that, you can see,
we are seeing all the days, all the information that we have in the side
the data source, and we have a lot of details. Now, let's say that I'm not
interested in the days. I would like to see one
date for each month. So we would like to have this
date at the month level. In order to do that,
we're going to go and create a new
calculated field, and we going to use
the date trunk. So let's go and do that. We're going to call it
order date, and then trunk. The syntax can be like this, date trunk, and it
accepts two arguments. The first one going
to be the date part, which level we want
to see in the view, we want to have the month. Let's specify here month. Then the date that we
want to manipulate, which is the order date. That and the calculation is
valid. Let's go and hit. And as you can see
now on the left side, we've got a new dimension with the data type
date and time. So what we're going to do
now, we're going to go and replace the order date
with this new field. So put it on top of it. And again, here we have
to do the same thing. So right it click on it, switch it to exact dates, and then again to
the discrete now we have a new date field where everything at
the month level. So we have always the
first of the month. So we have 1 January, 1 February and so on. So as you can see now the list is short right because we have now one row for each month before we had
one row for each day. So now I'm not interested
in those zeros in the view. I would like to get rid of them. In order to do that, we
can change the data type. So let's go to our dead trunk. And let's switch it from
date and time to date. So let's go and do that.
So as you can see now, we have a date field, and
all the time is away. So now let's say that,
I would like to have a date only at the year level. So I don't care about
the days and the month. I would like to have
one row for each year. So in order to do
that, we're going to go and edit our
calculated field. Now assembly, we're
going to go and change the value from month
to year. That's it. Let's go and hit Apply and
you're going to see over here that we have now one
row for each year. Now we have a field always at the year level and we
got around five years. As you can see with
the date trunk, we can control the level
of the date field. Let's say that we want
to switch it today. We're going to go and
switch the year today, and now with that, we're
going to get all the details. We have one row for each date. And with that, we have
a lot of details. So we are back like the
original field order date. This is how we work with
the date trunk in Tableau. There's another way in order to visualize the effect
of the date trunk. So let me show you how to do it. Let's first close
this thing here, and then we can switch the order date trunk to continuous field.
Let's go and do that. Now let's go and
flip everything, so we're going to have
the order date and the columns and the sum
of sales at the rows. And instead of having
par, let's have a line. So now in the visualizations,
we have a lot of marks. So if you mouse over
on those informations, you can see we have
one mark for each day. And that's because
we have defined in the order date trunk that
we are at the day level. And you can see here on
the details we have around 1,800 marks in this one view. So if you say, this
is a lot of details. Let's switch it to month. So let's go to our
calculated field, edit it and just move
it over here on top. Instead of day, we're
going to have a month. Let's go and hit Apply. Let me just close
this from here, and let's check the view we have now for each month one mark. So we are at the month level, and the marks are
totally reduced. So we have only 60 instead
of thousands of marks. With this, we don't
see a lot of details. In the view, we have one
mark for only one month. So this is the power
of the date trunk. Let's say that we want
to go to the years, and I think you already how many marks
we're going to get, we're going to get
only five marks. So each point, each mark
can represent a year. This is the power of
the date trunk to control your view and which
details we are talking about. So that's it for
those functions, they are really
great in order to extract specific
part from a date. And as you can see,
they are really useful for the visualizations. So now we've used a lot
of calculated fields. As you can see on the left side, we have a lot of new dates in our data source,
which is globally. That means if I go to any
other worksheets or even to any other workbook connected
to my data source, I'm going to see the
exact fields that are created using the
calculated field. I can go immediately and start reusing them in
my visualization, which going to
save a lot of time by doing formatting and so on. That's how to extract the dates parts using calculated
fields to be globally. Next, we're going to start
talking about how to do it quickly locally
for only one view by formatting the field. Okay, now we're going to
start from the scratch. We're going to go to
our big data source. Let's go to the orders and get the original field over the
order date to the columns, and again, let's take
the cells to the rows. Now, as you can see, Tableau
always brings it as a year. That's because it
wants to visual only small amount of
data at the start, and then you decide
on what you need. So here we can go and manipulate the order date
directly in the view by changing the
format instead of going and creating
calculated fields. Now, in order to
format the date, we're going to click
on the dimension itself, right click on it. And now we have here
two important sections. So the first section
is a discrete section, where it's going to use
the function date part, and the other section is
a continuous section, where it's going to
use the date trunk. And he always on the
right side, you can see, we have those gray
examples in order to show you which format can be
presented in the visualizations. For example, there's
no difference between this year and this year. But here we have the quarter Qq. But here we have the
quarter plus the year. So you can see the
formats that's Tableau can use in the
presentation in the view. Now, let's go and
check the differences between this month and this one. So let's start with the first
one. Let's click on month. So as you can see, our field stays clues means it's discrete, and we have those values, January, February,
March, and so on. So we have it as a text. And if you would
like to know how Tableau did create this, you can go over
here on the month, double click on it, and
you can see the format. So Tableau is using date part
month then the other dates. So you can see the
syntax that is Tableau is using to quickly
format your view. So now let's go to the next one. We can have the month
as a continuous field. So right click connect again, and now we can have
the month plus the year. Let's go and click. Now, you see that our
field is continuous, and if you double click on it, you can see that Tableau
is using date trunk. Now we see the years in
the axis and each mark, each point of those
staff are a month. So as you can see,
it's very easy. We are just clicking
around and we are changing the whole
format of our dates. What I usually do I go and select different
formats until I'm convinced about
the correct format that can represent my data. There are as well a lot
of different formats. So let me show you let's
go to the order date. As you can see we
have a is a year, quarter month, but here we
have the option of more. You can see we have
a week number, a week day and you
get more options. If you go to the custom, now here you're going
to get a list of all possible formats
that we can use in order to change the
structure of our dates. The same thing, of course,
for the continuous field. If you go again to
the continuous, Se we have here as well more. You click the custom and as well you can change
the different formats. Of course, any decision that you are making now on the view, it going to stay
only in this view. If you switch to any
other worksheets, you will not find what you
have already formatted. This is the only disadvantage of making a lot of
decisions in one sheet, then you would not have
it in the next sheets. There is as well more options on how to format the fields. For example, let's
go to the or day, try to click on it and let's choose this month
as a full name. Then I'm just going to switch those columns with the rows. Now we can see that
in the header, we have the full
name of the month. But we can go and change
the format of those headers by just right click on it
and then go to format. Then on the left
side, we can change the display format
of the header. For example, on this
one or the dates. If you click on it, you will get different options like here, for example, abbreviation.
Once you click on it, You can see now we have an abbreviations of the month name. Or we can get the
first letter of each month if we want
really to make it small, so we can go over here and
change it to first month, with that, we're going
to get the first character of each month. And of course, those format
are not only for the month. Let's take, for
example, the weekday. So we're going to go over here, then switch it to weekday. We have here the full
text of the day. So in order to make
it abbreviations, we're going to go on
the left side again and switch it to abbreviation. And with that we're going to get shortcut for the weekday. So as you can see, by
just clicking around, we're going to change
and manipulate the values of the dates inside our data source without
writing anything without writing any syntax or creating
new calculated fields. So we can just do it
quickly in one view. But here, if you find yourself
that you are repeating the same format over and
over in different sheets. I recommend you to go and create a new calculated
field for that to store it at the data source and use it once you
need. Alright, Kay. So that's it for
those functions and how to format the
dates. Okay, Kay. So we do we have
learned how to extract a specific date part
from our date field. Next, we're going to talk
about two functions, date ad and date d
101. Date Functions | Add & Subtract Dates: DATEDIFF, DATEADD: So now we're going
to learn how to add and subtract dates in Tableau, using the two functions
date add and date div. But as usual, let's understand the concept, then
we can practice. All right. So now
we're going to talk about the function date add. We can use it in order to do mathematical operations
on our date field. So for example, we
can add three days to our dates or we can
subtract for example, two months from our dates. So we can manipulate
our dates by adding or subtracting specific
intervals from our dates. So now let's see the
syntax in Tableau and take some examples in
order to understand it. It's start with the
date add as a keyboard, then it needs three arguments. First, the date part that we are interested to manipulate. The interval is
like, how many days, how many months you want to add, then we have the date field itself that we want to change. The output, the result
can be a date field. For example, let's
say that we want to add three years to our date. So we specify at the
date part years, then the interval going to
be three, and then our date. What can happen,
Tu going to go and add three years to
our date field. So that we are adding three years to this
piece of information, the year and the rest, the months and the
day is going to stay as it is. Let's move on. Let's say that we want to add three months instead
of three years. What we're going to
do we can specify a month at the date part, then three as an interval, then our date as well. So what's going to
happen, we're going to change only this
piece of information. Instead of having August, we're going to have November. So that we are changing
only the month. There is going to stay as it is. And now we can move to
the last one to the day. We would like to add three days. I think you already got
it. What can happen? We are going to add three days, so we're going to have
the 23 instead of 20. And it's change only
at the day level. That is going to stay the same. So with this you
can see, we can add different intervals to different date parts
in our date field. And in our examples, we were working with positive numbers. But in Tau, we can as well
use the negative numbers. So with that, we're
going to subtract the intervals from the date.
So let's take an example. Let's say that we
want to subtract three years from our date. So we're going to have
here the interval as a negative three, so minus three, and the output we will have instead
of the year 2025. We will get 2022. Of course, the same thing
we can do it on the day, so we would like to subtract
three days from our date. So instead of having the day
20, we're going to have 17. So as you can see,
we can use the date add in order to
add new intervals, but as well to
subtract intervals. It's very important
function in Tableau in order to compare
things together like. We can compare this year
with the next year, so we're going to go and
add one year to our field. And with that, we're going
to get two fields the field with the current year and the
field with the next year. We will see that
in next examples. That's it for the date add. Let's move on to the date. The date dif function in
Tableau has a very simple task, and that is to subtract
two different dates. For example, let's say
that we have two dates, the order date and the shipping
date in our data source. Let's say that you ordered
something in this date, 2025 in November and you received your order in
the next day in February. Now, if I ask you how long it took to ship your
products to your house, you're going to subtract
those two dates in order to give me the number. And this is exactly what the
date diff does in Tableau. The syntax going to
be looking like this. Date diff then we have
three informations. Which date of part you
would like to subtract. Then we have the starting
date in this example, the order date, and then the
end date, the shipping date. The output is going to
be always in number. As usual, we're going to have examples in order
to understand it. Here we're going to ask Tableau, how many years it took to
deliver to shep this product. Here we are interested
in how many years. We are interested
in the year part. Then the start date going to be the order date and the end date going to be the shipping date. If you do that, in Tableau,
you're going to get one. It took one year to
shep the product. Here we are talking
at the year level. You will get one. Now,
let's go to the next level. Let's say, how many months does it take to do the shipment? So here we are specifying
at the date part a month, we have as well the
same information for the start and the end date, and this time you're going
to get three months. The answer going to be it took three months to sip the
product to the customers. All right. The next
question going to be, how many days it take to ship the product
to the customers, and this time it's
going to be 68. So now we are talking
at the day levels. So the result going
to be it took 68 days to shep the product. Order date to the shipping date. In this situation, it
makes sense to use the date because we
always want to understand how many days exactly it took to send the product
to the customers. Because if you have a year, you're going to
think it tookes the whole year to send the shipment. That's it. This is how
this function works. It's very simple and very
useful in the visualizations. Now let's go back to Tau and start practicing
those two functions. All right. Now let's go and see how we can create
that in Tableau. We can stay at the
P data source. Let's go to the orders and we can manipulate the order date. Let's bring into the view over here and we're going to
show the exact date. So we're going to
go and switch it to exact date to
see all details, and I would like to
have it as discrete to see all the values
inside our data source. Now it's really simple,
let's say that I would like to add one year
to my order date. In order to do that,
were going to go and create a new
calculated field. So we're going to call it
order date plus one year. So we're going to use
the function date adds, and it needs three arguments, the date part, so we
are adding one year. The date part can be a year. The interval going to be one, and the date that should be manipulated is the order date. It's very simple. As you
can see that tables, the calculation is valid. Let's say okay and
check the results. As you can see, we've
got a new field in our data source with the
data type date and time. Let's check the results. We can grab it to the view, but I would like to see
as well the details. I would like to see
the exact date. And again, we have
to switch it to discrete in order
to see the results. Let's switch it to discretes. Now, as you can see, we
have a date and time. If you want to get
rid of the time, we can cast the field to date. In order to do that, let's go to our data pane.
This is our field. Click on the icon of
the data type and switch it from date and time
to date. Let's do that. And as you can see now
the time did disappear. At the results, we see that
everything is plus one year. We have here 2018, at the result 2019. We
can check other dates. If we saw this as descending, we can see that the value as 22, and here we have it as 2023. So that's it. This
is how we can create a new field with plus one year. Let's add one
month. Now let's go and edit our new
calculated field. So right click, edit, and let's change as the
name from year to month. And now instead of the date
part year, we can have month. It's very easy to switch, and if you select apply. So now we can see that we are adding one month to the data. If I sort it again
to the old one, you can see here
we have January, and now we have it as February. We can do the same if
you switch it today. If you want to add only one day, So let's apply and
add the results, you can see that we are adding
everywhere plus one day. Of course, we can add to the
intervals negative numbers. Let's say we would like
to have minus one day. Let's apply and
check the results. As we can see in the results
in the new calculated field, it's always one day behind the original field
over the order dates. That's This is how we can work with the date adds.
It's very simple. All right, so now
we're going to go and create a new view to analyze the average days
to ship peer subcategory. It's really important for
inventory management, optimizing operations, allocations of
resources, and so on. So we can create that using
the date dip in Tableau. But first, let's bring
a lot of data to the view in order to
understand how this works. We're going to stay
with a big data source. Let's go to the orders, and here we need our two dates. The first one going
to be the order date and the second one going
to be the shipping date. And let's add as well the
order ID at the front. Yeah, we're going to add
everything to see the results. As usual table
show it as a year, we would like to see
all the details. That's why we're going
to go and convert it to exact date. For the first one, we're
going to do it, exact date. It might take a little bit long time because
we have a lot of data and we have it
now as a continuous. I would like to see
all distinct values. Let's convert it to discrete and do the same thing for
the shipping date. We're going to convert it
as well to exact dates, and then to discrete. So we're going to go and move
it to discrete. All right. Now we have all the
information that we need. We have for each order one row. Now we're going to go
and create our new calculated field
in order to find the differences
between the order date and the shipping date.
Let's go and do that. We're going to go and create
a new calculated field called days two ship, and we're going to use
the function date death and it needs three arguments. The first one is the date part. Of course, since we are
saying days to ship, we are interested on the days. How many dates it took to place the shipment at the users. So we can enter here day. The start date is going
to be, of course, the order date, and the date is going to
be the shipping date. We have it like this and
let's check the validation. The calculation is valid. Everything is fine.
Let's go and hit. And since the output
can be a number, Tableau did create it
as continuous measure. Let's take it and put it on our view and
check the results. Let's take, for
example, this order, the customer did order in
December 7 and after four days, the customer did
receive the shipment. So with that, you can
see the differences between those two
days is four days. So everything looks good.
Let's take another value. Maybe some recent orders. So I'm going to sort it
descending from the order date. And as you can see
here, the customers did place an order at the
last day of 2022, and after 24 days, did the customer
receive the shipments. So we can see here the
days to ship is 24. This is how the date d works. Now we're going to go
and create our visual. So we want to show
the average days to ship pair category. So now we want to get rid of all those details.
We don't need them. And we just need our measure. Now we need the subcategory. Let's go to the product and get the subcategory over here, and then we're going
to take our measure and put it on the columns. But now we have it as a sum, we would like to have
it as an average. Click on the measure, then
go to the measure sum, and here we have the average.
Let's switch it to that. Now we're going to add
some more information. Let's add a label, and as well, let's
change the colors. Let's bring the
average days to ship, control, then put
it on the colors. And since it's bad thing, we're going to switch
the colors to red. So let's go to the
colors over here. Edit colors. Now
instead of automatic, we're going to switch it to red. All right. Let's click Okay, and then we're going to go
and sort the list like this. Now let's go and check the data. As you can see the
worst subcategory we have in our data
is the cobars. It takes longer time
to be delivered to the customers compared to
the other subcategories. Now the question is,
we have five years of data inside, Our data source, was it always like this that the cove years was the worst or something
exchange with the time. So now, in order to
compare the years, we're going to add the years to the view in order to
compare those informations. So we have already the year
prepared from the last time, so we have the order date year. Let's just bring it to
the view to the columns. So now if you check the data, it's very interesting
if you focus on the cobars again,
you can see that. In 2018, 2019, the
performance was really good. Even if it was one of the
best performance in 2019. It gets this light red But
something changed in 2020. So from 2020 and forward, you can see it's
always dark red. There is change in maybe the resources or in
the inventory management, we can see it is one of the worst performance compared to the other subcategories. With that, you can compare
the years as well together to understand whether it was always like this or something changed. As you can see using
the visualizations, the coloring and as
well those functions that we have in Tableau
to manipulate the dates, we can uncover those
trends inside our data. Maybe it's really hard to find it from the raw data right. But if you bring everything with colors and everything
in the visualizations, It's going to be
really easy to detect. So this is exactly the power of visualizations
at those functions. All right, everyone.
So with that, we have learned how to add and
subtract dates in Tableau. Next, we're going
to talk about two functions today and now.
102. Date Functions | TODAY & NOW: Now we're going to learn
about two cool functions in Tableau today and now in order to get the current date or the current date
and time. Let's go. All right, guys. One of the
very famous use case of the today function in Tableau is to make something like this. You can make highlight
individualizations about the current
date in the view, so we can see here
like a separator in thei visualizations with
the current date of today, and with that, you can
draw the attentions of the users by highlighting
one of those parts. Now let's go and understand quickly what is today function. So we have those
two functions today and now they are the easiest and the simplest
functions in Tableau that will not manipulate
or transform anything. There is no concept behind them. They will just deliver for you the current date and
time informations as you execute them. So for example, we have
the first one that today, it does not need any argument, as you can see,
it's very simple. The output can be a date. So you will get the
current date informations. Now we are as I'm recording
at the end of my 2023. But if you're
interested to have as well the time information, you have to execute now, no argument inside it. You will get date and time. So as I'm recording, it is 6:00 P.M. Ten 42nd. That's it. This is about
the two functions. Let's go back to
Tableau and start practicing when do you use them. All right, now we're going
to see how we can use today function in
our visualization. The first thing is to create
the calculated field. Let's go and create a new
one and we call it today. Then we need the function
that's called today as well. As you can see, it's very easy. We don't need to
add anything else. By the way, this is always the first calculation that I always create in each
new data source. Without knowing the
requirement or anything, I just go and create
this one because I'm sure that I end up
using this function. It's really one of the
fair things that I usually do for each
new data source. Let's go and hit okay,
everything is fine. As you can see, we got
it on the left side as a new dimension with
the data type date. Let's check the
current information, so we can bring it to the view. Table can convert it to a year, so I have always to
switch it to exact date and then to discrete
in order to see the value. As you can see, we are
at the end of my 2023. It's very interesting in
which year you are now checking the video and
following me in those steps. This is how we can create the two day function in Tableau. Now we're going to use it
in a reference line in one view in order to show you how powerful
in this function. We can create a view
about the number of orders over the shipping date. Let's go and create
it. I'm going to remove that today from here, and then we can add the
shipping date from the orders. The columns, and then let's take the number of orders.
The orders counts. Let's take it to the rows. And now instead of
having the years, I would like to have months. So I'm going to do
now a quick format. So let's go to the field, and then we're going to go
and pick this one month. So let's click on it, and the visualization type
look as well good. So now let's go and create
a new reference line. In order to do that, we're going to go to the axis over here, right click on it,
and then we have here the option of add
reference line. Here the most important thing to customize is the value
of the reference line. I would like to have
the value of today as a reference line to indicate the current information,
the current date. But if you go to the
values over here, you will see that I
can either create a new parameter or I can
use only the shipping date. And that's because our new field today is not yet in the visual. So we have to add
it to the visual. In order to do that, we
can close this first, then we take that today and drag and drop it in the details. But we are not there yet because Tableau did convert
it to a year, and I would like to have
in the reference line exact date of today. So in order to do
that, we're going to convert it to exact date. Right click on it, and we have here the
option exact dates. So that this is the requirement to add it in the reference line. Let's go and add again
the reference line, and we go to the values. Let's check. Yeah. We
got the today value. So let's select it
and then hit okay. So now here on the
right side, we got a very nice reference line indicating of the
day of to date. But still there's like a problem right because all of the data is behind the reference line because the data is
a little bit old. So now, in order to make
it more interesting, I'm going to add two years to the shipping date to make
the visual look better. In order to do that,
as we learned before, we can go and create a
new calculated field. Let's call it shipping
date plus two years. Here we can add a date add. First, we need the date part, so we are saying plus two years, we are talking about years, the interval going to be two and the date going to
be the shipping date. Alright, so with
that, we are done. The calculation is
valid. Let's click. So we have now on the left side. And what we're going to do, we can replace it
with the old value. So let's just remove the old chipping date and
get the new one to the rose. We're going to do
the same steps. So we're going to
convert it again to month. Let's do that. Now, as you can see, we
have values for 2024, 2025. So let's add again
the reference line, right click on the axis,
add reference line. Let's go to the values and
let's select it today. So now we've got a very nice
cut in our visual in between our data to show the past
today and the future. So now we can go and add a
little bit customizations just to make it look better. So, for example, as you can see, we have a label over here
for the reference line, it says minimum today. I would like to show immediately the value of the current date. In order to do that,
right it click on the line and
then go to edits, and then we have to change
the label over here. So instead of the computation, let's change it to the value. With that, as you can
see on the right side, we get immediately the
current value of today. The next step, I
would like to add some coloring to
the reference line, right click on the
reference line, and let's go to format. Then we have here three
informations to customize. The first one is
the line itself. Then fill above, that means all the information
on the right side, fill below going to be all
information on the left side. For example, let's
start with the line. I would like to have a
dotted and as well red, The opposity I'm just going
to make it to the 100. So now the next value going
to be the fill above, I would like to
highlight it with green. So let's go and pick the
color green over here. And then the next one
going to be the flow. You can leave it like white
or you can make it like gray in order to show
this is history. So with that, as you
can see, the visual can look more professional, so we are highlighting
the future, and the history is like
great out. So that's it. With a small function in tau
like the Today function, you can create amazing dashboard and visuals, for your users. And this is one of the
most common use case of the today function in Tableau
to highlight the data. Okay, one, so that's it
for today and w functions. With that, we have
learned all the use cases for the date
functions in Tableau, we have covered around
ten functions in Tableau. Next, we're going to
jump to the next group. We can learn about
the null functions.
103. NULL Functions | ZN, IFNULL, ISNULL: So now we're going to
focus on another group of functions under the category row level
calculations, the null functions. The main purpose of
the null functions in Tableau is to handle and manipulate the missing values
in our data, the nulls. We can have missing values like everywhere in text, dates, numbers, and field
in our data source, can have like missing values. So why handling the
missing values, handling the nulls is a very important step
in the analysis, and that's because
of two things. First, the calculation accuracy. Null values can affect the calculations and the
aggregations in the results. So if we have null values in
our data and we ignore it, we don't do anything about it. What can happen,
we're going to have incorrect calculations
and corrupt results. The second reason is to improve the data quality and to
achieve completeness, identifying the data
gap that are wrong in the data entry and
having issues in the data collection can help the overall data quality in our data and can
improve as well, the completeness in the
data visualizations. So that's why the
malfunctions in Tableau are very important to have accurate and
correct analysis in the data visualizations. So as usual, let's
understand the concept, then we can practice. Let's go. Okay. So now let's go and understand
those three functions, Z n f null is null in order
to handle our missing values. As usual, we're going to go
with the example because it is the best way to
understand those functions. All right, so now
we're going to have four customers and their sales. As you can see, only Maria has a missing value
in the sales. So we have here a null. In order to handle this null, we have the first
function in tau, the Z. Z N stands for zero nulls. It can replace the null values with zero. So it's very simple. If you use now the Zn
function for the sales, For the first value, we will
not change anything, right? We will get exactly
the same value. But for the next one
since it's a null, it's going to replace it
automatically with a zero. The next two
customers, we will get exact values because
they are not nulls. So as you can see, very simple, we are just replacing the
null values with a zero. So this is very quick way
to replace the nulls. But here, the problem is we have no control what
we are replacing. So here we cannot
specify something else. We will always get a zero. In order now to
specify our value, we can use the second function that we have in
tableau, if Null. If Null it can replace the null value with
specific value from us. So if you use this
function on the sales, it can has the following syntax. It needs two arguments, the value that we want to manipulate and the
value that we specify. Example, I'm going to
specify it as zero. It doesn't make
sense because we can use Z N. But just
to show you that, we're going to get
the same results, so you can go over here
and put anything you want. So for the first customer, we're going to get exactly
the same results. For the second customer, we're going to get again zero
because we specify that. We have the control
on that. And then for the last two customers, we're going to get
exact results. And here, the output
is a number because the field that we want to
manipulate is a number. But let's say that we take another field which is a string, the output going to
be as well as string. So here is exactly the
difference between Z and NL. Z in accepts only numbers, but the pNal accepts any
field from your data source. So, for example, let's say
that we have the countries. So John has no value
in the country. Same for Martin,
we have only for Maria and George information
inside the field country. Here we cannot go
and use the Zi in function because it's
not number, it's string. So in order to manipulate those values or to
replace the null values, we're going to go
and use the PNL. So the syntax can
look like this. If null country, then we have the abbreviation
of not applicable. So the output here is going
to be a string value. For the first customers, we're going to replace
the null with A. The next one is
going to stay the same because there is
nothing to replace. The third one we're going to
get as well, not applicable, and for the last one,
we will get France, so nothing to be changed. So this is exactly the
differences between the null function and the
Z in function in Tableau. Now we're going to go to
the last function is null. Sometimes we might be in a
situation where we want to check whether the field
has null values or not. So we don't want to
do any actions yet. We are just checking, right? So there is null
tableau going to return true if the value is null
and false otherwise. So that means if
there is no value, if we have missing value,
we're going to get true. If there is a value,
we will get false. So the output of this
function going to be with the data type bullion
with only two values, either true or false. So let's check the example
or the syntax tableau. It's going to accept
only one argument, the country, and that's it. So the question for the first
customer, is it a null? Yes, it's nulls, though that's why we're
going to get true. For the next customer, is it a null in the country? Well, so we're
going to get false. The same for the third one
we're going to get true, and the last one
we go to get false because we have a
value in the country. That's it for the is null. So we have three functions, three tools to manipulate or to check the null values
inside our fields, and they are really
useful to improve the quality and the completeness
of your visualizations. So now let's go back to Tableau and start practicing them. Okay, so this time,
we're going to go to the small data source. Let's check the
order information, so we're going to
take the order ID, and we're going to take
this time the profit. Drag and drop the profits on the ABC over to
see the values. Now if you check our data, you can see that the order seven don't have any
profit informations, and as well, the order
ten don't have anything. So we have here missing
data. We have nulls. Now let's do something
about it and fix it. Instead of having null, we have to have zeros. So here we have two
functions to do it. Let's start with the first one, the Z N zero nulls. Now we're going to
fix it and create a new calculated field. We're going to call it profit. And the syntax start
to the function z n, and it needs only one argument, the field that we need to fix. It's going to be the profits. That's it with that we are changing all the
null values to zero. Again, in this
faction, we don't have control to change the
value to something else. It's going to be always zero. The calculation is valid. Everything is nice. Let's click. As usual, we're going to
get a new measure since the output is going
to be as well, the profit informations. Drag and drop this new
information to the few. Now we can see on the results, all those values going
to stay the same, only we are
manipulating the nulls. We are replacing the
nulls with zero. Here as well for the order
number ten, we have null. Now we have a zero. So it's
really easy and quick fix. All right. So now you
might say, You know what? Why we are making
all those efforts to replace those missing
values with zero. So what is the big deal? I could just leave it as a null, and the users might accept it. So why we are doing this? Well, it's not only the
visual can be better, but also having missing
values going to bring wrong and
inaccurate aggregations. So let me show you what I mean. Let's just remove
the order ID away. And now you can say, okay, we got the same numbers, right? We got the same aggregation, so everything is
accurate and fine. Well, not exactly. This
is only for the sum. So now let's go and switch
them both to the average. So we're going to go over here
and switch it to average, and we're going to do the
same for the corrected one. Now, I'm going to just
make the headers a little bit wider
to see the values. Now as you can see now we are
getting different values. So with the Z in function, we got different average
from the original data. And that's because
in this average, we are not counting the orders
with the missing values. With the Z in, we are counting now the orders with
the missing values. So that means replacing the
missing values with zeros, we will get accurate results at the average in the aggregations
compared to the old one. So that's exactly why we go and replace the missing
values with zeros, especially for aggregations
and calculations. All right, so that's
why we do it. Now, let's go and try
another function. We're going to use the
I null in order to replace the null
values with zeros. Now I'm going to just
bring the order ID to the view to see
all the orders. Let's go and create the
new calculated field, and we're going to
call it profit null and the centax starts with null, and it needs two informations. The first one going
to be the field that we want to manipulate. So it's going to be the profit. Again, and for the
next information, we have to specify which
value can replace the null. In this example, we're going
to stay with the zero. The calculation is valid, let's hit ok. And
we've got again, our new calculated field. Let's bring it to the view
and check the results. As you can see it
is identical to the Z n. So for the
order number seven, instead of null, we go zero, the same for the ten, we zero. In this situation, if we want
to replace it with zeros, I would go with the Z n since it's just
faster to write it. Now let's move to
the next scenario. We want to replace the
nulls with the value one. This time we cannot
use the Z n because Z n can automatically
convert it to zero. We're going to stick
with the null. Let's go and edit
our calculation. And instead of zero here, we can specify one. Let's go and hit. Now
we can see instead of having zero, we
have the value one. Instead of null, we have one. This is the advantage
of the If Null. We can control which value can be the replacement for
the null. All right. The next advantage
of the Null that we can replace not
only number values, we can replace as well,
any other data type. Let's take an example.
We're going to go to the customers and let's get the customer e
mail to the view. And as you can see, here
we have some nulls. We don't have all the e
mails from all customers, but now the task is to replace
those nulls with unknown. Let's go and create a
new calculated field in order to replace
those values. Let's call it customer email if null and the syntax
again, if null. It accepts two arguments, the field that we
want to manipulate, it's going to be the
customer e mail. This one over here, and which value we're
going to use in order to replace the nulls, it's going to be the
unknown. That's it. The calculation is valid, so we can replace all the
nulls with this value. Let's go and hit.
And now we have again here a new dimension
in our data source. Let's grab it to the view
and check the values. Now if you just compare those
two columns, you can see. Instead of null, we
are getting unknown, the same here and the
third one over here, the others will not be affected because we have a value
inside the field. As you can see, it's
really nice and quick way to replace those pad
nulls in the view. That's all for the null. Now let's check the last
one we have the null. The nal will not replace
the values with anything. It's just to check whether
there is a null or not. So let's say that we
want to check whether in the field profit,
we have animals. In order to do that,
we're going to go and create again a new
calculated field. Let's call it a profit null, and the syntax for
that is very easy. SN it accept only one argument. It's going to be the field
that we want to check. So we are checking
the field of profit. The calculation is
valid, and that's it. It's really simple. We
are checking whether this field contains
any nulls inside it. The output can be either true or false. It's going
to be a polon. Let's say o as you can
see on the left side, we have a new field with
the data type polon because we have only
true and false. Let's drag and put it
on the view over here. And here we can see quickly, all those orders is a false because we have a value
inside the propit. But here we have a null. That's
why we are getting true. Here again, we have a true. That we can check
immediately, whether we have nulls inside
our data or not. Let's go and show it as a filter. This is
what I usually do. If I see there is true, I'm interested to
see those values, so I can see we have two orders where we have nulls
inside the value profit. This is really quick in order to check whether we
have any problems, any nulls inside our fields in order to make plan
what we can do about it. But here in the
small data source, it's really easy to see
individual like all the orders, we have only ten orders,
but imagine you have thousands or millions of
orders inside your data. Individual, it can be
really hard to see. Let's take an example
in the big data source. So we're going to go over
here, take again the order ID, and as well, let's check
this time the sales. Drag and drop it in the view. As you can see,
it's really hard to check now in the view whether
we have nulls or not. Instead of that,
we can do a check. We're going to go and create
a new calculated field. Let's call it sales is null. Now we can use the
function is null. This time, the field
is going to be sales. We are checking the sales.
Let's go and hit a K, and now we're going to show
this field as a filter. Now in the filter, we can
see immediately that we have only one value falls.
So we don't have true. That means we don't have
any nulls inside our data. So this is very quick check inside our data to
see whether they are nulls instead of just like scrolling down and
checking all the orders. That's why we need
the isnull function. So with that we have covered
all the three functions that steel and handles
with the null. This is very important to
improve the quality of your visualizations and to bring accurate data in
the aggregations. Alright, so with that we
have covered everything about how to handle
the missing value, the nulls in tau. Next, we're going to
move to another group of functions, the
logical functions.
104. Logical Functions | IF, ELSE, ELSEIF, IIF, CASEWHEN: So now we're going to
talk about the last group of functions under the category, row level calculations
in Tableau. We have the logical functions. The main purpose of the
logical functions in Tableau is to make logical decisions
based on conditions. And here we have two use cases. The first group is the
conditional operations. Here we have F, LF,
case win, and so on. The main focus here is to
create conditional logics and make decisions based on those conditions in order
to manipulate the data. And the second group is
the logical operators. Here we have three
operators and or not. The main purpose of this
group is to evaluate and to compbine multiple
conditions in Tableau. Now let's go and focus on the first group, the
conditional operations, and as usual, first we have to understand the
concept behind them, then we can practice
in Tableau. Let's go. All right, everyone. So now
we're going to do D dive in those logical
functions in order to understand how they work and how they're going
to be executed. And now we're going to start
with the symbolist form of the F statement where we
have only one condition. And in this example,
the condition can be if the sales is higher than 1,000, then we want the value high. Otherwise, we end,
nothing can happen. And now let's see
the flow charts on how this can be executed. So we start first with
checking the condition. Here we have always two ways, either false or true. If the condition is fulfilled, if the sales is
higher than 1,000, then we go this path, where we're going to have
the value high. So if it's true, we're going
to get the value high, and then everything ends. The other path, if the sales
is not higher than 1,000, then it's false, then we're
going to skip everything. So that means nothing
can to happen. Let's have the
following example. Let's say that the sales
has the value 1,200. So now, first, we're going
to check the condition. Is the sales is
higher than 1,000? Well, yes, it's true. So what can happen, we
can execute the high, and it's going to
jump to the end. And if we're looking to the
chart over here, first, we are asking the question, is the sales higher than 1,000? The answer is going to be true. So we are taking the green path. This one where we
can execute, high. Let's take another example
where the sales equals to 700. So we start over here again. We ask the question, is the
sales higher than 1,000. This time, it's not true, so it does not fulfill
the condition, and we're going to go with
a path on the right side. So what can happen,
nothing can happen. The high value will
not be executed. And in the output, we're
going to get the value null because there is
nothing can be executed. So it's really simple right. You are asking always the
question that could be answered with yes or
no, true or false. You have always two path
for each condition. So this is the simplest
form of the F statement. Let's move to the next level, where we're going to
have if L statements. So now we're going to stay
with the same condition. If it is fulfilled, then we're going to get
the value high. But let's say this time, if it is not fulfilled, it is false, I would like to
get a value instead of null. So here we can add
the keyword L. So what we're going to
do we can add between f and and L statement to say, Okay, if it is not fulfilled, give me the value low. So let's check the flow chart how it's going to look like. We start first with
checking the condition. If it is true, the first path, we have the value high. But if it is not true this time, instead of just jumping
immediately to the end, I would like to get the
value low using the LS. That means the output
of the FL statements, is going to be always a value, either high or low. We will never get a null.
Let's take an example. Let's say that the
sales is 1,200. It's going to fulfill
our condition, so we're going to get the value high and the program can end. On the right side as well, the same thing, what can happen, we're going to check
the condition, and sense is true, we're going to get the value
high and the program ends. The output going to
be the value high. So here it's like the last one. But now, if the
sales equals to 700, the condition is not fulfilled, and now instead of jumping
immediately to the end, it's going to jump
to the L statement. So now let's check
another value where the sales equals to 700. The condition will
be not fulfilled, so it's going to fail
because the sales is not higher than 1,000. So what can happen this time, we're going to execute
the L statement. We will not jump
immediately to the ends, so we're going to go to the Ls and then we can execute the ls. So in the chart, we
check the condition and we took the right
path where it is false. So now once we are
at the L statement, it's not like the F. Here we will not
have any condition. We have only one bath, so we can execute the law and
the program can exit. So what can happen, we will just get the value low and we end. So the output can be the low value instead
of having nulls. So ls will be always executed if the conditions
are not fulfilled. So that's it for
the L statements. It's very simple.
Now we're going to go to the next level where we want to add multiple
conditions in our statements. So now we're going to talk
about the LSF statements. We can use it in order to add multiple conditions
to our statements. So far in the previous examples, we worked only with
one condition. We are checking with her. The
sales is higher than 1,000. And if you are using
the F L statements, we're going to get
either high or low. Let's say that we want to
introduce another condition in our statements to get
the value of medium. Now, we would like to add
a new condition between F and LS exactly after
the F statements. But now we cannot go and
use F again as a keyword. Instead of the ad,
anything after the F, we can start using
the LSF statements to add more conditions. For example, we can add the following
condition in between. It's called LSF. The sales is higher than 500, then we can get
the value medium. That means in the whole
statements we can have only one F and only one Ls, but we can have multiple LSF in between if we want to
add multiple conditions. Now, let's see how the
workflow going to look like. We start as usual with the first condition
in the F statements. If it is true, what can happen, we're going to get
the value high, and everything can end. Now if the condition is not
fulfilled in the first F, we're going to jump to
another condition in the LSF. Here we have another condition
where we're going to check if the sales
is higher than 500. Here we have again,
two ways out of this. Either it's going to be true,
either it can be fulfilled, what can happen,
we're going to get the value medium, and then ends. The other one, if the condition
is as well not fulfilled, then we're going to go and
execute the L statements. As usual, the L statement
does not has any condition. It's going to just execute
the value and ends. Let's see a few examples in order to understand
how this works. The first one going to be
the sales equals to 1,200. We are checking now
the F condition. As you can see, it is
going to be fulfilled. We can get the value
high, and that's it. So what's going to
happen, we just going to skip
everything to the end. If you are checking
the workflow, so we're going to check
the first condition, and we will take this pass. So everything else
is going to be ignored and will
not be executed, we will just get the
value high at the output. Alright, now let's
take another value. The sales equals to 700. So we are at the
first condition. It will fail, so we will
not get the high value. Instead of that, we're going to jump to the next LSF statement. So we are now at the right path. The true path can
be deactivated. So we have here
again another check. So we are checking is the
sales higher than 500? Well, this time, it
can be fulfilled. So what can happen, were going
to get the value medium, and then the program can skip. So with that, we
are at this path, we we got the value
medium as an output. This means again
that the L statement will not be executed. All right. Moving on to the next example, where the sales equal to 350. Again, we are at
the first check. 350 is not higher than 1,000. That's why this can fail. Then we're going to
jump to the next one to check whether it's going
to fulfill this condition, and the sales as well
here not higher than 500. This can fail as well. So since now both of
them are failing, what can happen, we're
going to go to the default? The default value is the Ls. This can jump to the Ls, and we will get the low value from our statements. And
this can be executed. Let's check the right
side on the workflow, as you can see, we are the
first condition, it failed. We go to the second
one, it failed as well. Then we go to the last option that we have to
the L statements, we will get the value of low. That's all about
the LSF statements. If you have a third condition, you just can add it after
the LSF or before it. With that, you can add multiple conditions to your statements. Understanding the
logical workflow behind those statements is very important to understand
those functions. All what you are doing
here is we are evaluating different conditions and
based on the evaluations, we will get in the
output different values. In this example, we have
three possible values, high, medium and low. All right, the case
win statement. It is very similar
to the F statement. Here we're going to
evaluate as well, multiple logical conditions,
and based on our evaluation, we will get an output value. Let's take an example in order
to understand the syntax. It starts always with case then the field that
we want to evaluate. Now we're going to
go and evaluate the values inside the country. The first condition can be
like this. We can write win. Then if the value is
Germany inside the country, then the output can be D
E. Here we are trying to make like in the output
abbreviations from the countries. Now we're going to go and
make another condition for another value
inside this dimension. So we can evaluate
the value of France. If it is equal to France, then the output can be F R. Then moving on to
the next condition, we can evaluate the USA
value inside this dimension. If it is equal to this value, then the output should be US. As you can see,
using the case win, we are evaluating the members or the values of a dimension. So here we are evaluating
here in those conditions, we are evaluating a scenario. So what can happen if the value of the country
is Germany and so on. So so far we have
three conditions. And if you are done, and
you would like to have a default value if none of those conditions
are fulfilled. So if the value of
the country does not fulfill those three
conditions, what can happen, we're going to go and
execute the L statements, and at the end, we're
going to have as well, and You can see it's really simple and easy to read
and as well easy to write. All right. Now let's go
and have an example in order to understand how
the execution can be done. Let's say that we have the Germany value
inside the country. Now, as the code
can be executed, we can start from top to bottom. That means we can first
evaluate the first one, it's going to be when
Germany, then DE. As the values are matching, we will get the value
DE at the output. The code going to
skip everything else. We will not check
France, USA, and so on. The code going to go to the end, and as output, we're
going to get DE. It is very similar
to the FL statement, Let's take another
example where we have France in the country. So here we start moving from
the top to down. So again, the first condition can be checked when Germany, then D E. This time we
don't have a match. So here we have France
and here Germany, so it's going to fail.
We will get false. That means what can happen. We're going to jump
to the next condition to check and evaluate
the next value. So here we're going
to check again when the value is France, then F R, this time, we have a match, so
we will get a true. And with that, the
application going like Skip other conditions
to the end. That means in the
result, we're going to see F R. Now let's move to the last example where we can evaluate the value
spain in the country. What's going to happen
again and top down? This time, none of those conditions can
be fulfilled right. From the first one,
we're going to jump to the second
because it has falls as well from the second
to the third, it's false. That means we're going to
go and execute the Ls. Ls can be executed if all
conditions are not fulfilled. In the output, we will get
the A, not applicable. So it's very similar
to the F L statements. Now we're going
to go and compare all those stuff side by side. So now we're going to go and
compare three functions, F statements, IF, Twin. I know that we didn't
talk about the IIF, but now we're going to check
the syntax in order to understand the
differences between it and the F statement. So let's start with
the first one here. The syntax, we have
multiple conditions. So we have two conditions. We have F sales
higher than 1,000, then high LF sales
is higher than 500, then medium, LS low
So with that we are evaluating multiple
conditions in one statement. Now let's move to the next
one. We have the IIF. IIF is very similar
to the FL statements. We will get the same output, but we write it in different
and easier syntax. So let's see the syntax as
you can see it is very small. It starts with the IF, then the condition itself, the sales higher than 1,000. Here we have two outputs, whether it's false or true. The first one is about the true. If the condition is fulfilled, we will get high value. But if the condition
is not fulfilled, we will get the low value. Here we're going to write what
can happen if it is false, and here we're
going to write what can happen if it is true. If you compare to
the FL statements, it is easier to write
and as well shorter. Here we don't have keywords like LS or at the end, we
don't have the keyword. So it's really short
and quick to create. But, of course, we can
evaluate only one condition. So now we can move
to the case win. As we learned before,
it can evaluate the values the members
of a dimension. So here we're going to
evaluate the country. Then we have
multiple conditions. If none of them is fulfilled, we're going to go to
the L statements, and then we have an end. So now let's learn the main
differences between them. The first one is
about whether it's going to support
multiple conditions. As you can see in
the F L statements, we can add many
conditions as we want. So it supports
multiple conditions. The I IF supports
only one condition. The case win as well supports
multiple conditions. Okay, now let's move to the
next one we're going to talk about whether it's going to
support multiple fields. The FL statements can
support multiple fields, so we can have in the
condition not only the s, but something else like
the country as well. So the FL statements
support multiple fields. The same for the IIF it support
as well, multiple fields. But in the case win it
supports only one dimension. Here we cannot evaluate multiple dimensions in the
same case reinstatements. So here only we are
talking about the country. We cannot add any other fields
inside these statements. So here we have a limitation in the case reinstatements
compared to the other two. Now let's talk about
supporting the data types, the FL statements and
the IIF both them, they support and the data type. That's why I said here, it
can evaluate multiple fields. So here we could have
a dimension measure, Any data field that you
have in your data source, it could be evaluated
inside those conditions. But the case win here we
have another limitation, we can evaluate only string
values, only dimensions. So here we cannot
go and evaluate, for example, the sales
or profit or a quantity. A measure, we cannot use it inside the case win statements. It should be exactly a string. We cannot even use for example, a date, the order date. Here, the field should
be a string value. Now let's go and check the
main advantage of each method. The first one is,
as you can see, we don't have any limitation. The IIF here, the advantage
is easy and quick to write. In the case win
here, we have again, the advantage of easy
to write and to read. So if you look at the case win statements and to
the FL assessments, you can see the case
win is organized. It's easy to read. It has like a flow compared to the FLS. Here, we have a lot of
different keywords, and it's not that easy
like the case win. So here my recommendation
for you is if you are evaluating only one condition with the output of two values, then always use IIF. It's very quick to create. But now, if you have
multiple conditions and you want to evaluate it, then think about the case win. Is it like data type string? Are you evaluating
only one field? If that's the case,
then use case win, it's easier to read
and as well to write. But if you are talking
about multiple fields and not only string values, then you have to go
to the FL statements. Always start with the
IIF then the case win, and then if you don't
have any other option, go to the FL statements. All right, so that's all
about those methods. We're going to go now
and practice in Tableau. All right. Now let's go
to the small data source, we're going to go
to our customers. Let's grab the first name to the view and as well the
country informations. Now the task is to create
country abbreviations, shortcuts from the
original values that we have inside the country. In order to do that, we
can use the FL statements, and we're going to do
that step by step. Let's go and create first
new calculated field. Let's call it country. Now we're going to use the
keyword if and after that, we have to specify
our condition. The first condition
going to be if the country equals to Germany, then the abbreviation going
to be D E. Let's create that. If the field country quals
to the value of Germany makes you to write it
exactly like our data capitalized because to
here is case sensitive. Now what happens if the
country equals to Germany, we would like to see in
the output the word DE. If it is true, we're going to
get D E. If it's not true, then let's write the first
one that we just exit. We don't have any L statement or any other condition. That's it. So this is the simplest
form of the F statements. Let's go and hit
OK. Now, as usual, we're going to get a discrete dimension in the data source pan with the data type string
because the output is string. We have the abbreviations. Let's drag and drop on our view to see the values. All right. So now let's go and check the values for the first customer. You can see that the value
is not equal to Germany. It is not fulfilling
the requirements. We will get Null the same
thing for John as well USA, not fulfilling the requirements. So we will get null well. For the next two customers, you see they fulfill the
requirements and the condition. That's why we will get the
value DE for both of them. For the last customer patter, you can see the value is not
fulfilling the condition. We got to get null.
As you can see, we are getting
only one value DE. Otherwise, it's going to
be null. All right, guys. Now let's go to the next step, and I would like to get
rid of those nulls. I want to see a real value
in the visualizations. So if the condition
is not fulfilled, I want to see the value
not applicable in A. Now in order to do
that, we have to use the L statements
in our calculation. Now let's go to our field, and instead of changing the calculation
inside this field, I would like to duplicate
it and make a new one. Let's doublicate it and
then edit the new one. I'm just going to
call it if else, Now we're going to have
the same condition again. If the country equals to German, you can get D E. Otherwise,
we will not skip. Otherwise, we can add
the Ls statements. So it's going to be
always before the end. And after that, we don't
add any condition, we just have to add the value. So the value, if the
condition is not valid, go to be not
applicable. That's it. That means if it's true,
we're going to get the E, if it's not, then we're going
to get the not applicable. Let's go and click
Okay, and we're going to go and check the
values as well in the view. Just make it a little
bit bigger to see. Those on formations. And now, as you can see,
instead of having nulls, we are having now a value, which is really better
for the visualizations, and as well for the
user experience to have value instead of nulls. Nalss always ugly in the views. With that, we're going
to control which value can be presented to the end users if the
conditions are not fulfilled. Now, as I recommended before, if you have only one condition where the output is
only two values, then the best way is to do IIF. Let's go and create
it. We're going to create a new
calculated field. We're going to call
it country. IAF. Let's see the syntax. It's
start with the keyword IIF. And here, as you can see,
it needs three arguments. The test, it's going
to be the condition. What can happen if the
condition is fulfilled? So we have to specify it
in the second argument. In the third one, what can happen if the condition
is not fulfilled? So the condition is if
country equals to Germany. So this is the condition, what can happen if this is true? Then we're going to have the
Then the next step is to define what will happen if the condition
is not fulfilled. So the country is not
Germany. Is going to be A. So you can see it's very
quick and very fast to create such a condition and compared
to the FLS end and so on. So this is the quickest way in order to create
such a condition. So let's go and hit a K
and check the results. So with that, again, we're
going to get a new dimension. Let's drag and drop it over here on the view to
check the results. Just going to make it
a little bit pick. So as you can see,
we're going to get the exact result as
the F L statements. So the first two
countries are not fulfilling the condition,
we're going to get A. The text two customers,
they are from Germany, we're going to get the E, and the last customer is not from
Germany, that we are get. A. This is the magic of the IIF. Not a lot of people use it. Actually, it's not that
common to be used, but it is very nice way to quickly create
conditions in Tableau. I totally recommend you to
use it. All right, guys. So now we're going to
move to the one more step where we're going to
add another condition. So we don't have only one. We can have multiple conditions. That's why we
cannot use the IIF. We have to go back to
the FL statements. So let's see how
we can create it. I'm going to go and duplicate
again, one of those fields. So let's go and do that and
then let's go and edit it. I'm just going to
call it F statements. We're going to stay with
the same informations. The first one we are
checking the Germany, so this is the first condition
and Ls going to be an A. Now we're going to go and add a new line between
the F and the Ls and we're going to
add a new condition by adding the keyword LSF. It's like the F statements, we can write our condition. If the country This time equals to,
let's say, France. Then what can happen, we
can have the abbreviation F R. That's that we have
added our second condition. As usual, we start the
execution from top to bottom. So the first condition
to be checked is if whether the country
equals to Germany, if it is not correct, then it can jump to the
next condition. So let's go and hit OK
to check the results. Let's go and grab it from the data pin and drop
it on the view. And now we can see that there is one customer with the new data. As you can see,
George, from France, we got the abbreviation of FR. That's because the country
equal to France and with that we are fulfilling
the second condition. The USA for John and Bitter, they still don't fulfill
any of those conditions. It always be executed from the
Ls Maria and Martin can be executed from the
first condition where the s are going to
be DE. That's it. Now we're going to go and
add the final step where we can add the third condition
for the country USA. Because we still
are getting those not applicable for
those two customers. I'm going to go to
the same field. This time, I will
not duplicate it. Let's go and edit it, and we just have to add
one more condition. So I'm just going to
copy those stuff, and then as the next condition, it's going to be as well, LSF country equal to this time USA. Then what can happen if
this condition fulfills? We're going to get
that abbreviation US it's very simple to add one
more condition in the LSF. Let's go and to K. So now
we can see in the results, all those customers
that come from USA, they have now the
US abbreviation. And with that, we have covered everything with conditions, and none of those customers
can be executed from the LS, so we don't have the A anywhere in the output, which
is really nice. And now we can see in
the view very nicely how we started with
the simplist form of the F statements and we end up with a complete form
of the F statements. Now, next, we're going to solve the same task but this time, using the case win
statements. All right. So now let's go and create
a new calculated fields. We're going to call
it country case win. Then the syntax
start with the case. Then we have to
specify the field that we want to evaluate. It's going to be the country. Once we do that, we start
defining now our condition. The first condition going
to be the Germany value. So when the value
equals to Germany, then what can happen,
we're going to have the abbreviation
DE. That's it. The next condition going to be when country equals to France, Then the abbreviation
going to be F R, and we're going to go
to the last condition when the country equals to USA, then the value going to be US. So that you see how quickly we defined three conditions
using the case win. It is very logical and as well, very easy to create, right? So now, if none of those
conditions are fulfilled, let's get the applicable
and we have to end it. So that's it. As you can see, the calculation is valid, and it's really easy
to read as we write. So it is everything
like structured. I liked a lot using case win statements and
compared to the FLS. So that's it. Let's go now and hit k to check the results. And now we've got
a new dimension as usual from the calculated field. Let's put it in the view
to check the results. So as you can see, we're going
to get the same results. But in this situation
for this task, I'm going to recommend
you to use the case win. Since as you can see, it's very easy to write and as well to adjust later or to add more
conditions if it's needed. So with does we have
learned how to use all those logical operations in order to create a
new logical conditions. All right, everyone,
I'm going to show you a very common use case
that you might find it in many projects where you're
going to go and create the colors of the QBs using
the cgical conditions. Let's go to the big data source, and we need the subcategory from the products as
usual to the rows, and then we need the
sales from the orders. Let's put it on the columns, and then we're going to sort it. We're going to add the labels. And now we need the
colors for this QBI. Let's go and create our
new calculated fields. We're going to
collate QBI colors, and the logic can
be the following. If the sum of sales
are higher than 200 s, I would like to see
the green color. Anything between 200 k
and 100 k is going to be the orange color and anything below the 100 k, it's
going to be red. Now we have to
decide on the method that we want to use
in our calculation. As I recommend you always
start with the IIF. Now in the logic, we have multiple conditions,
we cannot use it. IIF is only suitable if we have only one condition. IAF is away. The next one we're going to
talk about the case win, But since the conditions are
based on the sum of sales, it is integer, we cannot use the case win because case win can accept only string values. This is as well a way, we are left only with the
FL statements. That's why in this calculation, we're going to build it based on the FLS. Let's go and do that. We can start the context
over here with the F, and then we have to specify
our first condition. Anything higher than 200
s, it should be green. Now we are talking
about the field sales but in the sum because
individualization, we have the sum of sales. If the sum of sales
is higher than 200 s, Then what can happen,
we're going to have the color green. So that's it for the
first condition. Now we have to specify the
condition for the orange. So anything between
200 k and 100 k, it should be orange. So let's go and specify that, F. Again, we're going
to have the same field, sum of sales higher than 100 k. Then it's going to be orange. Now you might say,
you know what? In the condition
that you just say, it has two boundaries, right? Higher than 1,000
and lower than 2000. Well, the first boundary, we have it already with the
first condition checks. So if it is higher than 200 k, it's going to get green,
and this can be skipped. So anything going to be
checked in this case, is going to be lower than 200 K. That's why I specified here, only the lower boundary. So that's it for the orange. The last one is going
to be if the sum of sales is lower than 100 K, what's going to happen,
we're going to get red. So let's go and specify that
go to have another LSF. Sum of sales and lower or equal than 100 k. Then it's
going to be red. So that we have covered
the third condition, the third color, and
we covered everything. We covered all possible
values that could happen. That's why it doesn't
make any sense to make an L statements. We just can't go and end it. Now let's check
everything is fine. Now we've got an error because I think I missed
here to close it. Now let's check it again. The calculation is valid. That's it. We have three
conditions to three colors. Let's go and hit. Now we have
our dimension over here. We're going to use
it for the coloring. Let's track and drop it
on the colors over here. Now, as you can see, our
colors are splitting view. Table got it almost correct. We have a orange red, but this one is not blue.
Let's go and change it. We're going to go to the
colors, then idiot colors. Now instead of green as a blue, we can have it as a real green. Let's go and hit k. So that
we got the colors of our KPI. As you can see, all those subcategories
with the sales are higher than 200 K. They are
all green as supposed to be. Now anything between
200 k and 100 k. You can see all of them are orange and anything
below is red. As we can see, we can do a lot using those
logical conditions. We can use it in order to
create the coloring in Tableau. We can use it to create a
new informations like in the country abbreviations that are very necessary
to understand. All right, so far we
have learned how to create conditional
logics in Tableau and how we evaluate
it in order to manipulate our data
based on the decisions. Next, we can start talking about the logical operators
and or not.
105. Logical Operators | AND, OR, NOT: So now we're going
to learn how to compine how to evaluate multiple conditions in Tableau using the logical
operators and or. Then we can learn
about the operator. Let's go and understand
the concept. Then we can practice. Let's go. Okay. So now let's start with the
end or operator. Let's have the
following scenario. Let's say that we have
one condition where we are checking whether the
sales is higher than 100, and a second condition
where we are checking whether the country is Germany. Now if you want to go and
evaluate both of them, you want to combine
those two conditions together so that
they work together, we can use the end or
operator in between. So here we can use those
two operators to coine the condition A with
the condition B and the output can
be as well as usual, pan true and false. So our two operators
and or they are logical operators that are used to combine
multiple conditions. So now let's say
that we're going to use them in FL statements. Let's see how the
syntax can look like. Let's start to the end operator. So as you can see, we have
here the F statements. Then we have our two conditions, and in between them, we
have the end operator. So the condition can acine
both of them in one statement. So if the sales is higher than 1,000 and the country
equal to Germany, then we're going to get the
value high if it is true. Otherwise, it's going to
end, and we will get null. The same thing for the
operator, we are saying here, if the sales is higher than 1,000 or the country
equal to Germany, then we're going to
get the value high. As you can see,
it's really simple, let's check an
example in order to understand what are the
differences between and or. So now we have in our table four customers with their sales informations
and the countries. So the first condition going
to check whether the sales is higher than one k. So now let's check the
first customers. We're going to get
true because the sales is higher than 1,000, and the last two
going to be false because it is below 1,000. This is the information
from the first condition. Then the second
condition that we have, we're going to check whether the country equal to Germany. So the first customer is from Germany. That's
why it's true. The second one is not.
We have it false. Then the next one
is Germany true, and the last one is false. Now, as you can see, we are
evaluating the table first in order to get the result
for each single condition. But now what we can do
is we can go and compie those two conditions to
generate new results. So now if you go and
use the end operator, it can return true only if both conditions are true
and falls otherwise. So now let's go and compile those two conditions together
using the end operator. Let's check the first customer. We have the condition A is true condition B
is true as well, so we are fulfilling the
requirement to get it true. So for the first customer, we're going to get
the output true. For the next customer Maria, we have in the
condition A, true, but in the condition B false, it does not fulfill
the requirement. Both of them should be
true to get it true. That's why it's
going to be false. For the next one, Martin,
going to be the same. The condition A is false. The condition B is true. Both of them should be true. That's why we're
going to get false. The last one anyway,
both of them are false, so we're going to get false. As you can see the end
operator is very restrictive. Both of the conditions should be true in order to get true. Otherwise, immediately,
you'll get false. This is how the end
operator works. Let's go to the next one
we have the operator. Or operator can return true, if at least one
condition is true, otherwise, it's
going to be false. That means we need at least one true to get true in the output. Let's go and check
the example again. For the first customer, we are fulfilling
the requirement. We have more than one,
b of them are true. That's why in the output,
we will get true. The next one we have
true at the condition A, false at condition B. At least we have one, so we are fulfilling
the requirements. It's going to be true as well. The third one is the same. So we have at least one
true and the condition B. That's why for Martin,
we're going to get it true. But for the last customer, George, both of them are false. So we need at least
one true to get true. That's why the output
going to be false. So as you can see, the operator is less restrictive
than the end. We need at least one trow
to get true at the output. So this is how the end
and operator works in Tableau in order to combine
multiple conditions. One more thing to
notice here as well, that if you are using end and we are evaluating the end
result of the condition. So we are not evaluating
the table itself. We are evaluating those results that we got from the conditions. Okay, so now we're
going to talk about the third operator,
the nut operator. So let's take an example. We're going to have
the following table, and we have our condition where the sales is higher than 1,000. So we will not use the nut operator to combine
two conditions together, like with the end or operator. But this time we're going to reverse the results
of the condition. So the Nut operator is a
reverse logical operator. It's going to return true if the result of the
condition is false, and it's going to return false
if the condition is true. If you tell it to go right,
it's going to go left, if you tell it to go left,
it's going to go right. It's going to do
exactly the opposite. Let's see what's
going to happen if we say this condition. If you use the operator
for the first customer, you will get false because
the value is true, the same for the second
customer you will get false. But for the next two customers, you will get true
because the output of this condition is false. You can see the result, we're
going to flip the truth, we're going to get exactly
the opposite if you use. It's going to look like this in the calculation in Tableau. Here again, we have our F
statement, our condition. But just before the condition, we're going to go and put n, and with that, you are
reversing everything. Now what you are saying
here in this condition, if the sales is not
higher than the 1,000, then we're going to
get the value low. That means anything equal to 1,000 or smaller than 1,000,
it's going to be low. We are reversing the
results. That's it. This is how the nut
operator works. Now let's go back to tableau and practice those three operators. All right. So now we're going to go
to our big data source. Let's grab the information of
the customers to the view. So we're going to
get the customer ID, the first name country
and the scores as well, but I would like to show the discrete values of the scores. Let's switch it to discrete, and then we need a measure. Let's go to the orders and get the sales. Put
it on the coms. As you can see now, we
have for each customer, the total sales
that they ordered. Now the task is to not show all the sales
of all customers, we want to focus on specific
group of customers. Now we want to show the
sales for only customers that come from Germany and
their score is higher than 50. With that, we have two
conditions and we can go and use the end or operator
in order to combine them. As usual, we're going
to go and create our new calculated field, and we're going to call it sales and we're going to start
with the if statements. Now we need to write
our conditions, so the first
condition, the country should be equal to Germany. The country field,
we have it over here must be equal to Germany. Now since we are saying in the task is going
to be here as well, and in order to connect
the second condition. The second condition is the score should
be higher than 50. The field score, should
be higher than 50. Now we have our two conditions. Both of them are connected
with the operator. Now, if both of them are true, what can happen, we're going
to show the value of sales. Next, we're going to say then sales and otherwise,
it's going to be null. That, we're going to go
and end the statements. With that, we can see
that the calculation is valid, everything is fine. Let's go and try
what can happen. Let's go and click
Okay. Now we have our new field in the data
base on the left side. It's going to be
continuous measure because the output can be sales. Now we're going to go
and check the values. But first, I would like to get
rid of those par diagrams. I'm just going to move the
sales to the details and then move it again to the
view over here at the APC. So now we have those values. Let's get our new sales with the end operator and put
it as well on the view. Just let's make it a little bit bigger to see the
headers. All right. So now let's go and
check some customers. Let's take the
customer number two. You can see the
country equal Germany. So we have the first true. The score as well
higher than the 50. We have another true. With that, we're going to
get the output to true. That's why we are
seeing the value of the sales at the output. Let's move to the next one, we have the customer number three. You can see the country is not Germany, we
have here France, so the first condition going to be false, and immediately, the output going to be false because both of them
should be true. But we can check
the second value. You can see the
score is as well, not higher than 50. Both of them fails and the
output can be fail as well. That's why we're getting T. We are not getting the
sales. All right. So now let's move to
another customer number 23. You can see the customers
comes from Germany. So the first condition
is fulfilled. We have our first true, but the score is not higher than 50. So the second condition failed. That's why we didn't
get any results. So as you can see the end
operator is very restrictive, everything should
be true in order to get their results. So that's it. This is how the end
operator works. Let's move to the next
example where we want to show the sales only for the customers that they come from Germany, or the score is higher than 50. The logic is very simple, right. But here we have to change
the operator on how we are compbining those two conditions. We're going to have
the same thing. That's why I'm going
to go to the sales and let's duplicate it, and then we go and edit it. So we're going to
change the name to, and we have the same conditions if the country
equals to Germany, but this time, the score
is higher than 50. So that's why I'm
going to go over here, and let's change
it to or operator. So now I would like to
mention something that those logical functions are very close to the
English language. So if you just read this code, it's like you are saying
a sentence in English. So what you are doing
here is if the country is equal to Germany or the
score is higher than 50, then show the sales. That's it. So you see it's like translating the English sentence to a code, and it's really easy to
write and read as well. So it's really logical. Now let's pack our calculation.
You can see it is valid. Let's go and to.
Immediately, we can see in the view that
with our operator, we are getting more values than the d because the d
is very restrictive. Now let's go and
check some customers. You can see the
first one. We have the country not equal to
Germany. So come from France. The first condition fails. So let's have hope
for the next one. But the score is higher than 50. That means this customer going to fulfill
the requirements. It's enough to have
only one true. That's why we have the
sales in the output. The next customer fulfill both of the conditions
come from Germany, higher than 50, that's why we have the sales like
the end operator. But the third customer,
as you can see, the first condition failed
because France and the second as well failed because the score is not higher than 50, that's why both of them are failed and we don't
have any results. We have to have
at least one true to get something at the output. That's it. This is how
the operator works. Alright, now we have
the following task for you is to show the sales for only customers who either come from
Germany or France. You can bounce the video now in order to
complete the task, and once you are done,
you can resume it. Okay, so let's see
how we can do that. You can go and create a
new calculated field. We can call it sales country. And we're going to start
with the F statements. Then we have the two conditions. The customer should be either
from Germany or France. So the first one going to be
the country equal to Germany and the operator
going to be or So the customer could be either
from Germany or France, country equal to France. What can happen if one of those
conditions are fulfilled, we're going to have
the sales, then sales, and that's it. Let's end it. As you can see, very simple. Let's go and hit a K. As usual, we're going to go and
check the values. Let's drag and drop it over here in the view. We have
it here in the middle. Let's make it a little bit
bigger and see the customers. Now we are checking
only one field, but in two conditions, either the country
France or Germany. The first customer we can see come from France, we're
going to get the value. The second one as well, we're going to get the
sales value, France. USA we will not cut any value because it's not
part of the condition. As you can see now, we
are getting the sales of all customers that come
either from France or Okay. So now I'm going to show
you quickly something. Let's go back to our
calculated field sales country and go and edit it. So now, instead of having, we're going to use the operator. So now what we are saying
is the customer should come from Germany and at
the same time from France. So it sounds weird right.
Let's go and try it. Let's hit and check the results. You can see that the sales
country is completely empty. So we don't see any values
because in our situation, the customer should only
come from only one country. So we cannot have
this condition. So logically, from
the data perspective, this is not possible.
All right, guys. So when that we have learned
the end or operator, let's move next to
the Nat operator. Now we have the following task, show the sales of all customers who don't come from Germany. If the customer come from
any other countries, we're going to see the
sales and the view. But if the customer from
Germany, it should be null. Now let's go and create
a new calculated field. We're going to call
it sales not Germany. And we're going to have as
well, the F statements. Now we have two ways to do it. The first option and the long one where we're going
to go and create a condition for each value inside the country
beside Germany. We're going to do
something like this. Country equal to USA. Then we're going to say or
country equals, for example. Italy, and then for the next
one or country equal France. As you can see, I'm
creating a condition for each value from
that dimension country. Of course, if you have a
long list of countries, you're going to end
up making a lot of conditions as well, what can happen if a new country enters inside your data source, what can happen, you
can always go to the calculation and
add it as a condition. In this option, we are including all the values that we
want to see in the view, but there is better
way to do that, where we're going to
exclude only Germany. Let's go and remove everything. From here. So we're going to say if the country equal to Germany. And this time, before
the condition, we're going to add
the operator nut. So here we're going to go
and reverse everything. So if the customers don't come from Germany, what
can to happen? We're going to show the sales
then sales and that's it. As you can see, it's
very short and simple. We are just excluding
one values. We don't have to
add all the values. We don't have to be
worried about if there is a new country value
inside the data source. Anything not Germany, we're
going to show the sales. Let's go and check the values.
I'm going to go and hit. As usual, we're
going to get a new calculated field and
our data source. Let's drag and dribt to the
view to check the values. Just make the head a little
bit bigger to read it. Then scroll up and the first
customers come from France. We're going to get
the sale informations the next one from Germany. We have Null. Here
we have as well, the customer five from Germany, six, as well from Germany. We don't have any
sales informations. So that we can see that
all the customers that don't come from Germany had
the sales in this field. So as well, we can check that
by sorting the countries, and it's sorted like this, and all those
values from France, we're going to get always
sales informations. And if we go to Germany, you see all the customers
from Germany don't have any sales informations
in this field. So say, we're going to
get again the values. So as you can see, it's
really easy to use and really useful to make
filters and so on, and as well to focus on specific group of
customers in our views. So that's it's about
the three operators, they are really nice to
use. All right, everyone. So that's all for the
logical operators. And with that, we have covered, all eight logical
functions in Tableau. They are really
important functions, since it's going
to help us to make data driven decisions
in the analysis. And with that, we have
covered the last group of functions under the category
row level calculations. We learned around 40 tau
functions, and Next, we're going to learn about the aggregate calculations
in Tableau.
106. Aggregate Functions | SUM, AVG, COUNT, COUNTD, MAX, MIN: All right. So now we're
going to talk about the second type of calculations
that we have in tableau, the aggregate calculations, and I split the functions
into two groups. The first group
going to aggregate the measures in our data source. So we have the sum
average count and so on. And the second
group where we can aggregate the dimensions
of our data source. And here we have
only one function. We have the attributes. So now, we're going to
focus on the first group, how to aggregate the
measures in tableau. All right. The
first question is, what are aggregate
calculations in Tableau? If you use those calculations, you're going to aggregate the
rows of the data source and put the result at the visualization
level of the details. That means the dimension
that you are using in the view going to control the
granularity of the measure. Let's have a quick example
in order to understand it. Let's say that we
have the order table inside our data source, and we would like to find the total sales by the products. And in this example,
the sales is a measure and the product
is the dimension. So in order to find
the total sales, we can use the
function sum in table. So it's going to look like this. We can use the sum of sales. And in the view, we can have
one dimension, the products. It is the one to control the level of details
in the view, and then we have the result
of the function sum. So we're going to put here the results of the aggregations. So now with this table
can go and group up the rows of the orders,
by the products. So as you can see,
the first group is based on the
product number one. Then we have the
second group for the product number
two, three, and four. So as you can see, the orders
now is divided into groups. And at the visualization levels, we going to have exactly
only one row for each group. So that means for
the product one, we can have only one row, and then TLO can go and summarize all the sales
inside this group. So at the end of the result, we can have the value of 40. You can see the
aggregate calculations is grouping up the rows from the data source and presented as one row at the output
indivisualzations. Then table can move to the
next group for the P two, we can have only one row and the summarization of the
sales going to be 50. And the same thing going to
happen for the product three, we have here two rows and the summarization of
that is going to be 45, and as well for the P four, we have as well one row
indivisualizations, with only 15 as a total sales. As you can see the
aggregate calculation is going to go and
group up the rows of the data source and present it as one value in the
visualizations, and the level of
detail is going to depend on the dimension
that is used in the view. That's why we say that aggregate calculations are going to bring the data at the
visualization level of details. And it's not like
the functions in the row level calculations
where we have commuted each value
on the same row. So we didn't group anything, the number of rows going to
stay exactly like before. This is how the aggregate
calculations works, and we don't have
only one function. We have here multiple functions. So the first one we have the
sum that we just learned, it can return the total sum
of all values within a field, and then we have another
one, the average. It's going to return
the average of all values. Then we
have the counts. It's going to count the number
of values within a field. Then we have another
very similar function called count D. This time we're going to
count the number of unique rows within a field. Then we have the max and min. It's going to return
the maximum value or the minimum value
within a field. If you check the syntax of
those aggregate functions, it's going to be the easiest if you compare to any
other functions. They all follow
the same pattern. So they always start with the name of the
functions, for example, the sum average count and so on, and they all accept
only one field. So as you can see, we
have the sum of sales, average of sales and so on. So we have only one argument,
and it's very simple. So now let's go in
Tableau and start practicing those
aggregate functions. Okay, so back to our
small data source. Let's go to the
products, and as usual, we're going to get the category and as well, the product name. So now those two
dimensions going to define the level of details, and the product name going to be the one that is controlling. So here we have the five
products inside our data source. And now in order to create aggregated calculations in
table, there are two ways. Either you're going to do it
locally directly only for this view or globally by
creating a new calculated field, and it go be available
for all other worksheets. So now let's go and
check the first methods. Way we're going to go and create a quick aggregated calculation. So we're going to
go to the orders, and we're going to
take the sales. So just drag and rub
it here on the view. Now, as you might
already noticed that Tau always tried to aggregate the
data at the visualizations, and for that tableau
are going to use the aggregated functions. So, as you can see,
we have the sales, but before it, we have
the sum of sales. So that means Tableau is using the function sum in order to
aggregate data in the view, and this is the default method from Tau. Aggregate the data. So that means in tableau, the default type of
calculations that's going to be used on the measure is the
aggregate calculations, and the default function
that's going to be always be used is the sum. Now in order to
change the function that is used in
the aggregations, we can go to the measure over
here, right click on it. And here we see
that our field is a measure and using
the sum function. In order to change that,
let's go to the measure, and we can find here a list of all different
aggregate functions that we have in tableau. So we have the sum, the average, the count, count distinct. Minimum, maximum, and so on. So now, for example, we can go over here and change
it to the average. So now instead of sum of sales, we have average of sales, and at the output, we're
going to get the averages. So as you can see,
it's very simple. We just one click, we change the aggregation
function, and as well, it doesn't need a lot
of configurations like we're going to see later
in the table calculations, for example, or the
LOD expressions. So this one is really easy. If you want to
change the function, just go to the measure,
radical click on it, and then here you have a list of all functions that
you can configure. Of course, anything that I'm choosing now from
those functions will not affect any other sheets and will not affect
our data source. Here we still have the
sales. We don't have any field called
the average sales. It's going to be only
locally available for this visualization. That brings us to
the second method where we can create an
aggregated function that is globally available for all other worksheets or workbook connected
to the data source. All right. Now, let's
say that, I would like to have an
extra field inside my data source to find
the total of sales. In order to do that, we're
going to go and create a new calculated fields.
It's really simple. We're going to call
it total sales. And then in order to see the aggregate functions in Tableau, we can check the
documentations over here. So let's go to all and then let's choose aggregates,
and with that, you can find all the aggregate functions in Tableau inside it, you can find as well,
the LOD expressions. So we have here the
fix include and so on. So in order to find
the total sales, we're going to have
the function sum. And as you can see it
need one expression, it's going to be the sales, so it's going to
be only one field. So we're going to have
the sales, and that's it. So as you can see,
the calculation is valued, and let's go and hit. And with that, we got a
new continuous measure inside our data source. But here, the difference between aggregated calculations and
the row level calculations, that's Those calculation is
going to happen on the fly where the row level
calculation is going to store the data
inside the data source. That means if you go and
check the data source data, or if you view the
data from here, you can see that we don't have any information about
the total sales. So now if you browse the data, we don't have any extra
field called total sales. So because those
information will not be pre calculated from Tableau and stored inside the data source, it can happen on the fly as you bring the field to
the visualization. So that means Tableau will not
go immediately and execute the aggregate calculations
as you are creating them and then put the
result in the data source. Tableau will do it on the fly. And that's because
Tableau doesn't know the level of details that you
need at the visualizations. As you know, the data source has the row level of details. So that's why only one
type of calculations, the row level
calculations can be pre executed and stored
inside the data source, and the rest can
stay on the fly. So that means our new
calculated field using the aggregate functions will not store inside the data
source any data. The data going to
be calculated once you drag and drop
it inside the view. So it's going to stay empty
as long as you don't use it. So let's go and close
this over here, and let's drag and drop it to the view to
check the results. And now in this view, we got the total sales by the products. Because the product
name going to control the level of details. Let's say that you
would like to have the total sales by the
category in this view. You have to remove
their product name. In order to do that,
we're going to go and remove their product
name from the view. And with that, we got the
total sales for each category. That means the aggregate
calculations or the granlity of the measures is
going to depend on the level of details
of the visualizations. The dimension can control everything to control the
level of details that we see. The view. So now let's
go and understand how Tableau brought those
numbers to the view. Okay, so in the data source, we have 15 orders, and in the visualizations, we said, Okay, we would
like to have the category. So Tableau going to go and get the category to the
visualizations. And inside there,
there are two values. So we're going to get the
accessories and the monitors. So we're going to have
with that. Only two rows, then we can have the
sales, the total sales. So Tableau going to go and aggregate the sales
for each category. So as you can see,
Table going to go and split the orders
into two groups, the one with the category, accessories, and the other
one with the monitor. Now, in order to find the total
sales of the accessories, Tableu going to go
simply and aggregate all those values of the sales and put the result
at the output. So the first one can
have like around 2377, And for the next group, table can do the same, so we're going to go for
all those orders underneath the category monitor and go and aggregate
all those values. So with that we're going
to get around 4,129. So as you can see
table can go and split their rows by the dimension that is used in the
visualizations. And in this example, it's
going to be by the category. So it's going to split
it into two groups and then going to go and apply
the aggregate functions. Okay, so let's move
to the next one, we would like to find the average sales for each category. In order to do that,
we're going to go and create a new calculated fields. And we're going to
call it average sales, and the function is very simple, so it is the AVG, the average. And then we can have our
field sales and that sets. It's pretty simple. So
let's go and hit acre. As usual, we're going to
get a new empty field inside the data source. But once we drag and
rub it on the view, the calculation is
going to happen. Let's do that. So that we can find the average
sales for each category. And how T did the
calculations is very simple. To go to split again the rows inside the
orders into two groups. The first group for
the accessories. So it's going to go and add up all those values
inside the sales, and then it's going
to be divided by the total number of orders
inside this category. So here we have
around eight orders, so the final value
going to be around 297. The same thing going to
happen for the second group. Table going to go and
add up all those values, then divide it by seven, because we have only seven
orders for the monitor, and we will get 590 as a result. So here we can see
again that the dimension category is deciding how the calculation can happen and as we how the
data can be split up. So that's all for the
average function. Let's move to the next
one. We have the count. Let's say that we
would like to find the number of orders
for each category. In order to do
that, we can go and create again new
calculated field, and we're going to call
it number of orders. And the function
is really simple, so we're going to
use the counts, and inside it, we
need only one field. This time, we're going to
go and count the order IDs. So in order to do that, we can use the order
ID, and that's it. So we are counting
how many orders IDs we have inside our data source. The calculation is valid. Let's go and at K. As usual, we're going to get a continuous measure in our data source. Let's go and drop it to the
view and check the results. We can see that in
the accessories, we got eight orders, and in the anitor we got seven. So now let's see how
Tableau is doing that. It's very simple. Again, our data is
splitted into two groups, and Tableau going to start
simply counting the rows. So how many rows do we have
inside the accessories? It's going to be eight rows. So we have here eight orders. And if you count the
rows of the monitor, you will get as
well, seven orders. So the count function, we are just simply
counting the rows. So that means in
the accessories, we got eight rows
and on the monitor, we got seven orders. There's one more special
thing about the count. Let's say that's inside
our data, we got nulls. Let's say that we don't have
any order ID. It's empty. It's null. So what
can happen here, Tableau will not count it. So in this example, Tableau going to go and count only six. So here instead of seven,
we're going to get six. And this as well going to affect the previous function,
the average, as we lend before going to go and add up all those values, and then it can divide
by the number of orders. So let's say that we
have here a null. This time table will
not divided by seven. To going to go and
divided by six. Here again, a reminder that we have to handle
the nulls inside our data as we
learned before using the Z n or null null and so on. If we divide it on six, going to be different
than dividing it by seven, which is more correct. Here we have seven
orders and six orders. That's been pay attention if you feel that you are doing the
aggregates on top of it, whether it has nulls or not, because having a null here, we're going to get
inaccurate results. We don't have six orders. We have seven orders inside
the monitor. All right. That's all for this function,
the count. All right. Now we're going to move to
a very similar function in Tableau called the
count D. It's going to return the number of unique or distinct
values within a field. It sounds very similar
to the counts, but here we have a
difference between them where we are counting
only the distinct values. Let's have an example in order to understand the difference. We would like now
to show the number of products for each category. Let's go and create a
new calculated field. Let's go it number of products. This time, I'm going to
start first with the function counts to show you
the differences between them, and we're going to use
the field product ID. Let's go and select
that and then get. Again, we've got a
new calculated field. Let's show it at the results, and we can see that the results is very similar to
the number of orders. Here again, we have
eight products for the accessories and seven
products for the monitor. Now, what happened here? If you check the data inside the order, we got only two products with the accessories
and as well, only two products
for the monitor, why we got eight and civil, and that's because
Table going to go and count the number of rows. Whether it's like duplicates
or not, it doesn't matter. Table going to go and count, here we have eight rows. That means we have
eight products. That's why we cannot use the count function
for this task. We have to use another
thing where we're going to use the count D. Let's
go and change it. I'm going to go to the
calculated fields, dots Just add a D after the count to use
the next function. We have count product
ID. Let's go and hit. As you can see in
the result now, we've got two for
the accessories and two for the monitor. Let's have table work here. Table can count the distinct or unique values
within the field. This time, table can pay attention to the
content of the field. I can start counting, here we have the USP mouse, this is one. Then the next one, we have
the same information. Table will not count it at
all, the same for the third. Then for the fourth order, we have a new product. Here we have a new value,
the logtic keyboard. Here we have two. Then
move on to the same stuff, here we have the same values, T will not count them. At the end table did count here, To unique values.
So here we have two products for
the accessories. That's why Table can
go on the output and put two for
the next category, so we start to the same. We have the LG full HD
monitor. This is one product. The second one is
the same value, we'll not count it then
move to the third one. As you can see, it's new
products, new value, so it's going to count
two, and the rest will not count anything because
it as well duplicates. Table can go and count. The number of unique
values within the field. That's why we're going to
have as well here too. Which is more accurate. We
got only two products for the accessories and only two
products for the monitor. This is the difference
between count and count D. Count will just blindly go and count how many rows do we have
inside each category. But count D going to go
and check the content, and it's going to count
only the unique and the distinct values. All right. So now we're going to
move to the last two. We have the max and min. There are very simple
functions in Tableau. The max can find the highest
value within a field, and the men can find the
lowest value within a field. Let's go and check
how it can work. So, let's say that we
would like to show the highest sales
for each category. In order to do that,
we're going to go and create a new
calculated field. Let's call it highest sales. And then we can use
the max function. We have the sales.
It's very simple. It always needs one field. So that's it. Let's hit. And let's check the results. Let's put it on the view. So we can see the highest sales inside the accessories
is the 525, and the highest sales for
the monitor is the 1691. So let's see how this works. As usual, our data is
split it into two groups. We start with the first group, so Tablo going to go and
check all those values. What is the highest values? Inside those sales, it's
going to be the 525. Tau going to present
it at the result. Then we're going to move
to the second group. Tableau going to take all
those values and compare it to each others in order to
find the highest value. And it's going to be
this order number two as the highest sales inside our data for the
category monitor. So that, this is how the max
function work in Tableau. Let's go to the next one to find the lowest sales
for each category. So we're going to
do the same stuff. We're going to have new
calculated field, lowest sales. And this time,
we're going to use the function men and
then our field sales. So that sets click OK. Let's present the result
as well to compare it, so we can find the lowest
sales in the accessories is 56 and the lowest as well
for the monitor is 40. The same thing, T
going to go and check all those values
for the first group. What is the lowest sales? As you can see, it's going to be this order order number ten, going to be the lowest value. Then going to go and
check those group of values in order to
find the lowest value. It's going to be
this one, the 39. T is just rounding the numbers. That's why we have here 40. But in reality, it
is 39.97. That's it. This is how the max and
main works in Tableau. As you can see, the
aggregate functions in Tableau are very simple. Those functions like
I think this is my easiest tutorial that I made in the Tableau
series. All right, guys. So that's all for
these six functions in order to aggregate the
measures of our data source. Next, we're going to talk
about how to aggregate the dimensions using the very confusing
function, the attribute.
107. Aggregate Functions | ATTR Attribute Function: So now we're going to
talk about another aggregate function in Tableau, but this time, this function
is going to be very special, and it is very confusing. A lot of people get confused about the attribute
function in Tableau. So first, as usual, we can understand the
concept behind it, and then we can
practice in tableau. Previously, we have learned that the aggregate
function is going to go and aggregate the numbers, the measures inside
our data source. This makes sense right to have the total
sales in the view. But now how about to aggregate the values
of the dimensions, for example, the customers
or the products. How to aggregate those values, we cannot go and use
the sum function. In order to aggregate
the dimensions, we can go and use the
attribute function. So the attribute
function in Tableau going to go and
aggregate the values of the dimensions of
the data source and present the
result in the view. But this time, I would
like to go and aggregate the values of the
customers by the products. So in order to do
that, we can use the function attributes
for the customers, and in the view, we
can have two values. So first, we have the
dimension products. This one we're going
to define the level of details of this view. And here we have another
field where we're going to have the result of
aggregating the customers. So the attribute
of the customer. Here we have two options. The first one, if
all values are same, then it's going to return a
single value, the same value. Or if we have multiple values, then it can return risk. This might sound very confusing or complex, but don't
worry about it. Let's just follow the example. So again, here, since we are grouping up the data
by the products, Table going to go and group up the orders by the products. So the first group for
the product number one, the second group
for two and so on. And in the visualizations, we're going to have
only one row for each group like any other
aggregate functions. So now for the first group, we're going to have
one row, the pay one, and table going to go
and check the values inside the customers
for this group. So as you can see, we have the same informations
in those three rows, so we have John John, John. So we have the same value. So we are at the first options. If all values are the same, then it returns a single value. That's why table can
return in the output John. So with that table did
implement the first option. Let's go to the next
group, the P two. As you can see in the
customers and the P two, we have here different values. So the first one is John, the second one is Maria Maria. So we don't have the same values right. We have different values. That's why Table can go and execute the second
option because we have multiple values and
table return as risk. So that's why we have
here and Strik a results. So this is how the tribute
function works in Tablea. Let's move on to
the next products. Let's see that we
have the P three. And as you can see, we have here again two different values, John and Maria. They
are not the same. That's why the second option
going to be activated and Table going to have the
asterisk A results. For the product
four, let's check, we have Maria and Maria. So we have the same value. That's why Table going
to go and execute the first option where
all the values are same, and then we're going to get
the same value in the output. That's why we have
Maria. So that's it for the attribute function. It's really simple right.
Once you have an example, then everything
going to be clear. Again, if the values
are the same, like here, John, then we're
going to get the same value. And if the values are different, so you have multiple values, then Tableu going to
have the asterix. And now you might ask what this asterix means in the view. Will To use it as a highlight
or warning for you? To tells you there are more details in this field
inside the customers. And the asterix can
help you as well to understand the relationship
between dimensions, between, for example, the
customers and the products. As you can see for
the product two, we have multiple values. So it is like one
to relationship. But for the product one, we
have one to one relationship. So we have only one customer
for only one product. And with that, you
can understand the relationship
between dimensions. Alright, so with that,
we have understood that. In Tableau, we can, of course, aggregate the measures like in the sum function, but as well, we can go and aggregate
the dimensions inside the data source using the
attribute function in tableau. So this is the main task
that we usually use the attribute function to
aggregate the dimensions. So now let's go
back to Tableau in order to practice this function. All right, so I'm going to
show you a very quick example on how to create the
attributes in Tableau. So let's stick with
the small data source. Let's go this time
to the customers. We're going to
take the countries and the cities as
well to the view. And now I would like
this example to go and aggregate the dimension
city inside this view. So in order to do that, we can use the function attribute. There's two ways to do it either globally and
locally as usual, locally, only for this view globally for all
other worksheets. So let's see the quick
one, the local one. In order to do that, we
go to the city over here. Write a click on it,
and then you can find this option between the
dimensions and measures. This time, we have
the attributes. Again, this is not
the third option of the metadata that we learned before dimensions and measures. This is simply an
aggregate function that Tau just put it between
those two options. So it is not the third option. It is an aggregate function. So let's go and click on that. So now we can see from
the name of the field, we have the function attribute
applied on the field city. The level of details in our visualizations is not
anymore the city like before. It is now the country. The city can have an
aggregated value. For France, we have Paris. For Germany and USA,
we have the S risk. Let's see quickly how
Tableau did that. Here it's very special about the attribute function in Tableau. It's not like all other
aggregate functions where we start from
the data source. Here we start from
the visualizations. Depends on the
visualization level of details that we
have inside the view, going to do the calculation. So here we have the
visualizations, the country and the city. So it's going to focus only
on those two dimensions. And at the start, we
have France, Pare, and we have two
values for Germany and two values for USA. Since the country is the
only dimension that we have in the view and the
city can be an aggregation, the level of detail is
going to be the country. That means we can
have only three rows, only three values. So Tableau going to show us as we can see here
on the left side, that we have France,
Germany and USA. Now as we learned, T going
to go and check the values. If all values are the same, we're going to get
the same value. For France, we have
only one value. It's going to be the same value. Tu going go and put
it at the outputs. Then the next one, Germany, we have this group of rows, we have two rows,
Berlin and Stuttgart. We have two different values. That's why Table
going to go and put the astrisk at the output,
the same for the USA. As you can see, we have
here two different values. We have multiple values, and for that to as well
the risk at the outputs. That's why we have
here only Paris for France and two trisk for
the other two countries. Can see this is very simple. Let's go to another example
to understand the use case of the attributes. All
right, everyone. So now we might ask, nice. We can now aggregate
the dimensions, but where do I use
it in my dashboards. So what are the real use case for the attribute
functions in Tableau? Well, usually I tend to use the attribute functions
in two use cases. The first one inside the tool
tip where I want to show for the users more details
about the aggregations. Let me show you how
I usually do it. Let's go to the big data source, and then we're going to
go to the customers. Let's take for example,
the country, the city, all information about
the all location, and as well the postal code. As usual, we would like to
show the sales and formations. Let's go to the orders and
take the sales to the columns, and we're going to
show the labels and as well the color of the sales. Now we can see that the
level of details of our visualization is going to be based on the postal code, since it's going to bring us to the lowest level of details. Let's say that the
requirements wants us to have the level of details of the
city and not the postal code. There's two ways to do
it. Either we can go and remove the postal code
from the view over here. With that, we got the
level of details. City. But now let's see
that I still want to bring the postal code informations to this visual as a
detail for the users. I cannot just drag
and try put it here. It's going to split
the data right. You can see here Paris. We have two values.
Instead of that, we can use the attribute
functions in Tableau, if we still need to present the postal code informations
in this visualization. As we learned before
we can go over here and quickly switch
it to attribute, or we can make it globally to reuse it in
different worksheets. Let's go and choose that. We're going to go and create
a new calculated field. I'm going to call it
atte postal code. The function is very easy. It's going to be the at spute
and accept only one field. It's going to be
the postal code, and it should be a
dimension. So that's it. The calculation is
valid. Let's go and hit. So that we've got
a new calculated field, a new dimension. Let's go and bring it to the view and remove
the postal code. Now we can understand
quickly from the view that the postal
code and the city, they are almost at the
same level of details. As you can see, we
have always values, but only two countries
where we have the asterisk. So we have the Paris
and the Portland. So with that we understand
the relationship between the postal
code and the city. They are almost at
the same level, but sometimes we
have more details. So in Paris, we have here, two different values for the postal code and as
well for the portland. Now, in order to show those
details for the users, either we can leave it as a field over here as a
header or a better way in order to save some spaces in the visualizations and not
show a lot of headers, we can show it in the tool tip. In order to do that,
we're going to drag our field and drop
it on the details. And then we have over
here this option to configure our tooltip.
Let's go inside it. Now, as you can see, we
have for information, city country sales
and our new field, the attribute postal code. But I would like to
rename it in order to make it easier for
the users to read it. It's going to be the
postal codeformations. Let's go and hit. And now add the users are mouse hovering
on those informations. You can see that we have
more details about the city. We have the postal code
conformations inside it. And if we have multiple
values like in Paris, we're going to have the as risk. I usually explained
for the users. If you find the as risk, it means we have more details
about the aggregations. Which may raise the curiosity
for the users to go on more detailed analysis about the postal codes
instead of the cities. And with that we are presenting the postal code informations, even though that's our level of details in the
visualizations is the city. So this is very common use
case for the attribute where you can present more details
for the visualizations, even if you have a very high
aggregated data at the view. And for that we use the
attribute function in Tableau, but sometimes we end
up like in most of the situation that the users want to see those informations. They want to see
those postal codes, And the sales
informations for them. In order to do that,
we do the following. We go and create a new sheets. And this time, we're going
to create a view where the postal code is
the level of details. So what we need is
the postal code, and as well the sales. So drag and drop the
sales to the view. Let's just make it a
little bit bigger to see the header
informations. So that's it. Let's call it sales
by postal codes. So this view can be now
embedded in the original view. In order to do that,
we're going to go back to our view where we have the
city as the level of details. Now, we want to do an
embedded worksheet inside this view
inside the tool tibe. So let's go to the
tool tip over here. Let's have a new
line, and then we're going to go to this menu
over here, the inserts. The first option,
we have the sheets. Table going to show us all the sheets that we
have in this workbook. It's going to be the last
one, sales by postal codes. Let's go and hit on that. Now we have embedded
another worksheet inside the view
using the tooltip. So that set it's very simple. Let's go and hit. Now let's go and mouse over
on those cities. As you can see, we have
now a table or a view, small view inside the tooltip. If you go to Paris now, we see now the two postal codes, and this will the sales
of those postal codes. This is how I usually do it as a next step if the users
want to see more details. But of course, this needs
more calculations and more resources in Tableau to
put one view in another one. If the users are
happy with the trex, then stay with the attribute, but if they need more details, then you have to
create another view and then put it
inside the tool tube. All right. That's it
for the first use case. We use the attribute to show more details for the
users if we have a high aggregations in the view and we use it usually
in the tool tube. All right, guys. So
now let's move on to the second use case
where I usually use the atrate functions
in my project is to check the data quality
inside the data sources. Usually, if you are
working with the data, you have some expectations
about the data quality. And if you have any suspicions, we can use the
attrit functions in order to investigate
the situation. For example, let's say
that the expectations in our data to have only one
country for each customers. The data should not
allow for some reason to have multiple countries
for each customers. If you are skeptical
about this information, or we want to check the quality
of the data that we get, we can use the attrit
functions like this. So we can go for example
and take the customer ID. We can take the first
name, last name. But now we would like to check the quality of the country. But since we have a lot of
data inside our data source, it can be really
hard now by just checking the values to
understand whether we have multiple values for each customers or is it
one to one relationship. Instead of that, we can go and aggregate the country using
the attribute function. So let's do it this
time by the quick way, so right click on the country, and let's apply the
attribute function. At the start, you might see
okay, nothing is changed. But now instead of quickly
to validate the data, we can sue it as a filter. Right click on the country
over here and show filter. So now on the right
side, table to show us all the possible values that
could happen to this view. So here we have the Ask. We have France, Germany,
Italy, and USA. Of course, what is
interesting is the first one, so I'm just going to remove everything and
select the asterisk. Now, we can see as we selected the Astrik we don't get
any data. This is perfect. That means the data quality
inside our data is perfect, and we have exactly one
country for each customers. But if we start getting
data from the asterix, it means we have
multiple values for each customers and we can
investigate this situation. So this is one time analysis for our data to check
the data quality. But let's say in the next
day or the next month, we got a lot of new customers and we want always to
check those information. We can go and make data
quality dashboards for us or for the users to check whether our expectations
is correct. Only selecting the Asterix,
and we can explain that. We expect that this view
going to be always empty. If this view is not empty, then we have a data
quality issue. And we can add this
information in the title. We can call it data
quality check. Then it's about the
multiple countries. And this is expected
to be empty. So if it's empty, then
everything is fine. So that's all for
the second use case for the Agree
function in Tableau. As you can see, it's really
handy for the projects rights to understand your data
to do data quality checks, and so on, or as well to show more details for the
users inside the tooltip. All right, so that's all for the Abate function in
Tableau, and with that, we have covered many
important functions under the category,
aggregate calculations. Next, we can start talking about the LOD calculations in Tableau. They are really interesting
and important to understand.
108. LOD Expressions | Introduction to Tableau Level of Details: Alright, everyone. So now
we're going to talk about the third type of
tableau calculations. We have the LOD expressions
or LOD calculations. It is another type in order to aggregate the
data in Tableau. And here we have only
three functions. We have fixed,
include, and exclude. As usual, first, we have to understand the
concept behind them, then we can have enough
examples in Tableau. So let's go. All right, guys. So now we can
understand when do we need LOD expressions in Tableau, using this very simple example. So let's say we are building
a view where we have the category information
and the product name, and now we are showing the
total sales for each products. Now by looking to
those two dimensions, you can understand that
the product name is controlling the level
of details in our view. So we have five products, and with that, we got five rows. The product name is splitting
the rows of this table. But now we come to the issue, if you want to show
in the same view in the same
dimensions and setup, you want to show the total
sales for each category. Well, we cannot do that as long as we have the
product name inside this view because
the product name is splitting the view
into products. So in order to show, total sales for each category, either you have to remove the
product name from the view. So by just drag
and drop it away. You can see now we got the
total sales for each category. But if you say, wait, wait, we need to have the
product information in the view, we cannot drop it. So let's go and bring
it back over here. So if you need to have the
product name and you still want to have the total
sales for each category, we have to use the
LOD expressions. Exactly in this situation,
where we need the help of LOD expressions to control the level of details
of our aggregations. Now let's go further and
understand how LOD works. So now we can have quick facts about the LOD calculations. First, LOD calculation
is going to go and aggregate the rows of the data source at
the dimension level that we specify inside
the calculation. That means the dimension of the visualizations will not
control the level of details. This time we're going
to have the level of details of the LOD expressions, and the LOD calculations, like the aggregate calculations, Ta going to go to the data
source in order to query the data there and then bring the result to
the visualizations. The calculation can
happen on the fly. That means Tableau can execute the calculation only if you bring the field to
the visualizations. Tableau will not recalculate and store the informations
inside the data source. So again, how it works, the visualizations can send
query to the data source, and the data source can
answer with their results. So this is how T execute
the logical collections. All right, everyone. We
talked about the level of details many times
during the tutorials. But now let's
understand what do we mean exactly with the
level of details. Let's say that we use in Tableau only the measure
without any dimensions. With that, we're going
to be at the level one, and we will get, for example, the total sales if you are
using the measure sales. So Tableau going to go and
summarize all the sales inside the data source and present
it as only one, one value. Without using any dimensions, we will get the highest
level of aggregations. Let's go to the next level. Let's say that we use a
dimension like the category. In our small data source,
we have only two values. So Table can split this
one value into two values. So here we can see more
details about our sales. It's not only one value. Now we have it as two values. So that means this
dimension going to split our view into two rows. Moving on to the third level, let's say that you
use the country. Inside the data source,
we have three countries. That means we were going
to have three rows. And we have more details
now about the sales. So as you can see the
sales is going to split into three rows. So that means the
level of details of the category is different
from the country. In the category,
we have two rows. In the country, we're
going to have three rows. Moving on to the last level, if you bring the order ID
to the visualizations, you will get the highest
level of details. It is exactly the
level of details that we have inside
the data source. We don't have in our data model any dimension that's
going to break. This rose to more details. We are now at the bottom at
the highest level of details, and we're going to
have exactly 15 rows because we have 15 orders. That means each of those
dimensions are going to go and break the visualizations into
different level of details. The category going
to break it into two country three product name, four order ID, going to
break it into 15 rows. That means the level of details is the highest
at the order ID. And it's going to
be the lowest if you don't use any dimensions. And the opposite, if you're talking about the aggregations, the highest level
of aggregations, if you don't use any dimensions, and you're going to get the
lowest level of aggregations, if you're going to use a
dimension like the order ID. So with that we understood, each dimensions brings us to a different level of details. So this is what do we mean with the level of details in Tableau. All right, guys. Now
we're going to go and understand the LOD
functions in Tableau. But first, we can split those three functions,
into two categories. The first one is going to
be the static calculations where we have only one
function. It is the fixed. The second one, we have
the dynamic calculations. And here we have the two
functions include and exclude. So if you want to have a
fixed or static calculation, you're going to use fixed,
but if you need more dynamic, then you have to use
include and exclude. The dimensions inside
our visualizations or in the ED expressions, Define the level of details, and each dimension has
different level of details. For example, the category
has only two values. That means the level of details
here is very low compared to the order ID where we have the highest
level of details. So let's say that
our current level of details inside the
view is the country. So we have the level three. We can use the LOD
expressions in order to bring the calculations to
a lower level of details, and we can use the exclude or the fixed function
to bring it for example to the level
two, the category. But now, in order to present the calculations in
the current view, what can happen the values can be, duplicated or replicated. Like we have seen in the last
year's case where we have the tables and we duplicated or replicated all the values, or we can use the LOD
expressions to bring us to a higher level of details like using the include or fixed. But now, if we
want to bring back the calculations to
the current view, we have to do aggregations, like we have done
the average number of customers for each category. Since the customers has a higher level of details
than the category. You have to pay attention
to the dimensions that you are using inside
the LOD calculations. It's going to bring
the aggregations to a higher level of details, then you have to focus on the aggregate functions
that you are using in order to bring the result to the current level of
details in the view. That means we have always to aggregate data in order to go back to a lower level of details or to higher
level of aggregations. Always here, we have to use
an aggregate functions in order to come back to the
current level of details. But if you are on above, it's easy it's going to just duplicate the data
and replicated. I hope that was
clear. This is one of the most complicated
concept that we have in tableau if you compare
to all other concepts. All right, guys. Now we're
going to go and understand the syntax of the
LOD expressions. They start with
the function name, so either it's going to be the
fixed, include or exclude. After that, we have
the double points. Then we have to define
the aggregations. It's like the aggregate
calculations, something like sum of sales, average of sales,
maximin, and so on. But the most usual
aggregation that we use here is the sum of something.
Let's have a few examples. We can go with the
following like say, fixed, then we don't
specify any dimensions. Then we specify
the aggregations. So we have in this
example, the sum of sales. Now, think about
the LOD expressions as you are building
view in Tableau. You always have to specify the dimensions and measures
of the aggregations. So here we are telling
Tableau to do the sum of sales without considering
any dimensions. Now, let's go and add a dimensions inside
the calculation, like, for example, the category. Here again, the same analogy. It's like you are
building view from the dimension category and
the aggregation sum of sales. Of course, you can go and
add more dimensions like the category and the product
name, the same analogy. We have two dimensions in the view, category product name, and then we have
the sum of sales. Now, of course,
we can go and add more dimensions like the
category product name. So the same analogy, we are adding two dimensions of the view category
and the product name, and the aggregation
is the sum of sales. Of course, we can go and
use another functions like the include or exclude
in those examples, or another aggregations like the average of sales and so on. So as you can see, building an LOD expression is very similar as you are
building any view. You have always to define the dimensions and as will the aggregations
from the measures. So that's all about the syntax
of the LOD expressions.
109. LOD Expressions | FIXED: All right, so there are two
types of level of detail LOD. The first one is the one that we define inside our
visualizations. We call it LOD vis, and the other one that we
define inside the calculations, we call it LOD expressions. Now, let's say that inside
the visualizations. We have two dimensions category and country, and
we have the sales. Now on the right
side in the LOD, if you go and use
the fixed function. So let's say that we have the fixed category sum of sales. What we have done
here is exactly like you are building
any other view. You need always a dimension, and as we an aggregation. With that, Tableau can go and let's say internally
going to create a hidden view with the dimension category and
the aggregation sum of sales. Here since we say it
is a fixed function, Tableau will ignore
the dimension that we have on the view, so it can work completely independent from the dimensions that is presented in the view. That means the calculation
is going to be very static and doesn't matter what you're going to do in the
visualizations, nothing going to change
in the calculation of the LOD expression.
What do I really mean? Let's say that in the view, you have added a new dimension. Let's say the
product. Now you have made a change in
the visualizations. We have now three dimensions, product category and country. But the LOD expression
will not change at all. It's going to get exactly
the same results. I can have the category
and the aggregation sales. This is the main purpose of
the fixed function to make it independent from the dimensions that we have inside the view. Everything going to be static and this is exactly
the main difference between this function and the other two include and exclude. As you can see building the LOD expressions, it's very easy. It's very similar as you are building visualizations
in Tableau, as you are dragging the
dimensions and aggregations. Here instead, you have to define it inside
the calculation, and always you have to define the dimensions and aggregations. It's really simple once
you understand it. Now let's move to
the next one to the exclude. All
right, everyone. So now back to our
view where we have the product name in
the visualizations, and we cannot use the
aggregate calculations in order to show the total
sales Pi category. In order to solve this,
we're going to use the LOD expressions using
the fixed function. So let's go and create a
new calculated fields. So we will call it
sales pi category. Now we're going to use
the fixed function, so let's start tipping fixed and use this
suggestion from here. Now next, we have to
define the dimension. Since we say sales by category, then we need the category. Let's add the dimension
category and then double point and the aggregation
can be the sum of sales. And at the end, we have
to close the packets. So as you can see,
it's very simple, we have to define
the dimension and as well the aggregation that we need in the visualizations. So let's go and hit ok. But as usual, we will get a new calculated field on the measure, and it's going to be calculated
on the flies that Twins D will not go now and store the
results in the data source. So let's go and
check the results, drag and drop it to
the view over here. So now we see in the results, we have the sales
by the category. We are ignoring the
dimension product name. It is based completely on
the dimension category. I usually work with
the LOD expressions. In order to understand it, I always imagine that
Tau is creating a separate view in order to calculate the LOD expressions, then add it to the current view. Let me show you what
I mean with that. Let's go and open again
our calculated field, and on the right side, we have over here, the data
source information sense Tableau can go and
query those data. We are saying fixed category. That means we can grab
the dimension category, and inside there are two values. We have the accessories
and the monitor. So next, we have the sum of sales. This is
the aggregations. Table going to grab the sales and start doing
the aggregations. So it's going to
go and summarize all those values for the first sections for
the accessories, and we will get the total
sales of the accessories. Then Table going to go and summarize all the sales
for the second category, and with that we will get
the total sales by monitor. The output of our calculation, the LOD expression can
look something like this, as you can see the
level of details in the LOD expression, completely different
than the view. So here we have only two rows, and in the view,
we have five rows. The next step table can go and merge those results to the view. We have the first three products belongs to the
category accessories. That's why we are
seeing the values, the total sales from the
accessory in the view, and then the next two products belongs to the category monitor. That's why we are seeing the
total sales by the monitor. This is how I usually do
it in order to understand the LD expressions if
things get complicated. Now, one more thing about
the fixed calculations, we say that it is static, it is fixed, it doesn't matter what I'm
presenting in the view. We will always get
the same results and nothing changed
in the LD expression. What I mean with that, let's
go and change a few stuff. Let's take the
product name away. You can see we still
get the same values. Let's go and add, for
example, the country. To the view. So let's go to the delecations and
just add the countries. As you can see, nothing
going to change. The LOD expression can have
exactly the same values, and it is static,
all right, guys. That's how the fixed LOD
expression works in Tableau. All right, as we have
the following use case, I would like to
create a histogram to measure the
customer's loyalty. That means I would like to
have the data distributions of the number of customers distributed by the
number of orders. So I would like to
understand here, what are the number
of orders that the majority of my
customers are ordering. So that means I would
like to understand the behavior of my customers. So that means in order
to build such a thing, we need two measures, the number of customers
and the number of orders. Well, before we have learned
how to build histograms, but only from one measure. So if you have two measures, this time we have to go and
create LOD expressions. So now let's do it step
by step in order to learn how to build Such a
visual. All right, guys. So first, let's understand
the data that we have. Let's show the number of
orders for each customers. So let's go to the
customers over here. We are at the big data source. Then let's take, for
example, the customer ID. With that, we can have a list of all customers inside
the data source, and then let's go to the orders and grab the order counts. With that, we got the count
of orders for each customers. Now, let's go and sort the data. So we can see we have
only one customers with the highest
number of orders, 29. Then we have three customers that ordered the same amount. So we have 28, three times. So three customers
ordered the same amount. Then we have one customer
that ordered 26. Then we have over
here five customers that ordered the same amount. So we have 25 orders for
those five customers. So now, since we
have two measures, the number of orders and
the number of customers, we have to turn one of
them to a dimension. So I'm going to be working
now with the number of orders to turn it
to a dimension. So we want those values, the 29, 28, 26 25. In order to do that,
we can go and create an LOD expressions using
the fixed function. So let's go and create
a new calculated field. We can acculate
number of orders. Per customer. We're
going to go and build something very
similar to this view using the LD expressions. So we're going to start
with the fixed function, then our dimension going
to be the customer ID, like in the view, and then our aggregation going to
be the count of orders. You can go with that
distinct if you are not sure whether they are
duplicated inside the orders, but I'll stick
with the accounts, and then we're going
to have the order ID, and then let's go and closet. With that, the
calculation is valid. So we just build
exactly like this view. Let's go and a. Now with that
we've got our new field, here, the number of orders. Let's go and check the
results Is going to be exactly the same
data that we have. Inside our view. But
this time we have an LOD expression where we have more control
in this measure. Now we're going to drop
everything from the view. We just need the new
calculated fields, and now let's go and
switch it to dimension in order to have distinct values and then move it to discrete. With that, we've
got something very similar to the benz right. Here we have a distinct values
from the number of orders. Now, what is missing
is, of course, here the number of customers
in order to have histogram. Let's go to the customers counts over here and just
drop it on the rows. With that, we've got
exactly what we want, the data distributions of
the number of customers. As you can see over
here, for example, We have three customers
that ordered four times. And here again, we
have only one customer that ordered 29 times. If you remember the example, and then we have here
those three customers that ordered 28 times. So that you can
understand quickly the behavior of the customers
by just checking the view, we can understand that most of our customers are
ordering 11-16, which is really good
like we don't have a lot of customers that are
ordering only once, so the left side over here is really low,
which is very good. Of course, now we are
summarizing all the data that we have inside the data
source at the five years. Now you might have the question, does the behavior of the
customer change over the time? In order to answer
this question, you have to bring the time. So we have to bring
the order date. Let's drag and drop it
to the roads over here. Now we can see very quickly
that the behavior of the customers are not
changing over the time. So as you can see the histograms
looks identical, right. So most of the
customers are ordering 11-15 and that's over the years. We cannot do such analysis
without the LOD expressions, so you can see the power of LOD.
110. LOD Expressions | EXCLUDE: Okay, so in the visualizations, we're going to have
exactly the same view with the two dimensions,
category and country. But now in the yellow
D expressions, we're going to use the
excludes where we're going to have exclude category,
sum of sales. So now what we are telling
Tableau is to go and exclude the dimension category
from the visualization. So that means in the yellow DD expression on the right side, we're going to get
all the dimensions from the visualizations. And we will exclude
now the category. So we're going to remove the category from
the dimensions. And that means on the LOD
expression now in this example, we have the country
that can control the level of details in
the LOD expressions, and Tableau can to
do the aggregations again depending on
this dimension. So that means the exclude
function will always remove the dimensions that is specified in the calculation. And here, the big difference between the exclude
and the fixed, Exclude is depending on the dimensions that
we have in the view. Let's say that we have added in the view another dimension. So now we have product
category and country. What can happen to
the LOD expressions, Tableau going to take
all those dimensions and we only exclude
the category. That means the
calculation now going to depend only on the
product and the country. So as you can see it is very dynamic and it depends
on the visualizations. The exclude will always react to the dimensions
that are specified in the visualizations
and going to remove the dimensions that we
specify in the calculation. Okay. Moving on to the second D function that
we have, the exclude. Let's say that, I
would like to have the total sales inside the view, but I would like to ignore
the dimension category. In order to do that, we
can use the exclude. Let's go and create a
new calculated field. Let's call it sales
exclude category. We start with the
function excludes. Let's that, and then
we're going to have to specify the dimension
that should be excluded. It's going to be the category. After that, as usual, we have to define the aggregate
calculation. It's going to be
the sum of sales. Let's close the packets. So it's very simple we
are telling Tableau to ignore always the category
from the calculations. So everything is valid.
Let's go and hit. And as usual, we
will get our new calculated field
in the data brain. Let's go and trot on the view in order to check the results. So then if you check
the new results, you can see we've got
different numbers from the sales by category
or the original sales. So what is going on over here. Now since we are using the
exclude function in Tableau, the LOD calculation
is going to be depending on the
dimensions of the view. So let's open again
our calculated field, and let's see what
Tableau going to do. Table depend on the dimensions that we
have inside the view. So we will have in
the LOD calculations, the country and the category. But since we are
here saying, Okay, go and exclude, go and
remove the category. Table can remove the
dimension category, and with that we are left only with the dimension country. So since we here have Dublicates we have only three countries. So at the end in
the LD expressions, we will have three rows. So now what T going to do going
to go and find the sales, the total sales
for each country. And the data so is
going to be split it into three groups for
each country, one. So we have France,
Germany, and USA. That means that we're
going to go for example for France
and go and summarize all the sales for
those three orders and both the results
at the output, then goes for the
same as well for Germany and take
all those sales, summarize it and get as well, and the results the
total sales for Germany, and then we have for the
USA those four orders, and we're going to go and
summarize the sales for that. With that, the output of the LOD expression going
to look like this. We have the country and the
total sales of countries. Now if you compare
to the view to the results that we
have, as you can see, as we exclude the category, we're going to have the total
sales for each country. Here France, we have 172, for the second category,
we have France, we will get exactly
the same total and the same thing going
to happen for Germany, so we will have exactly the same values in both categories. So for Germany, we'll get
this value, and as well, for the monitoring in Germany,
we will get this value. As you can see,
once you understand what is going on
in the background, you will understand the
numbers in the view. As we say that the
exclude is dynamic. It is not like the fixed. We will not get
always those results. It's really going to depend on the views on the dimensions
that we have in the view. Let's take for example, let's add another dimension
to the view. Let's go and get the customers. Let's go to the customers, take the first name, and
let's drop it over here. Now, if you look
closely to the data, you can see those numbers, nothing changed inside it, because it's always fixed
to the category dimension. But they exclude this time,
they have different numbers. So if you go and
compare what we have at the start at the total
sales for countries, those numbers, you don't find it anymore in the sales over here. And that's because we have
added a new dimensions. We don't have only the country. We have as well the first
am of the customers. So that means now we have in the LOD expressions
two dimensions. The country and the first name. So the result, the output of the LOD expression
can look like this. We have two dimensions, country and the first name. We don't have the
category, we exclude it, we remove it from the view, and then we have the total sales for this combination
of dimensions. So the total sales for
George from France, total sales for Maria
from Germany and so on, and those numbers are exactly the same that you
are seeing in the view. So as you can see, the exclude
function is dynamic and depends on the dimensions that are presented
inside the view. So this is how it works. All right, everyone.
Now in this use case, we want to compare the
sales of all categories to the sales of a specific category like here selected
one, the tables. In order to understand
how the sales of the other categories are doing
to this specific category. In order to build such a view, we have to use the power
of LOD expressions. This time we can
use the exclude. Let's learn step by step
how to create such a view. All right. So now let's start with
the first step where we want to show the
sales by subcategory. This is the easiest
one. Let's go and grab the subcategory
to the rows, and let's take the sales the columns and
then we're going to go and sort the sales. Let's go and do
that. Now, our task is to go and find
the differences between each subcategory with a specific subcategory
of the tables. For example, we're going to
go and find the difference between the sales of phones
and the sales of tables. That means in order to
find the differences in each row, we
need two measures. The first measure is
going to be the sales of the current category,
like for example, the sales of the
phone, and the second measure we need the
sales of the tables. Here we need the sales of
the tables to be as well at the same row In the first
measure, we have it already, we have here the sales
for each category, but the second one, we don't have it yet, so we
need to have for each row, the sales of the tables. In order to do that, we're
going to go and create a new calculated field
to have these tasks. Let's go and create a
new calculated field. Let's call it sales of tables. What do you want to check now
is whether the subcategory, the current one is tables? If yes, then show the sales. So we're going to
use the statements, then we want to check
the subcategory. If it equals to tables, you should write it exactly like the data that we have
inside the data source. So what can happen? We
want to show the sales. Otherwise, do nothing. So we want to have nulls. If the subcategory
is not tables. So what we are doing now is isolating the sales of
the subcategory tables. So let's go and it, and let's go and bring it
to the view over here. So that as you can
see, we have isolated the sales of the tables
in this in new measure, but we still have the
problem that we would like to repeat this
value for each row. So as you can see,
we have it only if the subcategory
equals two tables. So now, in order to repeat
this value for all the rows, here comes the trick or the magic of the LOD
expression exclude. As you learned
before, the exclude going to go and
repeat the values, so we can go and use this trick. What we're going to
tell tableau is that. Imagine that in this view, there is no subcategory. So what can happen, this measure is going to be
repeated for all rows. Let's go and do that. Let's go and create a new
calculated field. So we can call it
exclude subcategory. So now we have to use
the nested calculations because if you put everything
in one calculation, it's going to be
really complicated. So now we want to tell tableau, imagine that we don't have
subcategory in our view. So exclude subcategory, and the aggregation
going to be the sum, but this time of the new measure that we created for the tables. So sales of tables, Then
we have to close it. Something like this. We
are telling Tableau, exclude the subcategory from the view and do
the aggregations. Let's see what can happen it and drag and drop to
the view over here. As you can see, since we have only one value and we are ignoring complete
the subcategory. We will get the same value
repeated for each rose. Now we have all what do we
need to find the differences. We have the sales of each categories and the sales of specific category,
the tables. Now we're going to move
to the last step where it's going to be the
easiest part where we want to find the differences
between those two measures, we're going to go
and subtract them. Let's go and create a
new calculated field. Let's call it difference. Okay. And then we can
subtract the first value. It's going to be simply
the sum of sales. This can be the first value
that we have over here. Then with our new measure, it's going to be the sum
of our exclude functions. Exclude subcategory,
and that's it. Let's go and hit and let's
drop it to the view. So that we solve the task, we have the differences
between the sales of each category and the
sales of specific tables. Of course, you can see the table is going to be zero over
here because we are subtracting the sum of sales
with the exactly same sales. It is a little bit
tricky, but if you understand how the
LOD expression works, you can really do such analyses. Now let's go and drop
everything from here. We don't need those sub steps. I'm just going to remove them. Now, of course, we can add
the coloring over here. Let's go to the measure on the right side and let's
take the measure to the colors and with
that we can see nicely the differences between the
subcategories and the tables. Now if you'd like to
highlight the tables, since it's our main category where we comparing
all the others to it, we can make the use of
the sales of tables. Let's switch to
this measure over here to the sum of
sales and the marks, and then let's take the sales of tables and put it on the colors, and with that, you are
highlighting the main subcategory. With that we have made
really complicated analysis using the LOD expressions.
111. LOD Expressions | INCLUDE: All right, so now let's move
to the include function. It is exactly the
opposite of exclude. So we're going to have
the same example. Indivisualizations, we have the two dimensions
category and country. And now we're going
to say to Tableau, include customer dimension, and we're going to have
the same aggregation, the sum of sales. So now what we are
telling Tableau with this calculation is to add
one more dimensions to the visualizations to add dimension customers to
the two other dimensions that we have inside
the visualizations. So here, again,
it's very dynamic. Tableau go takes the dimensions that are presented in
the visualizations, the category and the country. And add to it a new
dimension, the customers. The function include is very
similar to the exclude. It is dynamic. It
is depending on the dimensions that we have
inside the visualizations. Again, the same example, if we go and add
one more dimension, the products, we
will end up having three dimensions in
the visualizations, and table in the LOD
expressions can add one more dimensions
to the expression where we're going to have
at the end four dimensions, customers product
category, and country. That means in include
function, we are saying, do the aggregations and all dimensions that
we have inside the visualizations plus
one more dimension that comes from the calculation. It's really easy, right?
So now to summarize, the fixed function
is very static. It doesn't care
about the dimensions that we have inside
the visualizations. It is completely independent, so it can stay the same as you are changing
the visualizations. But the exclude and include, they are depending on
the visualizations, exclude going to go and
remove one dimensions from the dimensions that are presented indivisualizations, where include going
to go and add plus one more dimension to the dimensions that are
presented indivisualzations. With that, we have
now understanding how those three functions
works in Tableau. So now we're going to
go back to Tableau in order to practice
those three functions. Let's go. All right. Now we need more attention
about this function to include it is more difficult
than the exclude and fixed. Let's have some
coffee. Let's go. As we learned before,
that each dimensions has different level of details. For example, the first name has more details than the
country or the category. Now it comes to the
issue, if you want to remove such a details
from the visualizations, so you want to remove
the customer's names, and you want to stick only with the category and the country, but still you want to introduce an aggregation that has to do with the customers with a dimension that has
a lot of details. For example, we want to bring here an aggregation that shows the average sales of customers for each
country and category. But without showing
the customers informations as a dimension. Let's go and remove the
first name from here. We don't have here any
customers informations, but still we want to
bring the aggregations to the customer's level by calculating the average
sales of customers. In this case, if your
aggregation is based on a dimensions with a high level of details like the
customers or the other ID, then you have to use
the function include. Let's see how we can
do that. Let's go and create a new
calculated field, and we can call it average
sales of customers. We're going to use
the function include. So let's select the include. Now we have to say to Tableau, which dimension can be
included in the view. So currently, we have the
category and the country. We would like to
add the first name, or you can add the customer
ID, doesn't matter. Let's add the first name, and then we have to
add the aggregation. So this time we're going
to use the sum of sales. Now you might ask, why do
we have the sum of sales? We are talking
about the average. Well, the average is going to be the second aggregation that we're going to do it on
top of this D expression. First, we have to summarize the values that we have
inside the data source, and then we're going to do
the average on top of it. So we're going to
do it step by step. Don't worry about it. Then we
have to close the brackets. Like this. As you can see now, the calculation is valid. Let's go and hit. With that, as usual, we get a
new calculated field. Let's drag and drop
it to the view. We still are not
there because here we have the average
sales of customers, but the function that is
used in Tableau is the sum. We have to go and switch it
to the average function. Let's go and do that. With that, we got the average sales of customers for each
category and country. Now we're going to
see step by step how Tableau did the
execution of the cloude. The include going to depend on the dimensions of the view. We have here the category
and the country. That means Taba can start
something like this. Have the category
and the country. The next step table can go
and check the LOD function. Let's go and open it again. So we are telling Tau now, go and include the first name to the dimensions that are
displayed in the view. So Tableau can go and
grab those informations, the first name and
presented in the output. So we will have
three dimensions, first name, category,
and country. So we can have
something like this. So now if you compare
the number of rows of the LOD expressions
with the view, you can see that we have
now more details in the LOD expressions since
we added the first name. So here we have
around eight rows, but in the view,
we have six rows. So the level of details of the LOD expressions is
higher than the view. Table can go to the
next step and say, Okay, we have to have
the sum of sales. So we can have the sales
as well over here, and To going to go start
aggregating the rows. So for example, first, we have George accessories are France. It's going to be only
this row over here. We don't have it anywhere else. So we can have the 91. Then we have Maria
accessories Germany. And for that, we
have three rows. To go to go and aggregate those three rows in the outputs. We will get something
like this, and so on. So Tao going to go
and start summarizing those values based on
those three dimensions. At the end, we will get in the output, something like this. So that Sabo calculated the
sum of sales by including the first name to the dimensions that are presented in
the visualization. Here we come to the
issue where we have in the LOD expressions more
details than the view. So in order to bring those
results to the view, we have to aggregate it again, so we have to either summarize it or do the average and so on. So we cannot bring those details over here without doing
any aggregations. In this example, we want
to find the average of customers for each
category and country. That's why we have used
the average function. So that means if you are
using the include function or you have more details
in the LOD expressions, we have to aggregate the data in order to bring it to
the visualizations. But in the other hand, if you
are using exclude or fixed, and the output of
the LOD expression has lower level of
details than the view, then what can happen, we're
going to have double kits. For example, you can see over
here, sales by category. You can see we have double kits. So it doesn't matter
which function we're going to use
summarize or average, we will get always
that Dublicates. The same thing for the exclude, we had lower level in details in the expressions
compared to the view. That's why you can
see duplicates. We have the same numbers
over here, the three rows, they are like repeated over
here for the second category. This is the effect of
the LOD expressions. If the level of details in the expression is higher
than the visualizations, then we have to
aggregate the data, but if the level of details in the LOD expressions is
lower than the view, then what can happen,
we can get doubles. Back to our example, T going to go and find the average
of those values. So the first value
is going to stay the same because we have
it only as one row. So it's going to stay the same. But now for those two rows, as you can see,
German accessories, T going to go and
find the average of those t values, we will get 954. Then for the next row,
we have accessories USA. In the output, we
have only one row. That's why the average
can be exactly the same. The same goes for monitor
France, the same value. But the next value, we
have monitor Germany. Here we have two values. T can go and find the average of those two values and
we will get 433. And for the last one
we got only one value. That's why we got
exactly the same number. As you can see, if
you get more details as a result from the
LOD expressions, things get more complicated, and you have to be careful which aggregations you are
using in the visualizations. All right, so that we
have learned how to can execute those three
functions step by step.
112. Table Calculations | FIRST, LAST, INDEX, RANK: Everyone. Now we're going to
talk about the last type of calculations that
we have in Tableau, the table calculations. Here we have different functions
like the running window, rank, first last index lockup. We're going to talk
about all those functions in this tutorial. As usual, first,
we can understand the concept behind the
table calculations. Then we're going to
go back to Tableau in order to start
practicing. Let's go. The first question is, what
are table calculations? Well, there are calculations that are going to be executed or performed after the aggregation is done on the visualizations. So they're going to aggregate the aggregations on Tableau. And it's important to understand
the level of details, it's going to be depending
on the visualizations. So that means here, again, the dimensions in the view can control the
level of details. And now to the big
difference between the table calculations
and the others, the calculations
can be performed on the data that we
see in the view. So Tableau will not go to the data source and
equate the data. Tableau and equate the data that is presented in the view. So that means the view can
be querying the view itself. It's going to send a query to the data inside the
visualizations, and the view going to return the result pack to
the view itself. So we are not going back
to the data source. Everything going to be
queried inside the view. And the other three types of calculations like the
aggregate calculations, LOD and role level calculations, they always going to
query the data from the data source and bring
the result to the view. Only this type of calculation going to query the
data in the view. All right, guys, in order to
create table calculations, we have to define two things. First, the scope, second, we have to define
the directions. The scope means which data can be included in one calculation. For example, we have
the following view. It looked like a table right, so we have here rows, and
we have multiple columns. But here we can see that our
data is splitted by groups. Each group can be defined
by the dimension quarter, so we have the Q one, two, and. The first option that we
have is the whole table. That means the calculation can include everything
inside this table. It will ignore any partitions that we have inside this table. It's going to start
from the first value and it's going to end
up by the last value. Moving on to the next scope or to the next option,
we have the pain. This time, the
calculation is going to focus on a smaller scope. This time we're
going to focus on the partition or
the group of data, which is defined by the quarter. That means the table
calculation is going to be done for each
group separately. We can have for those
three rows calculations. Then we can move to
the second group to the third group, and so on. Moving on to the last
cup, we have the cell. It's going to be only one
value inside the view, the scope going
to be very small, including only one
individual value. Here we have to
define for tableau, the scope of the calculations. Is it going to be the whole
table or only the pine only the group of data or
only one cell. All right. The next thing that
table needs from us is the direction
of the calculations, how the calculation is going
to move through our table. So here we have four
different options. The first one going to be down. That means we're going to
start from the top value, and we're going to move down
until we reach the bottom. And this, of course, go
to depend on the scope, whether we are running
the whole table or only a group of values
like we have in the pane. And in this example, we
have the table down. That means we are processing all the values in one
calculations from top to bottom, then it's going to reset and
move to the second column, and we can do the same
thing for the next year. That means this time
the calculations is moving through the
columns in one go. So it starts from the first year and it ends up with
the next year, then it can reset and start
for the next row and so on. We are moving from
left to right. Those two methods
are the basics, either you can move down
or you can move right. The next two directions, it's going to be mixing
those two methods. The first one going to
be down then across. That means first we have to
go down through the table, and then we have to go across. It's going to start from the top first, then go to the bottom. But this time it will not reset and move to
the next column. It's going to continue
doing the aggregations. It's going to go to
the right across. Then it's going to go move
again from top to bottom there across top to bottom until
we reach the last value. That means here we
don't have any resets. It's going to continue the calculations
through all values. It's not like the first
two methods where we have resets for each row over
here or for each column. This time, the starting
value going to be the top left and the last value
going to be the ptom right. Moving on to the last
direction that we have, I think you got it already, it's exactly the opposite. First, we do across, then we're going to do down. Here again, there is no resets. We can start with the first
value on the top left, and then we go to
the right first. Then we jump to the next row. Then we go to the
right, we jump down right until we reach the last
value on the ptom right. So that means the calculation first is going to move right, and then it's going to
jump down to the next row. Alright, so you can see, it's not that hard once you get it. We have four
different directions and three different scopes that Slo needs from us in order to
create table calculations. All right, guys. In table, we have different
methods on how to create table calculations depend
on the difficulty. The first methods that we have is the quick table calculations. So as the name says, it's very
quick and easy to create. So here we have a list of
different table calculations, and you don't have to
configure anything. You just have to click on
the function that you need, and table can do the rest. So here we have a very
common table calculations like the running total, the difference, rank,
moving average, and so on. The second methods, it's
going to be not that quick. We have to configure
a few stuff, but still we are not writing. Any functions or
any calculations. Still we are clicking around. But here we have more
options and more control to configure the
table calculations if you compared
to the first one. The first one is just selecting the function and that sets. Here again, we have
very similar functions. We have the rank running
total moving calculations, and then we can define different
options like the scope, which dimensions can control the table calculations
and so on. Moving on to the last method on how to create
table calculations, we can do it by creating a
new calculated field and then use the functions that are used for the
table calculations. Here we have a list
of many functions that you can use in order
to do table calculations. But they are a little bit
harder if you compare to the first two methods in order to create table calculations. As you can see, as you are
moving from left to right, things get harder,
but with that, you are getting the full
control and the full options. Next, we will go back to Tableau in order to try
those three methods, and we're going to try
a few functions that we have inside the
table calculations. All right, y. So back to Tau, let's go to the big data source. Let's go to the products
and get the usual stuff, so we're going to
get the category, subcategory and the sales as usual to the sales over here. I'm going to show you
the different methods on how to create
table calculations, and we're going to start
with the first one, we have the quick
table calculations, which is the easiest one. In order to do that, we're
going to do it on the view, so it's going to be only locally
available for this view. It's not like creating
a new calculated field. So we're going to
go to our measure over here, right click on it. And then here we
have two options. The first one says, add
table calculations. One going to be Quick
table calculations. The first one is
the middle one that I showed you previously
in the presentation, where you have to
configure different stuff, but the second one is the
easiest one and the quickest one where we can create table calculations
with only one click. Now let's go and check the
quick table calculations. If you go over here,
you will find a list of different table calculations, and we can go over
here, and let's check, for example, the running
total. Click on that. And here, there's two
things to be noticed. First, the numbers
here changed because here we have different
aggregation functions, and as well we have here a
new icon and the measure. W wants us to quickly
identify whether the measure is using
aggregate calculations or a table calculations. So if you see the triangle, that means this measure is
using table calculations. So as you can see
with only one click, we have created
table calculations. Here we have running total. Don't worry about it.
I'm going to explain it step by step later. Now you
might say, you know what? We didn't define
anything, the scope, the directions for the
calculations, how we can do that. If you go back to our measure
to the table calculations, ticculate and you
can find now we have more options
once we convert it to table calculations
and exactly here the computing using,
we have those options. Here we can define the scope, table, pain, cell, and
as well the directions. As well, you can
see that we have different options like
clear table calculations. If you want to remove it back to the aggregate
calculations. Once you do that,
you can see we got back our sum of sales
without the icon. Well, that means we are not using anymore the
table calculations. We are using now the
aggregate calculations. That's all for the
first methods, how to quickly create table
calculations in Tableau, but we don't have a lot
of options to configure. That's why we have the
second method where we have more options to control
the table calculations. But again, we're going to create it locally only for this few, so it will not be available
for the data source. All right. Before I show
you how to do that, we're going to get one more
dimension to our view. Let's get the years
of the order date. I would like to have
only three years. I'm going to show
it as a filter. I'm just going to remove
the first two years in order to have fewer
data in the view. Now in order to create table calculations only for
this view with more options, we're going to go back to our
measure the sum of sales. Currently, it is an
aggregate calculations, but we want to convert it to table calculation so
radically con and this time, we're going to move to add table calculations
for the first option. You can see we have this
small icon indicate. This is table calculation,
click on that, and we will get a
new window here to configure our table
calculations. So what do we have here? The first thing that
we have to define is the type of calculations. So we have here a menu of different functions for
the table calculations. Again, here, they're
running total, the rank differences, and so on. So let's stick with the first
one, the differences from. So here we have to define
for table two things, the scope and the directions, and they are always together. They are not
splitted as options. So the first one going to be, Table across, and table here did really great job by highlighting how the calculation
going to work. As you can see table here highlighting with
the yellow color, how the calculation is
going to be performed, just to help you to understand how it's going to work.
It's really great. We have the table across
from left to right. Then we have the table
down from top to bottom, and then we have the option
off across the down. As you can see, it's
going to affect the whole table since we move from the top left
to the bottom right. Then we can define
the other scope, like for example, the pin down. As you can see now,
the scope is smaller compared to the table
down. Now the table down, include everything
in this column, but the pin down can
include only this group. So as you can see, our
view is split into three groups based
on the category. So we have the first
group over here, the second and the third, and T is highlighting
the first group. So it is like a partition. Another option, we
have the cell where Tu can highlight only one value, or we can define
specific dimension to do the calculations. Here we have a list of all dimensions that we
have inside the view, and you can go and select
what the scope going to be, whether it's going to
be the subcategory, or the year of order dates. Then each function that we
have has more specifications. For example, here, what are the values that are relevant
for this calculation? Again, don't worry about it.
I'm going to explain how the difference works
as well in Tableau. So here we do have to
define whether it's brevious next, first, and so on. So each function in Tableau
has different options. So for example, if you go to the rank, you will
find over here. We don't have now those
previous nicks and so on. But instead, we have
different options to configure the rank. So each table
calculation function here has different set of
options to be configured. All right, so that's
all for this method. As you can see, we
got more options compared to the first one. Let's go and close this. And let's say that we
are entrusted to have this calculation for
all other worksheet so we want to reuse it. To do that, we're going to
go to our measure and just drag and drop it on the
data in and with that, we got a new calculated field. This time we are using
the rank of sales, so I can go and rename
it Tran and sales. And with that, we got a
new field on our data ban and we can reuse it in different worksheets.
All right, yes. Now we can move to
the last methods in how to create table
calculations in Tableau. We're going to go and create a new calculated field
and use functions. Let's go and do that. We will start with the function index. Let's create a new
calculated fields. We can call it index, and the syntax is very simple, start with the index
and that sets. We don't need to specify
anything for this function. So you can see the
calculation is valid. Let's click, and with that, we've got a new measure,
new calculated field. Let's go and check the results. So I'm just going to drag
and drop it on the view. So what this function
does is it's going to return the position number
of the current value. That means the first
position in this view can be the first row as we are
moving from top to bottom. This can be the
position number one, position number two, three, four, and so on. Until we get the last value as
the last position. Now you might notice that we are calculating all the
rows in the table, so we are using the
scope of the table. We can check that if we go
over here to our measure erratically and we can see that the comute using
is the table down. Let's say that we
would like to have an index for each group,
not for the whole table. So let's go and switch
it to the pin down. Now, as you can see, the
calculation is going to depend on the pain,
not the whole table. For the first group,
we have the first row. PoCses then the second
third fourth and so on, then it go and reset
for the second group. So on the second
group, it's going to be this row going to
be the number one and the last position or the
index in this group going to be the supplies and not
the last one, the fonts. So as you can see
it always reset for each group because we have specified the scope
only for the pain. Now, if you go and
switch to the cell, so let's go and do
that commuting using cell, you can see that each cell is going to
be the first value. So the position number for
each row going to be one. So this is how it works with the scoping in
tableau. All right. So now let's go and switch
it back to a table. So computing using table down. So as you can see,
it's very simple. Let's go and try another
function in tableau. We're going to use this
time the first function. So let's carry it a
new calculated field. We're going to call it first, and the function going to
be as well really easy. It's going to be first, and that's it. It's
like the index. You don't have to specify anything inside the calculation. So the calculation is valued. Let's go and hit K and check the result as
well in the view. So let's try and
drop it over here. Now we can see that to assigning the first row with
the value of zero. And as we are moving
down with the values, as you can see the
numbers are decreasing. Those numbers is going to
be, how many steps do we have until we reach again
the top to the zero. Here, for example, we need three steps until we
reach the first row, and as well here, we have -11 until we reach the top value. So here we have a distance
between each row, and the first row. In tableau, there is another function where it does exactly the opposite. It's going to be the last.
Let's go and try it. Let's go and create a
new calculated field. It's going to be
the last function, not in this tutorial,
can be last, as well, it doesn't need
any fields inside it. That's all. The calculation is valid. Let's go and hit or. Let's drag and drop it
on the view over here. Now we can see that it has exactly the opposite
effect of the first. Table can go and assign the last value in our
view with the zero, and as you are
moving to the top, the values can increase. Here again, we have
the distance or how many steps do we have until
we reach the last values. Okay, guys, we have one more function that is very similar to the last first index where it gives us the position
number of the rows. We have the rank function. Let's go and create a
new calculated fields. We're going to call it rank. And it's start with
the keyword rank. As you can see, we have
five different functions and how to rank the data. We're going to start
with the easiest one, the first one.
Let's select rank. Here we can specify
two things for table. The first one can
be the expression or the aggregate functions. In this view, we have
the sum of sales. Let's go and define
that sum of sales. The second information
that Tableau needs it as an optional, is going to be how to sort
it ascending or descending. If you leave it empty,
table going to use it as a default, the
descending methods. Let's stay with the
defaults. That's all. The calculation is valid. Let's go and hit OK. With that, we've got a new
calculated field. Let's drag and drop it to the
view to check the results. So now we can see that
Tableau goes and ranks, the subcategories based on
the sales, sum of sales. We can see over here
that the phones has the highest sales, and we have it as a rank one. Then the second highest sales, we have it over here as a two
for the chairs. All right. So if you look at those four
functions and the results, you can see that they are very similar to each other right. They're going to define
the position number of the rows using
different methods. Now you might ask, what are the use cases of
those four functions? Well, generally, there
are two use cases. First, we can use it as a
filter in the visualizations, and second, we can use it
in another calculation. For the first use
case, for example, let's go and pick the rank and show it as a filters
to the users, they go and specify,
for example, the top five subcategories
in the visual. You already know that
there are different methods and how to show the top product or the top sub categories
indivisualizations, and this is one methods
and how to do that. Or we might be in a
situation where we have a very big visualizations,
a lot of rows. I would like to
show for the users only the first five rows. Without any specifications
or ranking or anything, we can just go and show
the first five rows. In order to do that,
we'll go to the first and show it as a filters. Let's go and reset the rank. So we can go over here
and define, okay, I would like to see
the first five rows. Or the opposite, we want to
show the last five rows, so we can go to the last
and show it as a filter. Let's go and reset the first. So now we can go over
here and say, Okay, I would like to see the last
five rows inside my view. So this is the
first use case for these very simple table
calculations functions. We can use them as a
filter. All right, guys. Moving on to the second use
case for these functions, I usually use them in another calculations to
generate a reference line. Let's have a quick example. Let's go and create
a new worksheet. We're going to take
the order date to the columns and as well
the sales to the rows. This time, we're going to
have the monss as well. Let's change it
from year to month, I would like to have
it as a part diagram. As usual, I want
to show the labels and as well the colors
from the measure. The task now is to
show a reference line based from the first
value in the diagram. We have the first
value of 21,000, I would like to have
it as a reference in order to compare the
other months with it. We can do that using
the function first, but we have to add it in
another calculations. Now, in order to make it
simpler to see how this works, I'm just going to go and
duplicate this view. Order to make it like a table. Let's go to the show me over here and switch it to a table, and then I'm going to take
the monss to the rows. Now we have a very nice table. I would like now to
have the first value as a new calculated field. I would like as well to add to this view the values
from the first function. Let's go and get
the field that we already created and
drop it on the view. You can see the first row in this table going to
be the January 2018. We have the value of zero, I would like to show now the
sales only for this row. I'm not interested
with the other rows. Only for the first row, we
have to show the sales. In order to do that,
we have to go and create a new calculated field. Let's call it first sales. The logic can be like this. We can check first
function equal to zero. If we are at the first row, as you can see, we have the
zero value, what can happen? We want to show the sales. It's going to be then we
can have the field sales. Otherwise, we don't
want to show the sales. That means we can go and
end the F statements. With that, as you can see, If the position number going to
be zero like the first one, then show the sales, otherwise,
don't show anything. Let's go and take k. And with that as usual, we
cut our new measure. Let's drag and drop it
to the view over here. As you can see table can show the sales only if the
first equals to zero. If not, as you can see,
we don't have anything. With that, we got the
first value in the sales, and now we can go and use
it as a reference line. In order to do that,
we're going to go back to our original sheets, and let's go and add our new calculated field to the details, then let's go to the
axis to the sales. Click on it and add
reference line. The value can be based on
our new calculated field. So let's go and switch it
to the first of sales, and we can go as well and change the label from
computations to custom, and we can say, okay,
this is the first. So that sets, Let's go and hit. Now, as you can see, we got
our new reference line and the value of this
reference line can based always from
the first value. So as you can see, it's
going to be 21,000. So we can go now and compare the other values to
our reference line. And as well, this
can be very dynamic. So that means, for example, let's go and add a
filter to our view. Let's go to the order
date and show the filter. Now what can happen if
we deselect the 2018, the first value going to
be from January 2019. Here we're going to get the
47,000 as a reference line. With that, we can understand the power of table calculations, they are based on
the visualizations, not based on the data source. Anything you change individual, the table calculation
going to react to it, which makes it very dynamic. This is another use case
for those four functions, first last index,
rank and so on. For example, you can go and say, let's make the reference
line based from the last value on the table
so you can go and switch it. That's it for those
four functions.
113. Table Calculations | Running Total: Guys, now we're going to talk
about very important and very common table
calculation in Tableau, it is the running total. The running total is
going to go and sum all the values as they
progress over the time. For example, in this view, we can track the performance
of our business, where we can go and compare the three different
categories of our products, where we can see here
the development or the progress of customers
and as well the orders. In order to quickly
understand whether our business is
growing or declining. Now if you compare in this
view, those three categories, you can see that the
office supplies is growing very fast if you
compare to the two others. You can see using
the running total in our view help us to
understand the progress, the performance of our business. Now let's go and understand how this function
works in Tableau. Okay, guys, how the running
total calculation works, it's going to go
and add each value to the sum of all
previous values. Let's have an example in
order to understandd. We have over here the months
and the sales as well, and we want to build
the running sum. So we start with
the first value, so we are currently
at the first row. And since we don't have any
previous sum of values, it's going to be
exactly the same value. The calculation is going to be the current running total going to equal to
the sales value. That means in the output, we're going to get exactly
the same value 2607. Moving on to the next
month to the February. So currently we are at this
level at the sales 523, and the previous running total going to be the old
one from January. Now in order to get the
running total for February, it's going to be simply
adding those two values. So we are adding the sales value plus the previous total run. And with that we will get 2,590. So as you can see,
we are simply adding the current sales with the
previous running value. So let's move to the next
month. We have a new current. We have the 6,422,
and we're going to add it again year to the
previous running total. So we have again
the same formula. And with that, we're
going to get 9,013. So as you can see, we are
just adding the current sales with the previous running
total from the previous month. So we can proceed and progress our table until we
reach the last one, it's going to be
exactly the same. So we are currently at December, and this is our current value. We're going to go and add it to previous running total
from the previous months, November until we're going
to get the last value. With that, we have the final
value for the total run. As you can see, we
build a progress or development of the
sales over the monss. This is how the calculation
of the running total works. Let's go back to Tableau in
order to learn how to create it and build the visualization
using the running total. Let's start to the
big data source and let's go to the broad acts. Here we're going to get
our category to the rows, and then we need the date. We're going to get
the order dates from the table orders and
put it on the columns. We need it as a
continuous month. Right you click on it, and then let's switch it to
this option over here. Now we need the
measures because we are tracking the
progress of customers. We want the count of customers. We're going to go to the customers over
here and let's grab this measure customers count
and put it in the view. Now we're going to go and change the visual from line to bar. We're going to go to the marks
over and change it to bar. So now we have here
the total number of customers for each month. We still don't have
the running total. In order to do that,
it's very simple. We can go and use the
quick table calculations. It is the easiest one. So right click on the
customers over here, and then let's add quick table calculations and simply here, the running total.
Let's go there. Now we can see that
table converted to running totals for
each category, and we can see immediately
that the progress of customers in the office
supplies is the best. As you can see,
it's very simple. What we are missing now is the count of orders,
the number of orders. Let's go and get
our second measure. It's going to be
the orders count. Let's grab it and put it near
the customers over here. But I can see both of the
measures are very similar, so we have to change the
visual for the orders in order to understand the differences between
the two measures. So how to do that, if you
go to the marks over here, you can see we have
three sections. The first one is all. That means anything that I'm going to configure over here, it's going to affect everything,
both of the measures. But since we want to change the visual only for the orders, we're going to switch
the marks to the orders. So let's click on dots. And this tab now,
I'm configuring the running total of the orders. So instead of bar, I would
like to have it as a line. If we go to the
colors over here, we can add this dotted line in order to see the differences between the ncs and I can reduce as with the opacity in
this line. All right. Now the next step, we're
going to go and change the colors because
both of them are blue. So let's go to all and let's
grab from the left side. The measure names. Let's go and put it over
here on the colors. The next thing that
we can do is to merge those two axes for each
category into one. So I would like to
have only one axis. In order to do that,
let's go to the orders, right to click on
it, and here we have an option called dual axis. So what it's going
to do, it's going to merge those two axis into one. Let's go and click on
it. Now as you can see, we've got only one axis
for each category. We don't have anymore of
the split between two axes. So now we have it
only on one view. So now we can see that we've got only one axis for each category. We don't have anymore
of the split between the two measures,
everything in one. We can see that the axes are on the left and on the right. The next step what
we usually do is, but not always is to go and
synchronize those axis. Right to click on
it, and we have here the option
synchronize axis. Us, both of the axes
are at the same level. We can go now and hide the
right one because it is useless to have the
same information twice on the left
and on the right. I will go and hide the
header from the right side. Maybe we can go and get rid of those informations that
we have on the axis, go and edit the x and we can
go and remove the title. So that's it, it's close. I'm just minimizing
the information that we have inside one
view. So that's it. As you can see, now we can track the progress of the
customers and orders by the category using
the function that is very commonly used
the running total.
114. Table Calculations | Difference: Alright, everyone. So,
we're going to talk about the last table
calculation function. We have the difference. The
difference is very simple. It's going to find
the difference between two data points. And there are many use
cases for this function, but the most famous one
is to compare two things, for example, to compare
period to period. A very common one is to
compare the sales or profit month by month
or year over year, in order to uncover seasonity
or psycholical patterns. So now let's go and understand
how this function works. All right. Now in order to understand
how the calculation works. We're going to have the
following examples, where we have the
sales over the monss. In the calculations,
let's say that we are currently at the months May. The current value
can be this value, and for Tableau in order
to create the difference, it needs always two data points. The first one always can
be the current value. In this example, going to be the current sales of MI and
the second data points, here we have more
freedom where we can select which value can be
compared to the current value. In Tau, we have four
different options. The first one we
can go and compare the current month with
the previous month. In this example, we can
compare the M with abre. So if you define it like
this with the previous, Tableau going to
go and simply find the differences between the
current and the previous. Tableau going to go and just
subtract those two values. This is the first option. The second option
that we have is to compare the current value
with the next month. So in this example,
we're going to compare the month of May, the current one, with
the month of June. So Tableau going to
go and simply find the differences between the
current and the next month, and it's going to go and
subtract the values. Now moving on to
the third option, we can compare the current
month with The first month, the first value that we
have inside this table. So that means in this example, if we define for
Tableau, the first, that means Tableau
going to go and find the differences between
the current sales, it can be the sales
of M with the first. So we have it to as January, and then go and
subtract the values. So now moving on
to the last one, I think you already got it. We're going to compare
the current month, the M with the last month, the month of December. So Tableau going to
go ahead and find the differences between
the current value of M with the last value inside the visualizations
of December, so it can go and
subtract the two values. As you can see, we have here four different options in which value we are
comparing with the current. Either the previous value, the next value, the first
value or the last value. That means in Tableau, we
get really great control, which data points can be
compared to each other's. Now let's go back to
Tableau in order to start practicing
for this function. All right, everyone.
So now we're going to go and create a
view in order to compare the sales over
the time over the years. So we're going to go with
the big data source. Let's go to the orders and get the order date to the
columns to have the years. Then we would like
to have the rows, the monss and the quarter. So hold control and just
duplicate it like twice. The first one going
to be the quarter, so let's change the format to quarter and the second one
going to be for the months. So we're going to replace
it as well to the month. Now I would like to make the
tip a little bit bigger, so I'm just going
to stretch it from the rows and as well
from the columns. Now what is missing, of
course, our measure. Let's go and get the sales
and put it in the view. Now we have the
sales aggregated by the monss and spreaded
by the years. Now we have to create
the differences between those years. In order to do that,
we're going to go to our measure, click on it, and this time, we're
going to go use this option to have more
control on the calculation. Add table calculation.
Let's do that. Now we have to
configure a few stuff. First, we have to choose
the calculation type. It's going to be the
difference from. As a default is correct. And as well, computing use, which scope, which
direction we want. So we want the direction
from left to right. We want to compare the years,
which is currently correct. We don't want to compare
the months together. If you want to compare that, we can switch it to table down. So with that we are now
comparing the monss together. But now we want to
compare the years. In order to do that, let's
select the table across, and then we have to specify
for tableau relative to, and here we have
to define one of the four options that
we learned before, so we have the previous
next first and last. Now in this example, we want to compare the current year
with the previous year. So we're going to stay
with the previous. So that means, for example, let's pick this
value of our year. It's going to be the differences between the sales of 2022, January and the year before
with the same month. So it's going to be the
difference between this year and the year of 2021, January. And that's why for the
whole year of 2018, we don't have any values
because in this view, we don't have 2017. We don't have a previous year. It's going to be the first year. That's why it's
completely empty. So that we've created
the table calculations. But as usual, we're going
to go and change the view that we are currently
presenting for the users. What I would do
now, I would reduce the number of years
to only two years. Let's go and apply a filter, show filters, and I would
pick the last two years. I would like to add to the view the total sales for each month. In order to do
that, let's go and grab the sales and
drop it to the view. Now on the left side, we have
the differences in sales, and then we have the
aggregate of sales. Now we can see very easily
where those numbers come from, it is the differences between
those two years. All right. The next step, let's
go and replace those numbers with
visuals with pars. In order to do that,
we're going to take our measures and put
it on the columns. This is the first
and the second. Then let's change the visual
instead of line to bar. Let's go to the marks over here and say we would like
to have the bars. Here, as you can see
all the measures having the same coloring. Instead of that, I would like to change the coloring
of the differences. Let's go to the sum
of sales over here. As you can see, we have the
icon of table calculations. Then let's drag and
drop the sum of the table calculations to the
color by holding control. Let's change the colors
of the first measure. Let's switch the sum of
sales, the aggregations. And go to the colors, and let's pick any color from me,
like for example, the blue. So that's Those
information comes from the total sales from the
aggregate calculations, and this one comes from
the table calculations, and it's very simple to
create and with that, we can go and compare
the years for the sales. Now if you would like to analyze the differences between
those two years, you can see in
January, for example, there's no big
difference between the year 2021 and 2022,
there is like small growth. But if you go, for
example, to February, you can see there
are big differences between the two years we have made a lot of sales
in this month. And another thing to notice
here is that in November, we made less sales
than the year before. So as you can see we can very quickly find the differences between those sales in 2022 and the sales
of the year before. So this is the power of
the difference function. It's going to help us to
compare two things like the years or maybe the
categories month and so on. All right, so that's all
for the difference function in Tableau. All right, everyone. So that's all we have covered the four types of tableau
calculations, and with that, you have learned around
60 different functions in Tableau so that you have enough tools in order
to create new fields in your data source and as well
to manipulate your data. And with that, you
have completed the section, tableau
calculations. And now in the next section, things go to get really interesting where
we're going to go and build around 63 table charts. We're going to start
with the basic charts like par charts, and we're going to progress to more complex charts in Tableau.
115. #13 Section Introduction | Tableau Charts: Jump immediately by start
building charts in Tableau, and we're going to
cover around 63 charts. So let's have sneak peek at some visualizations and charts that's going to be
covered in this course. So you will start by creating some basic charts like
different par charts. We have column draws,
stack par charts. And then after that,
you're going to learn how to create different line charts, and as well, we're
going to have a charts. Then we're going to learn how to combine different
type of charts, like, for example, a bar
chart and a line charts. And moving on, we will be creating different
maps in Tableau, and then you will go to the
next level where you're going to start building charts
like scatterplots, sloppy charts, parble charts, pulley charts, calendar charts. Then after that,
we're going to go to the last level to
the advanced charts. For example, we have
reto charts, waterfall, butterfly or tornado charts, quadon charts, and
funnel charts. So as you can see, we're
going to cover a lot of tableau charts and
visualizations in this course. So not jump in and get started.
116. Multiple Measures in One View: Now, before I start learning how to build charts in Tableau, we have to understand some
basics, like, for example, how to add multiple measures
in one single view. I saw many new Tableau
developers that they get confused on how to add a second measure to
the visualization. Because in Tableau, we
have different places and different methods on how to add multiple measures
in one single view. And here in Tableau,
we have three methods. The first one is to use
individual axes for each measure. The second method is to use
one single shared axis, using measure values
and measure names. And the third one is to
use dual axis in Tableau. Now we're going to
go and learn those methods step by step, and we're going to learn
as well the advantages and disadvantages
of each methods. Let's go. All right, guys. Now we're going to start
with the first methods. We have the individual
axis for each measure. So let's see how we can create it and how it's
going to look like. Let's go, for example,
to our big data source. Let's pick the order
date to the columns, and now in order to create individual axes
for each measure, we're going to drag and drop the measures in the
rows or in the column. For example, we're going to take the sales and put
it in the rows, and let's take as well the profits and drag and
drop it to the rows as well. And now we can see
in our view that each measure has its own axis. So that's why we
call it individual axis for each measure. So we can see for the sales, we have this axis that starts 0-1 million, and for the profit, it starts 0-100 k. And those two axes for
those two measures are completely separated
from each other's. There is no overlapping
or anything. Now, of course, we
have two measures. We can go and add a
third, fourth, and so on. So there is no limitations on how many measures we can
add to our visualizations. So we can see now we
have four measures. And you can see each
of those measures has different axis
with different range. And now, I would
like to understand something very important
in Tableau, that's. Once you are adding multiple
measures to the views, you will get multiple
pages on the marks. The marks in Tableau is the place where you're
going to go and customize the visualizations to customize the charts that we have
over here in our view. And since we have
multiple measures, we will get multiple
pages in the marks. So let's check what
we have over here. So we have the first one is all. Then we have an
individual mark for each measure that we
have inside our view. So now let's understand
how this works. Let's start with the
first one, the all. Now, in this page, anything
that you change in the setup, it can be reflected for all
measures for all charts. For example, instead of having the line, I would
like to have the bar. But now if I change it
to bar as you can see, all the measures can be
changed to bar charts. Or if you go over
here, for example to the colors and change it to
black, you can see that. All our measures now are black. And so on, if you go to
the size, reduce the size, you can see the size of all our measures is
going to be reduced. So anything that I'm
changing in the all, it can be reflected for
all measures in the view. But now, since we have individual
axis for each measures, we can go and customize each of those charts
individually. So for example, let's say that, I would like to change
only the sales. I can go to the max
of sales over here, so let's switch to the
page of sum of sales. And then instead of having bar, I would like to
have it as a line. So now we can see
we have changed the chart type only
for the sales. Everything else can
stay as a bar charts. And the same thing
for the profit, you can go over here to
the profits and say, instead of plaque, I
would like to have it, for example, as blue. So as you can see, this
customization is going to be done only for this measure,
only for the profits. The same thing for
the other measures. If you say okay
for the quantity, I would like to change the
chart type instead of par. Let's go for
something like area. Let's switch the quantity, and then let's go to
the area over here. With that, we have
changed only the chart type for the quantity. You can see those marks
are really helpful in order to customize
our charts, and you can go and do that
individually for measure, or you can go to all
measures over here and then do the changes for
all measures together. So that's all for the marks. They are really
important in order to customize the charts inside
of our visualizations. One more thing that's important
to understand the dots, we have here four taps inside the marks because
we have four measures. Well, because we have
continuous measures. For example, for the years, we don't have any
tab in order to customize the years
because it is discrete. For example, let's go
and switch the sum of sales from continuous
measures to discrete. Right click on it
and go to discrete. With that, you can
see that the sum of sales disappear from the mark. That means we
cannot customize it anymore because it is discrete. Let's go and change it again back to continuous
and with that, we're going to get it
again in the marks. So you can customize only continuous fields.
All right, guys. Now as you can see
for these methods, we can go and customize our charts individually
and as we want. And another advantage
that we can go and add as many measures as we want
inside our visualizations. But the disadvantage that
we have separated axis, which is in some situations, it's really hard to
compare the measures together if they are
like split like this. That's why we have tablo
different methods in order to combine and to merge the axis
and the charts together. So that's all for the fat
methods where we're going to have individual axis
for each measure. All right, guys, moving on
to another method in order to combine multiple
measures in one view, and that is by sharing
the same access. We can do that using the measure names and
measure values. If you take the data pane in
each data source in Tableau, you will find always two fields. We will have always measure
names and measure values. Those two fields, the
measure names and values, they are automatically
generated from Tableau. They don't come from the
original source of your data. So what are those fields? The measure names is a
discrete dimension that contains the names of all measures that you have
inside your data source. In the other hand, we
have the measure values. It is continuous
measure that contains the values of all measures that you have inside
your data source. In table, there are two ways in order to use the measure
names and values. The first one is by simply just drag and drop from the
data base into the view. Let's take for example, the
measure names to the rows. As you can see, currently, no measure values are selected because we don't have
anything in the view. Now, what we're going to
do, we're going to go to the major values and let's drag and drop it to
the text over here. And now you can see in the view all our measures that we have
inside of our data source. So the count of customers, count of orders, discounts, profit, sales, and so on. So those are all
available measures that Tableau can find
inside your data source. So here, again, the major name going to be the name
of the measure. The count of customers,
count of orders, those information comes
from the measure names, and the values of those measures going to come
from the measure values. You can see, it's very simple,
the names of the measures, the count of customers,
discount and befit. Those names come from
the measure names, and the values that
we have inside this view comes from
the measure values. So here you can control stuff. For example, you
can go and remove any measure that you don't
want to see inside our view. So for example, let's go and remove the sum of unit price. So just drag and drop
it somewhere outside. And as you can see, tcated
immediately filter. So if you go over here on
the filters and edit it, you will see a list
of all measures that we have inside
our data source. And as well, if you want to
remove some measures you can go and deactivate or deselect the measures that
you don't want to see, inside our view, let's go
and hit ok. And with that, we have reduced the number of measures inside
the view two four. And one more thing
that we can do over here that we can go and change the sort of the
measures inside our view. So for example, let's
take the count of customers from the top
and put it in the bottom. So you can see, we just change the order of the measures
inside the view. Alright, so this is
one way in order to use the measure
names and measure values inside the visualizations by just drag and drop
them inside the view. But there is another
quick way in order. To use those informations.
Let me show you what I mean. I'm just going to go
I remove everything from our view and then
starts from scratch. Let's take the order
date to the columns, and let's take, for example, the sales to the rows. So far, we have
only one measure in our view, everything is normal. But now, let's say
that, I would like to add another measure to the view. Before we learn that, we take the profit and put
it near the sales. But with that we have
learned that table can go and create two
individual axes. We don't want that, so
let me just remove it. I would like to have one axis
for both of the measures. So in order to do that, we can use the measure
values and names. And in order to
quickly generate that, let's take the profits. Very slowly, let's just drag
it to the axis of the sales, and as you can see, now,
Tableau go to show us, two green vertical lines. So with that, we are telling
Tableau that I would like to share the same axis for
two different measures. So let's just drop
it on the axis, and here Tableau going to
go and convert everything. So we don't have anymore
here, the sum of sales. We have now the measure values. And in the filters, we
have the measure names, Inside it, we will get only
two measures and the sales. So you can see Taplic
prepare everything for us, and this is a quick
way in order to use multiple measures using the measure values
and measure names. And we can see as well here on the measure values that we
have only those two measures. So now let's check the visual. As you can see, we have only
one axis for two measures. So the green one going to be the sales and the gray
one can be the profits. So that means those two measures are sharing the same axis. And of course, we can go and add more measures to our view. Not only two, we can take
for example the discounts. We can go and drop it inside the measure
values to the last one, for example, and with
that, we got three lines. Three measures are
sharing the same, axis. So it's really
nice and compact way in order to compare multiple
measures using the same axis. But of course, you have to pay attention to the
scale of the axis. For example, the
scale of the sales, as you can see the green one
is really huge 0-1 million. Now, if you take the discount, as you can see everything
like almost zero because the scale compared
to the sales is very small. That's why for these methods, it makes sense to use
multiple measures in the same axis if they have
a similar scale of data. But if there is big
difference in the scales, the visual will not make sense in order to
compare to measures. This example doesn't
really make sense to use the discounts inside
these visualizations because we cannot
really compare it. It has really small scale. One more disadvantage of this method that if you
check the marks over here, you can see that we have
only one tab for everything. We don't have individual
marks for each measure. That means we cannot go and customize each
measure as we want, like we saw before
in the method one, where we want to use in
one case, for example, the line diagram
and another measure we can use the bar
diagram and so on. We cannot go and customize
individually each measure. But instead, all
those measures are sharing the same setup
for the visualizations. That means, let's go for example and go and change the sides. If we do that, it's going to affect all measures
inside the view, and I cannot change
it individually. Everything that you are making here or changing individual, is going to affect
all the measures. For example, let's go and change it to par diagram and so on. The only thing that
you can go and customize is the colors. If you go to the colors
over here and edit colors, you can assign for each
measure. Different value. But that's all, so we cannot go and customize the
charts as we want. If you use measure values and measure names, pay attention, you don't have the freedom of changing the visuals
of your charts. But it's still very
useful in many cases, where you want to have
multiple measures sharing the same single axis. All right. So with that, I
hope it's more clear now, why do we have tableau measure
values and measure names? Okay. All right, one. So now moving on to the
last methods in order to compine multiple
measures in one view. We can use the dual axis. Dual axis are really great
way and very useful in many scenarios where you can go and compare two
measures together. So let's see how this
works in Tableau, and there are two ways on how to create dual axis in Tableau. The first one I'm
going to show you now is that let's
take, for example, the order date to the columns, and then let's take the sales
and formations to the rows. And now, I would
like to get another measure inside our view. So let's take the profit
and just put it in the rows side by
side near the sales. So here we are back
to the method one. Where we have two measures separated with two
individual axis. Now as you can see,
those two measures are separated from each other, I would like to bring
those two visuals on top of each other's. So how to do it? Let's
go back to our measures. Yes, you can see we
have two measures, sales and the profits. We're going to go to the profit to the one on the right side, right you click on
it, and here we have the option of dual axis. Let's go and click on that. Now, as you can see, those
two charts now are on top of each other's
using dual axis, the access for the sales and the axis of the
profits side by side. And we can see as
well, the shape of those measures the change. So now instead of
having two green pills, we have now one green
pill from two measures, the sales and the profits. Now if you check the
scales of those dual axis, you can see that the sales
as usual 0-1 million and the profits 0-200 k. Now
here you have two options. Either you can leave
it as it is with two different scales or you can go and make them
similar to each other's. And this is what we do
in most situations. We go and synchronize
those two axis. In order to do that, let's go to the profit over
here on this axis, right click on it,
and here we have the option of synchronize axis. Let's go and select that.
As you can see now, the profit scale has exactly
the same scale of the sales. It starts 0-1 million. The marked or the visual did adjust as well to
the new scales. So as you can see now, we
have it on the bottom before, we had it near the sales. Now you might ask you know what? Why do you use dual axis? I can just go and use the mejor values
like the method two, and I can add as many measures
as I want to the view. So why do we have dual axis? Well, there's two
reasons for us. First, here you have
the option to decide whether you want to
synchronize the axis or not. So if you go to the method
one with the mejor values, you can see that everything is synchronized and you
have only one axis. And we cannot change that. But if we go back
to the dual axis, we have always the option to
synchronize the axis or not. So this is one benefit. The major benefit of
dual axis that I can go now and customize
each measure as I want. So if you check the marks, we have again a tab
for each measure. So again, the all going to customize both of the measures. But if you go to
the sum of sales, we can go and decide the
visual setup of this measure. So for example, I can go over
here and change the size, or I can go to the sum
of profits and say, instead of the line diagram, I would like to
get a bar diagram. So here is exactly
the advantage of the dual axis where we can go and customize the
chart or the measures, individually, but still
using the same axis. And you don't have
this option if you are using the measure values because you have
to make a decision or a setup for all measures. But that disadvantage
here that it's dual axis, only two measures. But it's still a
great way in order to compare two
measures in Tableau. I would like to show you now
the second method on how to create quickly dual
axis in Tableau. So let's go and
remove those stuff, and then let's take
again the sales. Now for the second measure, instead of dragging
and drubbing it here near the sales and
then switch it to dual. What we're going to
do we're going to go to the visual over here, and if you move it
to the right side, you can see that we
have one vertical line. Be careful if you
move it to the axis, you have two vertical lines
where you're going to have the mejor values and mejor
names. We don't want that. We want a dual axis. So just move it to
the right side, the opposite side of the axis, and you can see we have
one vertical green line. If you drop it, tableau
going to go and create immediately dual axis
between those two measures. So this is how you can create dual axis and tableau quickly. And one last point about
the dual axis is to understand the order of the measures has an
effect on the visual. So let me show you what I mean. I'm going to go now to
the profit and change it from bar diagram
to line diagram. And as you can see, the red line from the profit
is like in front, The sales. So that means
the major sales is in the back and the
profit is in the front. If you want to switch
that individual, what you're going to
do, you just going to switch the order
of the dual axis. So if we take the sales
from left and just put it on the right,
and as you can see now, the par diagram in the front and the line diagram
in the background, which in this situation,
it's not really cool to have the line
behind the parts. So now let's go and
switch it again, so the profit on the right side. So that we're going to get it in the front and the
sales in the back. All right, so that's
all for the dual axis. Now, of course, lo
you can go and mix all those methods
together in single view. So here we have dual
axis in this example. I can go now and add the measure values
instead of the profit. So instead of
having the profits, we can have the measure
values, the method two. In order to do that,
let's take for example, that quantity, and let's track and drop it on
the axis of the profit. So let's drop it over here, and as you can see
table immediately switch the sum of profit
to measure values. But still on the left
side, we have sales. So now we are doing a dual axis between the sales and
a bunch of measures. So now we can go and add more measures to
the measure values. Let's take the unit price
and add it over here. We can add the discounts. But now let's just change the colors in order to
make it more clear. So now I am at the tab
of the measure values. Click on the colors, it colors. And now the quantity,
I'm going to give it green. Unit price. Let's give it gray discounts. Is color and that's all. So with that as you can see,
we have different lines, but all of them are lines, we cannot change that
because it is a major value, so all of them are
sharing the same setup. And on the background, we have the sum of sales
from the dual axis. So that means you can go
and combine those stuff. And of course, we can go
and add the method one. So let's take the count of the orders and just drag and drop it to the
rolls over here. So with that you can see that
Tableau did go and create an individual axis for
the count of orders. So that means if you look now to our measures and this view, the first one, the sum of sales, we are using the dual axis, this par, diagram, the blue one, and then on the right
side of the dual axis, we have punch or
bundle, of measures. So here we have the sum of profit quantity unit
price and discount. So we have a group of
measures as a part of the dual axis using
the measure values. Count of order, it is completely separated and not sharing
the axis with the others. So we have it as
an individual axis using the method one. All right. As you can see,
you can mix stuff, and this is exactly
the power of Tableau, where we have high
customizations on how to visual our data. Okay. All right, everyone. So now let's have
a quick summarize. In order to combine multiple
measures in single view in single visualizations in Tableau, we have three methods. The first one is to
use individual axis. That means we can
have for each measure a different separated
independent axis. And the advantage of this
method that's we can go for each measure and decide
about the visuals, which visual type we can use, the colors, the
sizing and so on. So. The customizing of the measures is going
to be independently. And the second benefit of that, we can go and add
as many measures as we want inside one view. But the weak point in
this method of that, it's really hard to compare
those measures together. That's why we have
the second methods where we can go and compare all those measures together using one shared or single axis. And we can create
such a visualizations using the measure names
and the measure values. So we have only one
axis and we can have multiple measures
sharing the same axis. Well the main benefit of our that we can add as many
measures as we want, and as well we can compare those measures better
than the method one. Since they share the same axis. But the disadvantage in this
method that we cannot go and customize each of those
measures independently. So that means all those
measures are going to share the same configurations
of the visualizations. So we cannot use here a line then a part then
change something else. We have always to use
the same visualizations. For all measures. And
that's why we have the third method tableau
to use the dual axis. So the main benefit of
the dual axis of dots, we can compare two measures
closely to each other. We can define whether we can
synchronize the axis or not. And here, the advantage
compared to the previous one, the single axis of dots, we can customize the visuals for each measures independently. So here we have a line diagram together with a bar diagram. Only disadvantage of
this methododots we can compare only two measures.
All right, guys. So that was the different
methods on how to add multiple measures in one single view and
when to use them. Next, we're gonna start
building basic charts, and first, we're gonna
have the par charts.
117. Bar Charts: All right. So now we're going to start
with the easy stuff where we're going to build
a bar chart in rows. So let's start with
the big data source, and let's take the sub
category to the rows. And then we need to measure. Let's take the sales and
put it in the columns. Now with that we got
the sales by category. Now in order to make it bigger, I'm just going to go over here. Instead of standards, let's
take the entire view. Now as you can see, we
have bars in the rows. Table can use bar
chart as a default, but in case you have
something else, you can go to the
marks over here. Instead of automatic, you
can move it to a bar. Let's go and click on
that. Nothing going to change because currently
is a bar chart. And we usually use
the bar charts and rows in order
to make ranking. So in order to do that, let's go to the sales
and sort our data. So with that, we got a very
nice ranking in our charts. One more thing that I
usually add is the coloring. So I take the measure,
the sum of sales, holds control, and
put it on the colors. All right, so that's all
for the bar charts and rows. Okay. The next one we have the
bar charts in columns. It's very easy and very
similar to the rows. I just duplicated
the worksheets. Now here instead of having
the dimension on the rows, we have to move it
to the columns. So we have to switch between the measure and the dimension. In order to do that,
it's very simple. Let's go to the quick menu
over here and just switch it. What that we got the
pars now on the columns. And see it's very
simple, we usually use this as well for ranking. Of course, now the
question is when to use columns and
when to use rods. If you have dimensions with low cardinality like we
have the subcategory, you can go and use the columns. But if your dimension has a high cardity, a lot of values, you can go and use the rows in order to have a long list
and you can scroll down. It's always better
to scroll down than to scroll to
the right sides. If you have a lot of values
inside your dimension, go with the bar rows. But if you have low number of values inside your dimension, go with the column bars. Alright, moving on to
another parch chart, we have the side by side parts. In the previous part charts, we have used only one dimension. This time we're going to
go and use two dimensions. So let's go and build it. First, I would like to get the dimension country
to the columns. And then let's go
and get our measure, the cells to the rows, so that we got the
normal part charts. But now, if you go and add another dimension
to the columns, you will get side by
side part charts. The second dimension going to be the years of order dates. Drag and drop the order
dates to the columns. As you can see, tau d
converted to line charts. We don't want that.
We want bar charts. That's why we go to the marks over here and instead
of automatic, we're going to
switch it to bars. Again, here, I would like
to make it entire view. Now we have a lot of
data inside the view, so we have five years of data. I would like to have
only two values. I would like to compare
the last two years. Let's drag the years
to the filters. Then I'm going to
filter using the years. Select the years next. And let's have only
the last two years. Click OK. And the last thing that I would like to
add is the coloring. Since we have two years, I would like to have for
each year a color. So let's take the years, hold control and put
it on the colors. And that's it we have now really nice separations
between the values. So now, as you can see,
we've got side by side bars, and it's really
useful in order to compare multiple values
in each category. So with that, we
can really easily compare the last two
years in each country. And here in this type of charts, try to not have a lot of data. Then it's going to be really
hard to compare data. So as you can see, we
just have a filter on the data in order to compare
only the last two years. So that's it for the
side by side charts. All right. Moving
on to the next one, we have the bar chart over
time. It's a very famous one. You can find it almost
in each dashboard. So let's see how we're
going to build it. We're going to go
to the order dates. Let's put it on the columns. As usual, we're going
to have the years. Let's go and get our measure the sales and put
it in the rows. And here as a default table
to show it as a line. Let's go and switch it to the bars since we are
working on the bar charts. So with that we got very nicely
the sales over the years. But we usually add more details because those
data are very aggregated. So let's go and add another. Date dimension in
order to do that, let's just drill down the years. Click on this plus sign, and with that we got the
second dimension, the quarter, and here we can see more details about how the sales are
changing over the time. The main use case of this
part chart is to show how the data are changing
over time, to show trends. If you have such a requirement, go with the part
chart over time. Okay, moving on to the next one, we have the stacked bar charts. The requirement for
this one is going to be similar to
the side by side. We can use two
different dimensions. So now let's go and build it. I would like to see
the total sales of each month for this year. So in order to do that, let's take the order date
to the columns, and let's take the
sales to the rows. And now I'm going
to go and switch the years to months,
right click on it, and let's select the formats, the month so that we
got those parts that represent the total sales for
each month and this year. But now, we'd like to
add more information to this view in order to compare
as well, the categories. So now let's go and
get the categories, but here is always the question where we're
going to place it. If you put it on the columns,
what you're going to get, you will get side by side
bars. We don't want that. We want to get stack charts.
In order to do that. Let's take the
category and put it just on the colors. So
let's go and do that. And with that, we got
this information, this dimension as a
color inside each bar. And with that, we're going to have the stacked bar charts. So now, as you can
see, the main purpose of the stacked bar chart is, First, to have the total
of sales over the time. So we can compare the months and how the sales are
developing over the time. Then the second task, which is not the main task is to go and compare
the categories to see how the categories are contributing in the total
sales of each month. So that's all for the
stacked bar charts. Alright, now we
have a very similar chart to the previous one. We have the full
stacked part chart, or sometimes we call it,
100% stacked part charts. So now I just dublicated
the previous one, and as you can see in the
normal stacked part charts, each part starts and ends differently
from month to month. Total sales is naturally
important in the charts. What is important is now to compare the subcategories
over the time. Very nice way in order to do that is to have
full stacked part. That means each part in our visualizations can has
exactly the same length, and it starts from 0% to 100%. In order to do that, let's go to the sum of sales,
right you click on it, and then let's go
to the quick table calculations and
have the percent of A that we got the percent of total instead of the
total sales as a value, but we're still
not there because those parts are not
having the same length. In order to do
that, let's go back to the sum of sales
right click on it, and let's go to edit table
calculations. Let's go inside. Now, what we're going
to do over here, instead of having table across, we can have specific dimension. Let's go and switch on that
and we're going to select only the category since we are focusing only
in the category. Let's remove month
of the ordered date. Now as you can see, we get
immediately a full stack. Let's go and close this. Now as you can see,
all those parts has exactly the same length. They all start with a 0%
and end up with a 100%. We call this type of
chart as part to whole. That means I would like
to see and understand how each category are related to the whole sales
of each month. Now let's quickly summarize
when to use which chart. If you want to focus on comparing the categories
over the times, then go with the full
100% stacked bar charts. But if it's more important to show the total sales
of each month, then compare the categories, then go with the normal
stacked bar charts. All right. Moving on to
the last type of bars, we have the small
multiple bar charts. Many bar charts inside
our visualizations, and we can do that by adding
more than two dimensions. So let's start with
the first dimension. We're going to go to the
countries from the data pane. Let's put it in the columns. And with that we got the values of the countries as columns. I would like now to add
rows from the category. So let's get the
second dimension, the categories to the rows. And now I would like to
fill those informations in order to see some data. So let's go and get our
measures, the sales. Drag and drop it to
the rows over here. So now as you can see, our
bars are not really small, so still we have big
parts inside our view, and always we can go and check how many marks or how many bars do we have inside our view. By checking this
information over here, we can see that
we have 12 marks. So now let's go and get
our third dimension. It's going to be the order date. Let's get the order
date to the columns. Now we went 12-16 marks
or 16 data points. Now, Tableau switch it to lines. I would like to bring
it back to bars. So let's go to the marks,
switch it to bars. But still our bars are
not really mini or small. So in order to go more in
details inside our view, instead of using the years, we're going to go
with the month. So let's go and
change the format, right click on it, and
let's choose this format, the continuous one, the month. Now, if you check again,
we went 60-707 marks. Mini bars inside our view, I would like to add as
well some coloring to it. Let's go and get the
country to the colors. So that's it with that. We got
small multiple bar charts. As you can see, as you are adding more dimensions
to the view, you are splitting the measure
to more and more details.
118. Bar-in-Bar Chart: Okay. Next, we have
the bar in bar chart. Previously, we have compared two dimensions inside our view, but now how about to compare two measures in our
views using bars. So let's see how we can do that. As usual, we're going to take our subcategory to the rows. And then let's take
the first measure. It's going to be the
sales to the columns. So now with that we got
our standard bar charts. Let's go and sort
it by the sales. Now we need our second measure. So let's go and take the quantity and put it
as well in the columns. So now with that
we got individual axis for each measures, and we can go and
compare the data. But it's way more better if you have two measures and
you want to compare them is to use the dual axis as we learned before in
the previous material. So let's go and
use the dual axis. We're going to go to the
quantity erratically con it, and let's go to the dual axis. Now, here Tableau did decide to go with other visualizations, since we have automatic. Instead of that, I would like to switch it back to
bars, and as you know, the dual axis, we will get different tabs inside our marks. So now since both
of them are going to be bars, we're
going to go to all Then select instead of automatic, we're going
to have the bars. But now you can see,
we are not there yet. It's like the stacked part, but actually it's not stacked. In order to change that,
what we're going to do, we're going to go for
each individual measure and change the setup. But first, I would like
to change the coloring. I don't like those
current informations. Let's go to the quantity, make it orange, the
sales going to be. Blue? It's okay. So now, what we're going to do in
order to have bar in bar, we're going to go and change
the size of the quantity. So let's go to the
quantity over here. Go to the size and just make
it a little bit smaller. So now we can see
in the background, the big blue bar,
and in the front, we have this small orange bar. So with that we got something
like bar in bar chart, which is really great
in order to compare? Measures using dual axis. So, if for example, if you
check the category art, you can see the quantity
is really huge, but we are generating
very few sales. Compared, for example,
to the cubres, we have less quantity
that is ordered, but we have huge sales. So it's really nice way in
order to compare measures.
119. Barcode Chart: Alright, the next one is
going to be fun one where we're going to create
barcode charts. We usually use it in order to show more details
inside each bar. So let's see how we can do that. As usual, we're going to
get the same information, subcategories to the rows
and sales to the columns. I think you already got
it. Let's go and sort it. And now, what I would like
to bring is a dimension with high cdonalty
like the product name. So let's go and bring it, for example, to the
rows over here. As you can see, Tableau
is warning us and telling us there's a lot of members
inside the product name. And now, if you
go and say, Okay, add all members,
what can happen? The view going to be broken, and it's not really informative. But instead of that, we can take the product name and
put it on the details. So let's go and do that. And now with that we have
built something like barcodes, where we have the product
informations inside each bars, which is sometimes
useful to show all those details in one view. So that's how you
build barcode charts.
120. Line Charts: Alright, so now we
can start talking about the line
charts in Tableau. There are very basics and very standards in order to
show the change over time. So now let's go and build very simple line
chart in Tableau. Since we are saying
change over time, that means we need a date. Let's go and get the order
date to the columns, and the roads we need our
measure sum of sales. Now as a default as usual, Tableau going to show the years. But instead of that, in order to make it
more interesting, we're going to go and
switch it to months. Let's go and change the format to month continuous,
click on that. And now with that, we
got our line charts. For some reason at your end, you are not getting
a line charts. In order to switch
to line charts, we go to the marks, and then instead of automatic, let's go and choose the line. Once you do that, you will get exactly like by
me, a line chart. This is the most
basic line chart in Tableau that shows the
changes of our time. Okay, so next, I would
like to show you the different visuals that
we can add to our line. So for that, let's get
more measures to our view. So currently, we have
the sum of sales. Let's get everything like
the discount, the profits. And we have order sales. Let's take the unit price, and as well, the orders. So now, as you know, since we have five measures in our view, we get as well five
tabs in the marks in order to individually
set up the visual. So for the sum of sales, we go to leave it as it is
as a standard line charts. But for the next one,
what I'm going to do, we're going to change the path
or the visual of the line. So if you go over here on
the pass and click on it, we will get different
types of lines. So the first one going
to be the standard one, the linear, but the second
one going to be a step. So let's go and select dots. So now if you check the
discount over here, we don't have a linear
charts like the sales. We have now like steps, like it's chump up, and
then we have steps down. Alright, so let's move next
to the profit over here. So let's switch the
tab to the profit. So now we can go
again to the path. And here we have two sections, the line type and
the line pattern. So in the line pattern, we have the solid line or we
can make a dashed line. So let's go and
select the dash line. And as you can see
now, individuals, we have very nicely, dash line in Tableau. So this is one more way in order to present the lines in Tableau. Let's move to the next
one to the next measure, we have the unit price.
Let's switch there. And now we can do over here for each data point that
we have in the charts, we can make a marker
or like small circle. So in order to add the markers,
what we're going to do, we're going to go to
the colors over here, and then here we
have the effects. So the first one is automatic. The second one to have marks and the last one
to have no marks. So let's go and switch
everything to marks. And now with that, you
can see the line chart in the hung price has like small
circles, small data points. This is one more visual effect
on the lines in Tableau. Let's move to the
last one, the count of the orders, so
let's switch there. Now, what we can
do, we can change the size of the lines
depends on the values. In order to do that, let's
take the count of orders, so it's control drag and drop
it and put it on the sides. Now if you take the last line, we're going to see
really nice effect. If the values are small, we will have a thin line, but if the values are high, we will get a heavy line. Which really looks nice. All right, guys. As you can see, Tau is very rich in
the visualizations, and with few clicks, we can change the visual
representations of the lines. Alright, now we're
going to build the multiple line chart in Tableau. I'm always duplicating
the sheets in order not to build everything
from scratch each time. So now previously in
the standard line, we can see the
changes over time, but sometimes we want to
add more information. We want to compare the values of one dimensions inside this view, and we can do that by
having multiple lines. So let's say that,
I would like to compare the values
inside the category. Let's go to the categories in our bots And now let's
put it on the colors. So drag and drop
it to the colors. And as you can see
by doing that, Table can go and
plot three lines for each value inside
this dimension. So with that we got multiple
lines inside one view. And now we can see
that it's not really informative because we
have a lot of lines and a lot of zigzags in order to reduce that we're going
to switch the format, Let's say, for
example, a quarter. So now, it's a little
bit more clean in order to see how the data are
changing over time, and you can compare the
values of one dimensions. So the number of lines
really depend on the values inside
this dimension. One more thing about how to
create those three lines. You don't have to have
it always on the colors. If you move the category from the colors and put
it on details, you're going to get the
same effects where Tableau going to go and create
multiple lines for each value, but this time without colors. So this is another method on how to create different
lines in tableau, but I think it makes
more sense to have it on the colors to have subverted
color for each line. So this is how we can
create multiple lines in Tableau using dimension. All right. The next one, we
can have dual line charts. This time we're going
to go and compare two different
measures in one view. So we're going to create
for each measure one line. So now I'm going
to stick with the same view where we have the sum of sales and the quarter
for the order dates. So now, we'd like to
compare in this view, two measures, the sum of
sales and the profit. So let's take the profit and put it side by side by the sales. And with that, we've got two different lines
for each measures, but I would like to have
it on top of each other's. So in order to do
that, we're going to go and use the dual axis. So let's go to the profit, right click on it,
and here we have the option of dual axis. With that, as you can
see, it's very simple, we've got a dual line chart, and here you can add more stuff. For example, you can
go and synchronize those two axes by going to
the bfitRd click on it, and here, we can go
and synchronize it. Or of course, we can go and
set up each line differently. Let's go to the
buf it over here, go to the path, and let's
make it a dash line. As we learn briefously
using the dual axis, we got the freedom of changing the visual of each
measures individually, and this is a
really great way in order to compare two measures. Okay, moving on to the next one, we have the cumulative
line charts. So currently in the
standard line charts, we are using the month
and the sum of sales, and we can see the total
sales for each month. But sometimes we would
like to understand how the thing are developing
or growing with the time. So now if we want to see
the growth over time, we have to use a
cumulative line charts. In order to do that, we're going to go to the sum of sales. And instead of having sum of sales as aggregate functions, we're going to go and create
quick table calculations, have the running total. Let's go and switch dots. As you can see, we're going to get very nicely
cumulative line charts, where you can see how the things are growing over the time. But of course, to make
things more interesting, we're going to add more
information to our view. Let's go and get the category and generate different lines. So we can drop it on the colors. Now we can see how the
different categories are growing over the time. What we can add as well to the cumulative line is the
ending point of each line. In order to do that,
we're going to go to the marks to the labels. Click on the labels
show Mark labels. But as you can see, we
have for each month, one label, we don't want that. We want only the
ending of each line. So in order to do
that, we're going to switch it from all to line end. So now if you check our lines, you can see at the
start and at the end, we have this information, but the starting point is
not really interesting, so we can go and disable it. Label start of line, let's go and disable it. And with that, we're going
to have the total sales of each category at
the end of the line. So with that, we
can go and analyze the growth over time
for each category. Okay, now we're going
to go and create small multiple line charts. As we've done for
the bar charts, we're going to do it
now for the lines. So now what we're going
to do, we're going to bring at least
three dimensions to the view in order to break down the sales to smaller lines. So let's go and do that.
We're going to get as usual, the order date to our view. Let's get the sum of
sales to the rows. And then we're going to
get another dimension, the category to
the rows as well. So as you can see now, as we
are adding more dimensions, we are splitting the lines. Let's go and get the countries and put it as well
to the columns. Now with that we've
got more charts, but Table going to
show it as bars. Since we have it as automatic. So let's go and
switch it to lines. And now we have it
as a discrete line. Instead of that, let's
get a continuous line. In order to do that,
let's go to that date and switch it to something
like the month as continuous. So let's change the formats. And with that, as
you can see, we get very interesting
multiple line charts. And I would like to add
the colors as well. Let's go and get the country, for example, and add
it to the colors. Now just to enhance the visual. Let's go and remove the grid. So right click over here, and then let's go to formats. Then we can go over
here to the lines, and then we have the row tab. So let's go to the grid
lines and move to none. So with that we removed
those grid lines, which is really annoying
to have a lot of them. And then the last thing
that we can do with that, we can have the total
sales of the last point. In order to do that, let's
get the sum of sales, hold control and boot
it to the labels. And then we're going to go
to the labels over here and let's select mean max. We're going to have
it by the order date. So let's switch from
automatic to month, and let's have only
the maximum value. So let's remove
the minimum value. So with that we
got for each chart like the total sales
for the last month. So with that we have
created very nice, small, multiple line
charts in Tableau.
121. Highlighted Line Charts: All right, moving
on to the next one, we have the highlighted
line charts in Tableau. This is especially
important if you have multiple lines in
one single view, and there's different
methods on how to do it. I'm going to show a quick
one and a professional one. Let's start with the quick one. Let's have multiple
lines in our charts. I'm going to take
this time the country and put it on the colors. With that we got one line for each value inside the
country dimension. I would like to give
the ability for the users to highlight
one of those values. In order to do that,
it's very simple, go to the country over here, right click on it, and let's
go to the highlighter. So here we have the option
of show highlighter. Click on that. So that, if
you check the right side, we're going to get
smallpox in order to highlight the values
inside the countries, so the users can go over here and select one
of those values. For example, Germany,
and as you can see, Tableau can go and
highlight the line of Germany and it can
appure all other lines. This is really nice way in
order to go and highlight different values in Tableau in order to focus on one value. This is really great
way in order to go and highlight one line, especially if you have a lot of multiple lines. That was it. This is how you can create quickly a highlighted
line chart in Tableau. All right, so now we're
going to talk about the second method on how to create highlighted line chart, but this time more
professionally. So now I just duplicated the old line chart where
we have the quarter, some of sales and the
countries on the colors. But this time,
we're going to get rid of this highlighter, so I'm just going to
go and remove it. Now we have to give the users a list of all
countries in order to select and this selected country going to be highlighted
in the view. In order to do that, we're going to go and create a parameter. So let's go to the data
pant a click over here, then create a parameter. Here we're going to give
it a name, select country. Since the country
values are string, the data type can
be as well string. Now next, we're going to
go and create a list of all countries that we have
inside the dimensions. So here we have four values. We have France. Be careful
that we have exact case. So the first character is capitalized and
the rest is small. So we have Germany, Italy, And the last one is USA. That's it for our parameter.
Let's go and hit. So that we got our
new parameter on the left side ticly connect
and show parameter. In order to see it here
on the right side. Now the users can go over here and select one of
those countries. But as you can see, nothing
is changing in the view because we haven't
connected yet to our view. Now, in order to
connect it to our view, we have to go and create
a new calculated field. Let's go to the data pin again. Create calculated fields. Let's call it
highlighted country. And here we can have a very simple condition
where we're going to say country, equal
our parameter. So our i going to
be select country. So here what we are saying is that if the selected
country from the parameters equals to the value of the country, then
we're going to have true. Otherwise, it's
going to be false. So for example, now
we currently we have the value of France
selected in the parameter. That means the country
France is going to be true and all other
countries can be false. Let's go and hit OK. So now we're going to go
and work highlighting the selected country. In order to do that, let's
start with the coloring. So currently, we have the
coloring on the country. I'm going to go and
move it to the details. So that means now the
countries are just creating the lines and not responsible for the coloring of the lines. Now, in order to
bring the coloring, we're going to get our
new calculated field, the highlighted country, and
let's put it on the colors. So now you can see that we have only two colors because
we have false and true. So if it's true, it's
going to be orange. If it's false, it's
going to be blue. But I would like to change those coloring to do the
highlight effect. So let's go to the
colors it colors. Fault going to be gray, and the true going to be let's say, for example, the blue. Let's say, okay. So now we
get a highlight effect. All other lines are gray, and only the one that we
selected is going to be Plue. But now, let's go and
test our parameters. So we have here France
selected currently. Let's select Germany.
And as you can see, and as you can see
now that selected line going to be Germany. Let's take Italy, and USA. Now as you can see, our
parameter now is working. Now here we have a
little bit issue where the highlighted line is
behind the gray lines. In order to switch that,
I would like to have the highlighted in the front
and the gray in the back. We're just going to go
to the legend over here. If you don't have it, you
can go to the analysis. And then here we
have the option of the legends and make sure
to select the colors. So currently it's
selected by me. What we're going
to do we just to switch those two values. Let's take the true
and put it on top. So that we have sorted
those two values, and as you can see
in the charts, the blue color in the front and the gray color in the back. Now the next step
in order to create this highlight effect
in tabled dots, we're going to change the size. In order to do that,
we're going to use our new calculated field. So the highlighted
line, drag and drop it on the size
by holding control. And now with that we've
got different size for the highlighted line
compared to the others, but here we have the
opposite effect. But we don't want that. We want the rest going to be thin and the highlight
going to be heavy. So in order to do that, let's
go to the legend over here. Double click over here. Now as you can see that through thin, the falls is heavy. In order to switch it, we're
going to go to reversed. Let's click on that. It okay. With that, you can see
the highlighted line is way heavier than the rest, you can change the size if
you don't like it like this, so we can reduce a little bit the sizing and it's going
to be now more nice. That's all on how to create
highlighted line in Tableau, more professionally than the
briefs on where you have more control on the
sizing and the coloring, the users can go over here and start changing the
value and with that, we are highlighting one line compared to the
others. That's it.
122. Bump Chart: All right. Next,
we have a fun one where we're going to
build a pump chart using lines in order to do ranking between
different values. Now, for example,
I would like to rank the countries over time. In order to do that, we're going to have the
same view where we have the quarter and the
sales, and we have a line. Now, the first thing
that we're going to go and grab the country and put it on the colors in order to create those
different lines. Now since the analysis
is about the ranking, not the total sales. In order to build that, we're going to go to the
sum of sales over here and we're going to go and create a quick
table calculations. Here we have the rank function. Let's go and select that.
So now we have a ranking that depends on the whole
table on the whole view. I don't want that.
I would like to rank between only four values. So in order to do that, let's go to the sum of
cells over here, write a click on it, and let's edit the table calculations. So let's go inside. And now instead of
having table across, I'm going to go and
specify a dimension. Now we would like
to have a ranking only using the country. So we're going to have
only four values. I'm just going to go as well
and select the order dates. So let's go and close this. So now we have some kind of
effect of the pump chart, but we are not there yet. As you can see the
ranks like starts from the bottom to top, I
would like to reverse it. In order to do that, right
a click on the axis, edit the x and then
let's reverse. That's all. Let's close this. As you can see now, we have
the top rank at the top, and then the bottom, we
have the lowest rank. Now, in order to have
this pump effects, we have to have circles
inside of our visual. We can do that very
easily if you go to now in order to
have the pump effects, we have to have lines,
we have it already, but as well, we have to have
circles on the data points. There is one easy way
in order to do that. Let's go to the colors and change the markers two circles. Now, as you can see, we've
got our small circles on each data points and
we get the pump effects. But now, sometimes we go
more advanced in the charts where we can make our own customizations for
those circles. Where we want to
make those circles, those data points
a little bit more bigger and inside it, the rank. Now in order to do
that, let's first hide those small circles.
We don't want that. So let's go to the colors and just have a line
without markers. Now, in order to have circles, we have to have the same
measure again in our view. So let's take the sum of sales, hold control, and put
it on the right side. So with that, we've got two
charts for each measure. Let's go to the second one to
the sum of sales over here, and instead of having lines, let's move it two circles. So switch the marks
here to a circle. So as you can see now we've got very nicely those circles, and now we can go and change
the sides of those circles. All right, so that looks nice. Now the next step is
that, we're going to go and put it on top
of each others, and we can do that
using the dual axis. So let's go to the sum of
cells on the right side, right to click on it, and
let's select the dual axis. So now with that you
have very nicely those circles on
top of our line, but the colors are
not correct yet because those two axes
are not synchronized. So let's go to the right
side, right to click on it. Synchronize axis. Now we got those circles
perfectly in our lines. I would like to hide
the right axis, right click on it, and
let's hide the header. Now the next step we can go and add numbers on those circles. I'm going to stick
with the second measure on those circles. Let's go to the labels
and show label. The next step, I
would like to add those numbers inside the circle. Go to alignment over here, and then the vertical, and let's make it to the center. So with that we got those
numbers inside the circles, and we can go as well and change the coloring and
the fonts over here. Let's make it white. And now with the next step,
I would like to go and change the sizing again
of those circles. So let's make it a little bit
bicker until it looks nice. Alright, so that's
enough, and with that, we got a really
professional pump chart, and we are controlling the
size of those circles. Now we can go and very nicely check the ranks of
those countries. As you can see, France was
in the first data points, the rank number one,
then it dropped to two, then three, then back to one, and we can see the development of those sales
between countries. And we can see very
nicely that Italy is always the lowest rank in
the sales in our business. Alright, so this is how we can
create pump chart tableau.
123. Sparkline Chart: All right, so now we're
going to learn how to create spark line
chart in Tableau. Spark line charts
are really like compact visuals in order
to show the trend, the changes over time, and you're going to
find it in a lot of dashboards in order to show KBs. So now, let's say we can create
that. It's really simple. So now we're going
to take a dimension like the country and put it on the rows in order just to split those lines to smaller size. So now on the spark lines, it's very important to have the informations of the sales. At the start and at the end of each line. So
let's go and do that. Let's take the sum of sales, drag and drop it to the labels over here, holding control. So now we have the
information of sales on each quarter in
each data point. We don't want that. So let's
go to the labels over here. And now let's go to
the min and max. Let's go select dots. So now we can see that
we have for each line, two values, the minimum
and the maximum. But here it depends really
on the sum of sales. So instead of that, I
would like the min and max depends on the value
of the order date. Let's go and switch
that. We can go to the field over here,
instead of automatic. Let's select the quarter. So now, as you can
see with that, we got exactly our spark lines. We have the starting value and the end value of each line. But now, usually the spark lines are really compact visuals. They are really small lines. In order to change that, let's switch from entire
view to standard. And now we're going to go
very carefully to the end of our axis until we get
the size of our mouse. Now, let's go and
completely reduce it. So that we got our
compact lines, I would like as well to remove
those lines in our charts, write a click on it over
here and go to formats. Then on the left side, we're going to go to the lines. We are at the rows, I would
like to remove those rows. Make sure to select
the row stabs and removing those
squared lines, were going to go over
here and select none. With that, we got really clean spark lines
without any grades, and as well, we can go and hide those informations
about the sales. So let's go right click
on it and show header. Let's disable it. So that's
it. Now, I'm happy with that. We got a very nice
spark line chart in Tableau, and as you can see, they are compact visuals in order to quickly
identify trends, which we usually use
it inside KB eyes.
124. Barbell Chart: All right, so now
we're going to go more advanced on building
visualizations in Tableau. We can learn how to create
piple charts in Tableau. Ppable charts are really
amazing in order to compare two data points and find the
differences between them. It's like before and after, and it works perfectly
if you have categories. Now, we would like to compare two years 2021 and 2022
by the categories. So now let's start
first with taking the subcategory in that category in order to have more values. Now, next, we need two measures. The first one for the year
2021 and the second for 2022. In order to do that,
we have to go and create a new calculated field. Let's go to the data again, click over here, create
a new calculated field. Now I'm going to call the
first one sales 2021, and the firm or going
to be very easy. So we're going to use the F
condition if the order dates. But now we are talking about
the year of order date, let's move it to year. So if the year of the
order date equals to 2021. Now what can happen if
the condition is correct? We're going to show the sales. So then sales and otherwise,
going to be null. That sets Let's go and end it. Now in this calculated field, we will get the sales
only if the year is 2021. Let's go and copy it because
we need it for the next one, that s then hit ok.
And with that we got in the data by in new calculated
measure for the sales, 2021, let's go and create
for the next year. It's going to be
the sales of 2022, paste the same calculation, but now we're going
to say if the year is 2021, then show the sales. So that's it. Let's get okay. So with that, we got
our second measure for the sales of 2022. Now we want to compare both
of those sales in our view. So let's take the sales
of 2031 to our columns. And now in the purple
charts, we can have circles and between them align in order to
find the differences. So first, let's start
with the circles. Instead of having bars, we're going to go
to the marks over here and change it to circle. So what that we've
got in our view, the first circle
for the year 2021. What is missing now
is the second circle. So in order to do that,
we're going to go and get our sales 2022, move it to the axis in order to generate the mejor values
and measure names. So just drag and
rub it over here. And now with that, we
got our second point. The first one, the
blue one is for 2021, and the second one
is 2022. All right. So with that we have
built the first part of the parble charts where we have the starting point
and the end points. So now, in order to
show the differences or the distance between
those two values, we have to have a line
chart between them. So that means we need now another type of chart
inside our view. In order to do that,
we're going to go and duplicate the major values, hold control, drag and drop
it and just put it beside it. Now with that, we
have the same data on the left and on the right. On the right, we're going to
have now different visual. Instead of circles, we're
going to have a line. Let's go to the tab over here on the marks to the second one. Now we're going to go and change the visual from circle to line. So with that we got our lines, but we are not there yet. I would like to have a
distance between two values. In order to do that,
we're going to take our mejor name from the colors, and we're going to go
and put it on the path. So drag and drop it on the path. And with that, we got
exactly what we want. We have now like a line
between two points. Alright, so now the
final step of that, we're going to go and merge
those two charts in one. So in order to do
that as we learned, we're going to use
the dual axis. So let's go to the measure values over here
on the right side. Right click on it and dual
axis. Let's select that. So now we got a perfect
line to show the distance, the difference between the starting point and
the end point. But now we still have small
issues in the visuals. I would like to make those
circles a little bit bigger. Let's switch to the
circles and go to the sides over here and make
it a little bit bigger. All right, so that's enough. And now as you can see the
line is on top of the circles, which is naturally correct. In order to make it in behind, we have to go and switch the
order of those dual axis. So let's take the right
and put it on the left. All right. With that, we've got a perfect parble
chart in Tableau, and we can go and analyze
the differences between two data points between the
sales of 2021 and 2022, and we have this
very nice line in order to indicate the
distances between them. So you can see, for
example, in the envelopes, there is no change on the
sales between those two years. But if you go to the
phones over here, you can see a huge
change on the sales between those two
years and individuals, it really indicates
those informations. That says, this is
how you create and why we create parber
charts in Tableau.
125. Rounded Bar Chart: All right. So now
we're going to go and build rounded bar charts. Previously, we have
learned how to build bar charts standard ones, but now we're going
to go advanced and build rounded par charts, and we will use lines
in order to do that. I know it sounds a
little bit strange, but let's go and build that. First, we're going to
go and get as usual, the subcategories in
order to make a rank. I'm going to stick
with the entire view in order to have the
whole view over here. Then let's go and get the sum of sales to the
columns over here. So now you can see this is
very nice standard bar charts. So now, instead of having
those classical bars, we're going to have
rounded edge bars at the start and at the end. So how are we going to do that? We're going to go and have like a dummy value
average of the zero. So now what we're going to do, we're going to go and merge those two measures
in one single axis. So in order to do that, let's drag the average and put it on top of the sales over
here in order to generate the major
values and names. So now we're going
to go and confer the bar chart to a line chart. So let's go to the marks
over here to the line. And then what we're going
to do, we're going to take the major name and
put it on the path. So now we are almost there. What we're going to do,
we're just going to go and increase the size
of those lines. So let's just make it bigger. And with that, as
you can see, we got rounded part
chart in Tableau. And as well, we're going to
get very nice color effect if we take the major values, hold control, and then drag and drop it
through the colors. And with that, we got really nice rounded
parchart in tableau. Well, if you ask about
now the use case, it's exactly like having
standard part charts. For example, here, we can make a ranking list of
the subcategories. We just change the
visual off it. So that's how you can build
rounded parchart in tableau.
126. Slope Chart: All right, guys, now
we're going to learn how to build sloppy
charts in Tableau. Slobby charts are perfect
in order to show how the ranking is changing over time for
different categories. So let's see how we can do that. Since the ranking over time, that means we need
the order dates. Let's go and bring the
other dates to our view. Then the next step, as usual, we're going to get our measure
the sales to the rows. See, we want to compare
the last two years. In order to do that, let's
go and filter the data. So show filter for the years, And let's go and select
the last two years. So now we have to decide which category you want to compare. You can go for the
border categories. We can go with the countries. So let's go and pick the country and put
it on the details. So now, the next one, I'm
going to go and just make it a little bit bigger in order
to compare those two years. The next step at that
we're going to go and put the category or the
country on the names. So let's control on the country and drop
it on the labels. So now we can see
the country name on the end of each labels, but I would like to
have it as well at the start in order to
get the sloppy chart. So let's go to the labels. So now what we have
to do is to put the labels at the line ends. So instead of having goal, let's switch it to line
ends, and let's close it. So now we can see that
each line starts with the country name and ends as
well with the country name. And now the last step it does, we want to add for each
line like small circle. In order to do that as we learned before, we
go to the colors. And we put the markers. So now we have a small circle at the start and at
the end of each line, and this is the easiest way in order to build sloppy
chart in Tableau. So again, the use case
of the sloppy chart that we can see how the ranks
are changing over the time. So in 2021, you can see
France far as a first, the USA Germany and
the last was Italy. And now we can see the change
over time in the 2022. Germany went from
place number three to be place number one, and then France
moved to number two, USA moved to number three, and as you can see
Italy, nothing changed. So this is the power
of the sloppy chart in order to see how
ranking are changing. The time. Of course, in Tableau, we can go more
advanced where we add more complicated stuff in order to have more
customizations. For example, you
say, you know what? I would like to have
bigger circles. In order to do that, we
have to have two charts, one for the line and
one for the circles. Let me show you how
we can do that. Let's take the sum of sales, hold control and Dublicate it. The first one going
to be the lines and the second one going
to be the circles. Let's go and switch for
the second measure, and instead of automatic, we're going to select
here the circle. It's two way big for our visual. Let's go to the size over
here and just reduce it in order to have
smaller circles, and as well a little bit more So that sets. Now, what
we're going to do, we're going to bring
those two charts in one. So let's go and merge
it using the dual axis. So I'm going to go to the
second one over here, right click on it, and then
let's go to the dual axis. Then if you look closely, those axes are not
100% synchronized. So what we're going to do
we can right click over here and then
synchronize the axis. So now we got the circles exactly in the
place that we need. So since we have two axes that have the same informations, I'm going to go and hide one
of them. So let's go and disable the show header. And now you've got the full
customizations of the chart. You can say, You know
what? For the lines, I would like to
have another color. For example, let's
have a gray color. Or you might say, let's
make it a dash line, so we go the bath over here
and move it to the dash line. So that's we get full
customizations on our chart. But usually for
the sloppy charts, we have a solid line between. So this is how we can create
sloppy chart in Tableau.
127. Bar with Line Charts: Okay, now we can
learn how to combine different types of charts
in one single view. And here we're going to mix
the pars with the lines. There are different
methods on how to do that depending
on the use case. The first one is using
the average line. So first, let's go and build a standard bar line
over the time. In order to do that,
let's get the order dates to the columns and as well the sales to the rows then let's switch the years to
a continuous month. Let's change the formats. And now instead of
having the line, we're going to go and
switch it to bar charts. Let's go to the marks
and switch it to bars. So with that, we've
got our bar chart, the second step
is to add a line. This line going to
be the average line. In order to do that in
tau, it's very simple. Let's go to the analytics. And here we have the
option of average line, let's go and drop
it to our view. So it's going to be for the
whole table. And that's it. As you can see, it's
very easy with that, we got a nice average line
combined with the par charts. All right. Moving on
to the next method, we're going to go and
combine the parts and lines using the dual axis, and here we're going
to go and compare two different measures. This time, as a change, we're
going to go and compare the number of orders together with the
number of customers. Now let's go and
get the order date in order to see the
changes over time. And then the next
thing we're going to go and get the order, the count of to the rows. Now let's go and
change the format of the order date to months, and then change as well, the chart 2 bars. So that we got our first
chart, the bar chart. Let's go and get
our second measure, and we're going to
have it as a lines. In order to do that, let's go
the count of the customers, put it near the rows. So that we split our
view to two charts. Let's go and change the
second one two lines. So we're going to go to the
marks, switch this page. And then now instead
of having bars, we're going to
switch it to line. So now we have our two charts, the bar chart, and
the line chart, and as usual, we want to go and merge them together
in one single view. In order to do that, we're
going to use the dual axis. Let's go to the customers, right to click on it, and
then choose dual axis. So with that, as you can see, we have a bar chart together
with a line charts. And of course, with
the dual axis, we can go to the right side
and synchroze those two axis. But for now, it makes no sense. And of course, now we can
add more customizations, for example, for the line
we can do the markers. So let's go to the
colors over here, and let's just add
the marks to it. So that's now we
can go and start comparing the number
of orders together with the number of customers in one single view using two
different chart types.
128. Bullet Chart: Okay, now we're going to build the polite chart in Tableau. Here, we're going to compine
again parts with lines. Pollet charts are really
important in order to compare the current value
with the target or compare the current
with the previous year. Now let's go and get as usual, our subcategory to the rows. And now I would like to compare the current with
the previous year. So let's take the sales of 2022 from our data pane
over here to the columns. And now let's go and
sort it by the axis. So we have a rank, and then we're going
to go and compare it to the sales of 2021. So what we're going to do,
we're going to take the 2021 to the details, and then we're going to go
and add a reference line. Let's go to the axis
to the sales of 2022, right click on it, and
let's add a reference line. Now let's take it a little
bit to the right side and also to see those
reference lines. What we're going
to take instead of the sum of sales 2022, we're going to have that
2021. Let's lick that. And now we got one
line for the average. We don't want that.
We want to have the total sales for
each subcategory. So in order to switch that,
we're going to go and say, instead of peer pan, we're going to have it peer
sale. So let's switch it. So now we got a line for
each bar, which is great. But let's go and customize
those informations. I don't want to see any labels. So let's go to the labels
and switch it to none. And then let's go and form those lines. We're
going to go over here. And let's take, for
example, the orange color. And then let's go and
change the transparency to 100% to have a full line. And then let's go and make it more heavy in order
to see the lines. I'm just going to
go with the full. So that's it. So let's
go and close this. And as you can see with
that, we've got very easily a pullet chart in
tableau where you can compare the current year of the bars with the lines
of the previous year. So this is how we can create a very nice pullet chart by
combining bars and lines.
129. Lollipop Chart: All right, so now we're
going to learn how to create a lollipop
chart in Tablo. There are two types of darts
horizontal and vertical. We can use this
type of charts by comping the parts
and the circles. So it's like stick, and at the end, we
have big circle, and we use the
circle in order to highlight a data value.
Let's go and create that. It's very simple. Let's take the subcategories to the rows. Then our measure going to
be the sales as usual. Let's put it on the columns. So with that we have
already our bar charts. If not, then go to the
marks and change it. Let's go and sort it in
order to have a rank. So since it's lo pop, we can have sticks. So let's have smaller bars. Let's go to the size over here
and just reduce the size. So now what is missing in the
lollipop is the end circle. So in order to make
another chart. What we're going to do,
we can take the sum of sales as well
and duplicate it. So hold control, Just drag
and drop the sum of sales. So with that, we've
got our two measures, and what we're going to do next, we're going to go and
change it two circles. So let's go to the marks to
the second sum of sales. Instead of automatic, we're
going to have the circles. So we've got very nicely those circles, but
they are really small. So let's go and make it bigger. Little bit smaller. Alright,
so maybe this is fine. So what is the next
step in order to merge two charts together
in one single view? As usual, we're going
to use the dual axis. So let's go to the
second sum of sales. Write it click on it, and then
let's go to the dual axis. So as you can see
things got destroyed, we don't have any
more of the bars, and that's because in the first measure of
the sum of sales, We didn't specify for
Tableau that is bar. It was an automatic,
and with that, Tableau going to go
and make guesses on the suitable visual
for the current data, which is something
that is wrong. So what we're going to
do, we're going to go to the first measure and say for Tableau, it's not automatic. We want it always to be as
a bar. So let's switch it. So with that, as you
can see, we have already the shape
of the lollipop. We have to do some few stuff
that is not a big deal. So we forgot about
synchronizing the axis. So let's go to the second
one, right click on it, and let's synchronize it just to make sure that everything
matches correctly. And now I have those two axes that have exactly the
same information. So I'm just going to
go to one of them. And hide those information in
order to have it only once. Now the key thing of
the lopop that's to show information at
the end at the circle. Here we can put anything
like any measure. For example, we can have the total sales or the total
number of orders and so on. But in this example, I would
like to have the text of the subcategory on those
circles. We can do that. We're going to go to
the circle over here, and we're going to
put in the labels, the subcategory biodect control and putting the
subcategories on the labels. Now, as you can see, we have now the headers informations
on those circles. So what we can do, we can go now and hide those informations. Right click and show header. With that, we have removed
those informations and we have now the header informations or the subcategories
on the circles. One more thing that we can do, we can go and add coloring. Let's take the sum of sales
and put it on the colors. So with that we
have a really nice rank chart for the
subcategories. Okay, so now let's see
quickly the second type. We can have a vertical
lollipop charts. I just duplicated
the previous one, and all what you're going to do, we're going to go to the
quick menu over here and switch everything between
the rows and the columns. All right. So now we have
everything vertical, but we have really big circles. So let's go and change that. Let's go to the second sum
of sales and go to the size. Let's try to reduce
stuff over here, and we can reduce
as well the sticks. Let's go to the
first sum of sales. To the size as well, let's try to reduce the sticks. So now it looks really nice, but still we have a
problem with the labels. So let's go again
to the circles. Go to the labels, and
we're going to change the alignments from
automatic to on top. So we're going to go
and change the s. So now we have the labels
on top of those circles. But still, we don't
have all the labels because the size of the
text is really big. So let's go to the
phones over here. Changes 10-8. One
of them is missing. You can go and reduce
the size of the circles. So that's it. This
is how you can create lollipop
charts in Tableau. And here you can see
the power of Tableau. We can go and combine different type of charts
in one single view. Like here we are combining
the circle with the bars. So that means we have endless
amount of combinations, and this opens the
innovations in Tableau where you can create
amazing charts and visuals. And this is exactly
the magic of tableau.
130. Area Charts: All right, so now
we're going to talk about the area
charts in Tableau. They are like the line charts. We can use it in
order to see how the data are changing
over the time. But under the line, we're
going to get a field area in order to make it easier
to visualize those numbers. So now we're going
to start with a very basic area chart in tableau. Since it is change over time, we're going to get the
order date to our view. And then as usual, we're
going to get the sum of sales to the rows and
instead of a year, we're going to switch
to month continuous. Now here we have it as a
line because it's automatic. If you go over
here to the marks, you can see we have a
chart type called area. Let's go and switch it. So this is the most basic area charts that you
have in Tableau. So now we might
say, you know what? The basic area chart in
Tableau, don't have a line. Usually, the area
charts has a line, and between the
line and the axis, we have a field gap. But the basic area chart in Tableau, don't have this visual. In order to recreate this
design, what we're going to do, we're going to go
and create a line on top of our area charts. So here we can have
two types of charts, the line and the area. So let's go and create that. We're going to take
the sum of sales and duplicate it by holding control. So now we have our two charts. The first one going to
stay as an area chart. The second one going
to be a line chart. So let's go to the second
one of the sum of sales. Instead of area,
we're going to have a line And I think you
already know the next step. We have to go and merge those two charts in
one single view. So how are we going to do
that, using the dual axis. Let's go to the
second sum of sales, right it click on it, and
let's choose dual axis. Now the next step,
we're going to go to the area chart and just
reduce the obcity. Let's go to the colors, and now let's go and just
reduce the opcity with that, we're going to get a perfect
area chart in Tableau, where you have a line and
between the line and the axis, you have a field gap, which is way better than
the basic area chart in Tableau. All right. Moving on to the next
one, we're going to have the stacked area charts. It's like the part charts. We can add more informations to our visualizations by adding the dimensions to the colors. So now we have the
basic area chart at the start where we
have the sum of aleles and the month
over the time. So now we're going to
go and add a dimension. Let's take the category
and put it to the colors. So with that we got three
area charts stacked on top of each others because inside these dimensions,
we have three values. So what we can do over
here about the design, we can go to the colors over here and increase the opacity. So really, that
sets, this is how we can create stacked area chart in Tableau. All right. Next, we're going to go and
build full 100% stack charts. Here, if the total of the
sales is not important, but what is important
is to go and compare those different
categories together, we can go and use the
full stack charts. Let's see how we can
do that. We're going to go to the sum of sales, and we can switch to quick table calculations
percent of total. Let's go and click on that. We are not there
yet. As you can see, we have the percentage over
here on the left side. We want to have it 0-100. In order to do that,
we're going to go again to the sum of sales radical on it and let's edit
the table calculations. Now what we're going to
do, we're going to switch it to specific dimension, and this dimension is
going to be the category. So let's deselect the months of ordered age and let's
go and close it. So with that, you can
see the you now start 0-100 and you have
it like one block. Now we can go and very easily compare the three
different categories. And here we can see
very clearly how each category is relating to the whole to the total
sales of each month. This is how we can
create very easily a full or 100% stack
chart tableau. All right. So now we're going
to go and create small multiple area charts by
adding multiple dimensions. Now let's go and get
the first dimension. It's going to be the
country to the columns. Let's go and get the order
dates as well to the columns, and then to the
rows, we're going to go and get the categories. Those are our three dimensions, and then I'm going
to go switches from standard to entire view. Now let's go and get the
numbers inside our view. So it's going to be
the sum of sales. Let's put it in the rows. As a default table, going
to show it as lines. Let's go and switch it
to areas to the marks. So that we get our mini
area charts in Tableau. But now let's add more details where we want to see the months. Let's go to the year over
year and change the format to continuous month.
Let's switch it. Then next, we're going to
go and add the coloring. Let's control and drag and drop the country
to the colors. In such a visualizations, it makes no sense to have
those grid information. Right click on it, let's go
to the formats to the lines. Make sure to select the rows, and then the grid line over here and make it So what does, we have created small, multiple area charts in Dublo. It's very similar to the
lines or to the bars.
131. Scatter Plots: Okay, so now we're
going to learn how to create the scatter
plots in table. Cutter plots are one of
the fundamental charts in order to understand
the relationship between two continuous measures. So that means the main
task of the scatter plots is to find correlations
between two continuous fields. And as well, another task
of the scatter plot is to find the outliners
inside your data. So let's go now and create a very basic scatter
plots in table. And as I said, we need two
measures in order to do that. O two measures going to be
the sales and the profit. Let's get the sales
to the columns. And as well the
profit to the rows. So with that we
got our two axis, and it going to represents
a two dimensional graph. Now what is missing
is, of course, our data, the data points. So here we're going to
go with the customer ID. So let's take the customer ID, and now we're going to go
and put it to the details. And here is the power of tableau compared to
any other tools, where Tableau can go and
plot all data points that we have inside our data
without any restrictions. So with that we can see
the correlation between the sales and the profit and as well to find the outliners. For example, those points that
we have it as stand alone. All right, so that
we have created the very basic scatter plots in Table. All right. So next, we're
going to go and add more stuff to the design
of the scatter blots, where we're going to
change the colors, the size, add
circles, and so on. So now we're going
to go and change the size of each data points, but it's going to depend
on a third measure, the count of orders. So now let's go to
the orders counts and drag and drop
it to the size. Each customers go
has different sizes, and that's going to depend on how many orders did
these customers place. So this is one thing that we can add to our scatter blots. Another thing we
can add coloring. So here we have different
ways on how to add coloring, either we can add a dimension
or we can make a cluster. So now, for example,
let's go and get the dimension country and
place it on the colors. And here in the data points, we can add as well different
shapes in our visual. So currently we have the
circle for everything. We can take the country drag
and drop it to the shapes. And now we can see
in the scatter blot, not only that the countries
has different colors, but they have as well,
different shapes. But what we usually see in
the scatterplots at that, Each data point can be
represented as a filled circle. That means we're going to
go and change the visual. Let's go to the
marks over here and then change it from
shapes to circles. Now as you can see,
we have everything as a filled circle, but we are not there yet. Let's go and make the
size a little bit bigger. Now what do we have over here,
we have a lot of points, and what we usually do, we go and reduce the opacity
of the colors. So let's go to the colors over here and let's just reduce it. And with that, you can see
very nicely, for example, those two points, there is
like overlapping between them. One more thing that we
can add to those circles, we can have like a lined
border for each circle. So in order to do that, we're going to go again to the colors, and here we have an
effect called border. So instead of automatic, let's have something like
this color or the gray. So with that you
can see, we have a very nice border
for each data points. Alright, so those are
some different options on how to customize
the scatter plots.
132. Dot Plot: Okay, so now we're
going to create the dot blot in Tableau. Dot blot is one dimension
graph in order to see the distribution of your data between
different categories, and each dot can be
representing one data point. So now let's go and see the
sales by the order date, and then we can have the
order ID as a detail. So we're going to take the
order date to our rows. So now we're going to go
and see the distribution of order IDs by the date. Let's take the order date
to the rows this time. Let's go and change it to
a month as a continuous. Then we're going
to go and get our measure to the columns. And now as a default,
we have it as a line. Instead of that, we're going to go and make it as a circles. So now we are not there yet. We have to add more
details to the view and that by moving the order
ID to the details. So now since we have a lot of orders inside our data sets, Table can I ask us, do you
really want to do dots? Well, yes, add all members. So now, as you can see, we
have a very nice dot plot. We can add more informations
like, for example, let's take the category
and put it to the colors. And as well since there
are a lot of overlapping, we can go to the colors. And reduce the opacity. So now with that,
each data point, each circle can
represent one order, and you can see now
very clearly and very fast which orders
has the most sales. So this is how you can
create dot plot tableau.
133. Circle Timeline: Alright, so now we're
going to learn how to build circle or
bubble time line. We usually use the
circle time line in order to analyze the
changes over time, and we usually use it to show the distinct values of different circles across
multiple categories. So let's see how
we can build that. Since we say it is change
over time, we need a date. So let's go and get the
order date to the columns, and then we need
one more dimension. Let's take for example, the
subcategories to the rows. And then we need our measure.
It's going to be the sales. But now instead of dropping it to the columns or the rows, We're going to drop
it on the size. Since each data point
can have different size. So To go to show it as squares. Let's go and switch
it to circles. And now, in order to have
more data points in our view, we're going to go
and switch the ears. Let's take, for example, the quarter as continuous. So let's click on dots. So now I'm going to go and
change the size of our view. I'm just going to
go to the header and make it a little bit bigger. Then we're going to go to
the axis and just make it a little bit smaller in order
to have some overlapping. So now let's go to the size and increase the size or make
it a little bit smaller, and then we're going to go to the colors and
reduce the opacity. And now we can add more
customizations about the design. For example, let's
take the sum of sales and put it to the colors, and then let's increase as a little bit the opacity,
so it looks better. As well, depend on
how you like it. Maybe you can go and
add some borders. So let's go to the
borders over here. I like the dark ones. So maybe I'm just going to go
and make it more gray. Cross here, you can
go and customize different stuff, for example. You can go and use two measures. So, for example, instead of having the sum of
sales on the colors, we can go and get
the sum of profit. So let's go and get the sum
of profit on the coloring. So now we can see
in this one chart, we can see a lot of stuff,
the change over time. We can see as well
the coloration between two measures
in order to understand the relationship between
them where the side going to indicate the sales and the color is going to
indicate the profits. This is really powerful
and very great analysis inter blo using
the circle timeline.
134. Pie & Donut Charts: All right. So now
we're going to talk about the pie chart in Tableau. It is very easy and
common way in order to analyze or show the
part to whole data. Let's say we can
build that on tau. There is an easy way or sheeting
way in order to do that, if you go to the show me over here and then click
on the Pie charts. We will not do that. We
will create it on our own. So that we understand
how Tableau works. Let's not take the shortcuts.
I'm just going to close it. So in order to build a
pie chart in table first, let's go to the marks over here, change it from
automatic two. A Pi. So with that we get a
small icon called angle, and here we're going to go and drop our fields on top of it. So in this example, we're going
to build a pie chart from the sales and then split
it by the country. Let's take the sales and
put it on the angle. And with that we got
our fair charts. It is like a circle and
it's not divided yet. Let's switch from
standard to entire view in order to get a
bigger pi chart. Then the next step,
we're going to go and divide the pi charts
into sections. So our dimension going
to be the country. Let's code the customers. Then grab the country and
let's put it on the colors. So that our Pi is divided
to multiple sections, and the size of each section can indicate the sales
of the country. This type of charts
is used in order to analyze the part to whole. For example, here,
we can analyze how the USA is contributing or
relating the whole of sales. So as you can see, it's
really easy to build and very commonly used
in many dashboards. We can go over here,
for example and add some labels and
change the design, of course, of these pie charts. And one more thing
that I would like to show you that sometimes
in the dashboards, you can see that there
are multiple pie charts in one dashboards in one view. In order to do
that, you just grab any dimensions and put it to
the rows or to the columns. So for example, let's take that category and let's
put it on the columns. And with that we
got immediately, Three pi charts under those
three different categories. So this is how we usually
deal with the pie charts. We have one dimension
that split the pie charts and another one that is
duplicating those pie charts. All right, y. So that's all for the pie charts in Tableau. Okay, so now moving
on to the next one, we have the donut charts. Dona chart is very
similar to the Pi chart. You still have this
analysis of part to whole. You have a circle and you
have different segments. But many people prefer
to use the Du chart, and that's because we can add an extra informations
to the circle. All right. So now, in order to build it, we need two charts. The first one is going
to be the Pi charts. The second one going to be the
empty space in the middle. So let's start with
the pie charts as we learned previously, we have to switch the
automatic to a Pi charts. Then we take our measure, going to be the sum of
sales to the angle. And then next we're going
to take the divider, it can be the country
to the colors, and with that we
got our Pi charts. Okay, so now next, I'm going to switch from standard
to entire view. So this is for the first chart. Now, in order to get the
empty circle in the middle, we have to create another
chart inside this view. So now we're going
to go and create our empty measure just
to have a second charts. So in order to do that,
let's go to the columns over here at average of zero. So now we still on the marks, we have only one visual in
order to get a second one, we will go and duplicate it. So now with that, we
got our two measures, one for the pie charts, and the second one can
be for the empty space. So now what we're going
to do, we're going to go and merge those stuff together in one place because we have
to have only one donuts. Right click on the average and
let's go to the dual axis. As usual, we're going to
go and synchronize stuff. So let's go and
synchronize the axis. And now let's go and get rid
of them. We don't want them. So show header away. As
well from the bottom. So now we have the two
charts in one plate. It's a little bit
small. Let's go and make things a
little bit bigger. Let's go to the sizes and just make it bigger in the
middle. All right. So now let's go and make the
empty space in the middle. Let's switch to the
second marked over here. Now the second chart,
it will not be a Pi, it's going to be like a circle. Let's go and switch
it to a circle, and let's get rid of
all those informations. Now if you check our
view, we don't see the pi charts and that's
because we have overlapping. The by chart is
behind our circle. Now in order to show it,
what we're going to do, we're going to go to the circle. Go to the size, and
now let's go and start reducing the sides
of the circle. As you can see, now we are
getting the shape of donuts. But our doute has in the
middle a white color. Let's go and change the
circle color to white. Perfect. Now we've got the
dou shapes in our view. But now let's go and get
rid of all those lines. Right click over here and the
empty space, go to format. Then let's go to the left side. Let's start with the
lines over here. The zero line, let's
go and switch to none. Then we still have the
column one more line. Let's switch to the columns. Instead of the grid line, let's move it to none. And then in order to get
rid of those borders, let's switch to the borders. Then let's go to the row
divider, make it none, and as well for the
column dividers none, and with that we got very
clean donut shapes in Tableau. Now, let's add some labels and some data to our donut charts. Let's go to the pie chart first. Here we're going to get
the informations of those sections. So what
are we going to do? We're going to
bring, for example, the country to the labels. And as well, we can go
and get the sum of sales, like Hold control and drag and drop it to
the labels as well. Now we can go and change
the font format, of course, if we go to the labels over here and then click on
the three dots. Then let's make, for example, the sum of sales
pools, and outset. So far, there is nothing new
compared to the pie charts. We are just showing the
informations of each section. But now here comes the
power of the donor charts, we can give an information
here inside the site circle, and it can be usually the total of the measure,
the total sales. Now let's go and switch
to the circle over here. Let's go and get the sum of sales and put it to the labels. You can see the sum of
cells here strangely on the right side because we
didn't customize it yet. So let's go to the
lapols then let's go to the alignment over here and make it everything
to the middle. With that, as you
can see, we've got the total sales in the middle. Let's go and
customize the text a little bit. Let's go inside. So what we can do, we can write the total
sales at the start. And then we can make
everything like pulled for the real number, the real values, and let's make everything a
little bit bigger. 16 and click. So
now, as you can see, we've got now another
information to the bar charts where we have the total sum
of sales in the middle, and then we can see very nicely the different sections
around this number. So that's this is
how you can create Da chart in Tableau,
and this type of chart, it is way more used
than the pie chart, since you can add one extra
information in the middle.
135. Treemap & Heatmap: Okay, so now we have another
chart in order to analyze the part to whole
using the tree map. We usually work with the
three maps in order to show the hierarchical data
inside our data sets. So let's see how
we can build that. Let's first start
with the marks. Let's go and switch
it to squares. The next step, we're
going to go to the sales and we can
put it on the size. With that, we got
one blue square for the total sales
inside our data. Now, of course,
we want to go and split this square to
multiple informations, and here we're going
to work with the hierarchy of the products. So let's start with the first
dimension, the category. Let's track and drop
it to the colors. And as you can see, we
already got now a tree map. So the colors of the three map is decided from the category, and the size of those blocks can be decided from the sales. Now, of course, in
this three map, we want to represent
the hierarchy. So the next dimension going
to be the subcategory. But this time we will not
move it to the colors, we will move it to the details. So let's go and do that. So now as you can see each of those blocks are
divided to more blocks, where we have the
subcategory informations. So that means the data will keep splitting in the tree map, the more dimensions we
add from the hierarchy. So for example, let's go
and grab the product name, and let's put it to the details. And now we can see
that we have a lot of mini blocks that represent
the product name. So with that, we
have represented our hierarchy of the products, individual in a tree map. And we can see that each
category, for example, the red is splitted into
multiple subcategories, and each subcategory is splitted for the
more two products. But of course, the disadvantage here that the more
details you add, the harder going to be to
read this visualization. So I don't recommend
you to go with the product name in
such visualizations. It should be enough with the category and
the subcategory. And of course, like any other charts in
our visualizations, we can have multiple
tree maps in one view by adding a dimension to
either columns or rows. Like for example, let's go and get order date to the roads, and would thus we got multiple tree maps
splitted by the ears, which is really useless to
have such a visualization, so let's go and remove it. Okay, now we're going to
talk about the heat map. It is like a matrix where
you have colors inside it, and we usually use
it in order to do colorations between
two categories. Let's see how we can build that. We need two categories. That means we need
two dimensions. Let's say the first one
going to be the country, let's drag and drop
it to the columns. Then the second
dimension going to be, for example, the subcategory. Let's drag and drop
it to the roads, and with that, we
got our matrix. Let's switch to entire view. So we have rods,
we have columns. Now what is missing, of
course, is our measure. At. So now, in order to create
the effect of the heat map, we're going to take
the sum of seals, and let's put it to the colors. And now with that,
we've got our heat map, and we can see from the
colors the coloration between the countries
and the subcategories, where we can see immediately
that the highest seals, where we have the dark color. So for example, we have high
seals from the country, France, and as well, from the subcategory
And the lowest sales, we can see it, for
example, here, in the envelopes and Italy. Where here we can see again, the power of visualizations, where we can read now the trends and the
colorations between our data, which is way better than
having only numbers. But of course, if you want to add some numbers in this matrix, we can go to the
labels over here, showmrks and if you want
to make it to the middle, let's go to the alignments, and let's make everything
in the middle. So that's it, as you can
see, it's really a symbol, and this is how we can
create heatmap in Tableau.
136. Bubble Charts: Bubble chart in Tableau, they are really great
way in order to add a lot of dimensions and
measures in one single view. So bubble charts
are like circles, and we can define a lot
of stuff in the circle, like the colors, the size
we can put inside the text. So let's have an example. We're going to start
with the mark. So instead of automatic, let's go and switch it to circles since the
bubbles are circles. So let's start with
the fence information. We're going to go and
get the measure sales. Let's put it on the size. With that we got our fair
small pupple or circle, let me switch it to entire view. So now we have one information, the total sales inside our data. Let's add another
information like dimension. Let's go and add the
subcategories inside our view. So I'm going to take
this dimension, and let's put it on the details. Now as you can see, we
got more ppples and we're going to get a bubble for
each subcategory now. All right. So now
let's keep adding more information to our pupples. Let's say that I would like
to add the coloring for the pupple and this should
come from another measure. Let's take the profits. Let's put it to the colors. Now with that, we
got different colors depends on the values
from the profit. Now I'm about to add
one more informations inside those bubbles. Let's say the category. Let's go and get the
dimension category, and now let's put
it on the labels. Now we can see the category of each bubble of
each subcategory. As you can see, we have
four different informations that we have inside our bubble. The first one is the colors of the bubbles indicates
the profits, and then the size of the bubbles show us the
sales informations, and then the number
of those bubbles are decided from
the subcategory. We have all those
subcategories inside our data, and finally, the text inside the bubble comes
from the category. This is the power
of the bubble chart where you find Atum
performations in one view. Okay, so now we have another fun one called stacked
pubble charts. So here we're going to add a lot of dimensions in the details. Let's say we can build that. Let's go to automatic as usual, then switch to circles. Let's take the sum of sales
and put it on the size. We are just creating again
our ppples this time, we're going to go
and get the country and let's put it to the colors. So far, we have those four
colors for four countries. Now if we bring a
dimensions to the details, it's going to split
these pupples to more small pupples and that's the bend on the cardinality
of the dimensions. For example, let's
take the category. It has very small cardinality, and with that we will
get just few pupples. If we go and remove it,
let's take the subcategory. Now as you can see,
we are getting way more ppplesthan
the category, and that's because
we have more data inside the subcategory. Now let's go with higher cadty let's just remove
the subcategories, and let's get, for
example, the brodac name. Once you do it, you
will get a lot of small pubbles and they
are all stacked together. Of course, you can go and
sort the pbbles differently. If you go to the
country over here, right you click on it,
and let's go to sorts. Let me just move it to the
left side a little bit, and if you change the
sort as you can see, the color is going
to change as well. So here you can go and sort
the pupple as you want. And of course, we can go
with more details if we take the lowest level of
details, the order ID. So let's drop the
product name away, and let's go and
get the order ID. And with that WSS, do you really want
all of those data? Yes, add all members. And now you will
get for each order a small bubble inside
our visualizations. Okay, so this is another
way on how to represent your data in visuals using
the stack double chart. But if you look at it, you will find it's
looked like the son. All right, so that's all for
the stacked bubble charts.
137. Maps: Now we're going to talk
about Tableau maps. First, let's get the data
in order to plot the maps. Let's go and create
a third data source. I am at a data source page. Let's go over here in this
small icon, new data source, and then let's go
to the text file, and then to the data
that we download it. Let's go to the big folder, and then we have
over here USA sales. Let's select this CSV
file and click open. It's really simple table
where we have the orders, country region state and sales. That sets, let's go
back to our view, and let's create now a
very basic map in Tableau. Again, we can go and sheet using the Show but we're going to go and create it from scratch. If you have a look
to our data bin, you can find that we have two automatically
generated fields, the latitude and the longitude. They are geographical
coordinates in order to blot the
map, the Earth. The latitude is
responsible to plot the horizontal lines and the longitude is responsible
to blot the vertical lines. What you can do going to go
and use them to the columns. Let's take the longitude to the columns and the
latitude to the rose. So with that, you can see that Tableau is now able
to plot the Earth. Now next, we have to
specify for Tableau, the country, the states, those
geographical informations. So let's take, for example, the country to the details. And with that, you
can see that Tableau is now focusing only on the United States
because we have only information about USA. Now let's take the states as well and boot
it to the details. Now as you can see,
Tableau is focusing now with those points
on each states. All right. Now the next step
instead of having circles, I would like to
have a map chart. So let's go to the marks, switch it from automatic to map. And with that, we
have the whole area covered with the colors. So now we can go and add coloring depend on the
dimension that you want. So for example, we can go to the region over here and
boot it to the colors. So now we can see
that the map is now splitted by the regions. So now what is missing here
is the sales informations. So let's go and get the sales. But here, we have a small
problem that the sales is dimension and discrete
because of the data type. So let's go and switch it to a number hole and then make it continuous or convert
it to continuous. And then the last thing
we have to convert it as well to a measure because
it's still has a dimension. Everything is fine. Let's go and get the sales to the labels. And with that, we
got very nicely the total sales for each state. This is how we can create a
very basic map in Tableau. Moving on to the next
one, we can create maps in Tableau with simples. So I just duplicated
the previous one. Let's go and switch the visual
from map to, for example, circles, and then the size of the circle going to be
decided from the sales. Let's take the sales and
boot it to the size. Then the next se
let's go and make the circles a little bit bigger. And now we can add another
measure to the circles. Let's say the number of orders we're going
to take over here, the count of the USA sales is V. So let's take
it to the colors. So now the scale of the color going to define the number of orders and the size of the circle can be
defined from the cells. So this is one way
in how to represent those informations as
the circles or bubbles. We can go and choose
different shapes. So let's go over here in the
marks and go to the shapes. You can go for example was, let's say what you
can have over here. Let's go with the stars.
So as you can see, we have here a lot of options on which symbol can be
presented inside our map. So this is how we can add
symbols to the maps in Tableau. All right, guys, maps in Tableau are very rich in
the customizations. There are a lot of options on how to plot the
maps in the view. So I'm going to show
you a few possibilities on how to blow the
maps in Tableau. The first one is about
how to have a map without any background noises.
Now let's go and do that. If you take the country field and just rub it
here in the middle, D understand we are
talking about map, and we're going to
get automatically everything inside the
columns and the rows. So now, the next tablet's take as usual, the states over here, and then we're going
to go and color it with the region
on the colors. So now if you check the map, you can see there are a lot of grade out areas inside the map
that is not used directly. So if you want to remove
all those informations, what we're going to do, we're going to go
to the main menu. You have here maps options, and then here we have
a background layers. Let's go and click on that. And then on the left side, we will get many options on
how to customize the maps. I really recommend you
to go and click around. It's really fun to work
se maps in Tableau. So now the task is to remove all those background
informations. What we're going
to do we will just remove all those
selected informations. So let's just remove everything. And with that, as you can see, we have removed the background, and we have only the relevant informations inside our view. And there's another way on
how to remove the background. Let me just go back with
all those settings. So I think with that we
got all informations back. Another way to remove the
background informations to go to the washout
and move it 0-100. So now as you can
see the background inside our map did disappear. So this is how we can remove the background informations
inside our map and you get really
a clean map in order to focus on
the relevant data. The next one is as well about customizing the maps in Tableau. So now let's go and create
a night vision map. It is just fun to
work maps in Tableau. So let's go again and get
the countries in the middle, the states to the details. So now in Tableau, we have different types of
maps, not only one. So if you go to the main
menu over here to the maps, either you check
the background map, so here we have the
different modes or if you go again to the
background layers, and on the left side, you can see here the styles. So currently it is white
and gray, it's lights. So if you click over here, you can find the
different models. We have the normal one, and
then we have stuff like dark street outdoors and
satellite informations. So it's really nice to
have different styles. What we're going to do now
since it's night vision, we're going to go
with the dark modes. So now, the next thing,
I would like to reduce some informations like
United States and Mexico. Let's go and remove those
stuff from the left side. And then what we're going
to do, we're going to go and add some
measure to our view. So let's close the
background layers over here. Let's go and get the
sales to the size. So with that, we are
getting those nice circles. Let's make it a
little bit bigger. And then we can add the
sales as well to the colors, so hold control,
voted on the colors. Let's change the coloring, so let's go and edit colors. And now let's go to
the automatic over here and let's change
it to another pattern. For example, let's take
the blue green over here. Click Okay. Okay, so now
we're going to go and add more customizations
to our map. For example, let's say that, I would like to change the color of the borders for those states. So I would like to make it red in order to make it
more interesting. I cannot do that in
the current view because if I change
anything about the border, it's going to change
the border of the circles and not the
border of the states. So in order to do that,
we need two maps, one for the circles and
one for the states. Now let's see how
we can do that. We're going to go to the lgitude and you're going to
go and duplicate it. Now that we got two maps,
the left and the right. Let's go and configure
the right one. Let's switch the marks
to the second map. Now instead of having circles, we want to have a map. Let's switch it to a map. Now as you can see now, we have two different types of maps. But now I would like to have
only the border information, so I'm not interested
about the sale. Let's go and remove it
as well for the sizing Now as you can see
we have gray colors that is filling the map. So let's go to the colors and
reduce the opacity to 0%. So that we don't have
any colors on the map. What do we need is the
color of the border. So let's go again to the colors. Let's go to the
borders over here. Let's make it red. I'm not
really happy with this color. I want it to be more red, so let's go to more colors, and let's get the re red. Now the question is how to merge those two maps in one map. Well, the answer for that,
using the dual axis again. So let's go to the
right one over here, right click on it and
dual axis. All right. So with that we got to one map, but I'm still not
that, you can see that the circles are
behind the lines. In order to have
it in the front, let's go and switch
those two measures. And now you can see
that the circles are in the front. All right. So with that we have created our night vision map and with that you've
learned as well, how many possibilities
that we have in Tableau in order to
customize the maps. All those different options
that we have inside the maps, I really recommend you to go and explore those options that we have inside Tableau,
it's really fun.
138. Histograms: Okay, so now we're
going to learn how to create histograms in Tableau. There is two ways, one quick
way and one advanced way. The quick way, if you
have one measure, the advanced way if
you have two measures. The histograms are really
great way in order to show the distribution of your data using par charts. Let's
see how we can do that. Let's work with the one
measure the quantity right to click on it and then go to
crereate and then two pins. And here we can go and
configure our pins. I'm going to leave it as
default as tableau suggests. Let's go and click with
that we have created. A new been new dimension
in our data pane. So now what we can
do, we're going to go and grab it to the columns. And here we can find
the size of our pens, and then we're going to go and get the quantity to the rows. And then the next and
the last te we can do, we're going to go
to the quantity and convert it from
discrete to continuous, so radic click on it and
switch it to continuous. So with that we have created a very simple and
nice histogram to see the distribution of our data
using the measure quantity. All right. The next
one is going to be a little bit more advanced
where we're going to create a histogram using
two different measures. The number of customers
by the number of orders. So we want to cluster
our customers based on the number of
orders that they placed. Now in order to do that, we
have to create our pens, but now we're going to use the calculated field in order to do that using the LOD
expressions fixed. So we can do that. Let's go and create a
new calculated fields. Let me just move it a
little bit over here. So what we're going to find
out is the number of orders. Peer customers. In
order to do that, we can use the LOD
function fixed. It starts with fixed.
Let me select that. Then for each customers, we want to count the
number of orders. For customers, we're going
to get the customer ID, and then the
aggregation is going to be the number of orders. That means we're going to
go and count the order ID. All right, so that's
it. Let's go and hit. So that table did create
a continuous measure, but I would like to convert
it to a discrete dimension. Tic click on it, and let's
convert it to dimension. And that's it. Now
let's go and grab it to our view and
check the informations. All right, so that we can see that we have already our pens, and those are the
different number of orders that the
customers did order. The next step we need
our second measure, it's going to be the
number of customers. Let's go to the customer's
count over here, drag and drop it to
the rows, as well, let's take the customers to
the labels, and with that, we've got a very nice histogram in tableau using two measures. Again, here, if
you want to build histogram from two
different measures, one of those measures
has to be the basics, the pens of the histogram. And the second measure going to be used in order
to do the counts. So now we can see very quickly that most of our customers are ordering between 13 orders
and like 16 orders. Alright, so those
are the to methods on how to create histograms, the easy way, and the
little bit complicated way.
139. Calendar Chart: Okay, now we're
going to learn how to create calendar in Tableau. Now we're going to go and build this calendar using
the order date. So let's take the order
date first to the columns. Now in the columns, we
have to have the days, right click on it in order
to change the formats, and then go to more, and then let's get the weekday. So with that we got the
mandate Tuesday and so on. Then we need to build the
rows of the calendar, and it's going to
be the week number. Let's go and hold control
duplicate it to the rows. Instead of the weekday, let's switch the formats again over here to
the more and then, week number. So with that we got our matrix, our calendar. But as you can see we
have here all the weeks. I would like to reduce
it to only one month. That means we're
going to go and add some filters to our view. Let's take the order dates, put it on the filters, and the first filter is
going to be on the years, go and select the years. And let's select the last year, it we can, of course, go and offer it for the users, right click over here and show the filter on the right side. We can do the same
for the months. Let's go and take the order date and put it on the filters. Let's go for the month next, and let's select only one month and then offer it as
well to the users. All right, so with that we
got a calendar of one month. Let's go and search it from
standard to entire view. So now, as usual, we need a measure in order to
fill our calendar. It's going to be
the sum of sales, so drag and drop it and
put it on the colors. Alright, so that we can
see already that we have a heat map
inside our calendar. Now we need to just
add few stuff. For example, let's add some white porder between
those informations. Go to the colors and then
go to the porder and add a white color so that we get nice separations
between the days. Let's add as well the
day number in each box. In order to do that, we're going to go to the order dates, put it on the labels over here, and then here table, switch
it automatically to a text. Let's go and switch
it back to squares. Instead of having the years, we have to go and
format our dates, right click on it, and let's
go and select the day. Then the next step,
let's go and place those numbers of the days
on the top right corner. Let's go to the labels, alignments, and let's
go to right and then All right. So that we got a really nice
calendar in Tableau. Of course, you can go and switch to another month, let's say, for example, in February or
check another year 2021. And that's it, this
is how you can create calendar in Tableau.
140. Waterfall Chart: Alright, now we're
going to create in table the waterfall charts. It's very useful in order to show the flow of the process of your data and as well to show the analysis of part to whole. So let's see how we
can create that. First, we need a dimension
like the subcategories. Let's move it to the columns.
Then we need a measure. This time, let's
take the profits, track and drop it to the rows, and then let's change it from
standard to entire view. Now in order to have a
waterfall inside our view, we need the running total. In order to do that, let's
go to the profit over here, right click on it, and let's do a quick table calculations. Let's switch it
to running total. So that you can see, we have now a running total of our data, but still it is not a waterfall. In order to do that, we have to switch it from the classic pars. So let's go to the marks
over here to the gun pars. All right, so that we got the
basics for our waterfall, but now the size of each line
can depend on the profits. So let's go again and grab
the profit to the size. But if you check it closely, we can see that those
pars are not making the waterfall because they are
in the opposite direction. We would like it to be
starting from zero from the top. So in order to
make this effect, let's go to the sum
of profit over here, double click on
it, and then let's make it as minus. Click on that. And now exactly we
got what we want, so it's start from the
bottom to b and with that, we are forming the
shape of waterfall. So now we have to
add some coloring, let's go and get the profit,
put it on the colors. Now what we want to
do with the colors, if the numbers are positive, then it's going to stay blue. But if it's negative,
it should be red. In order to do that,
let's go to the colors, and edit colors. And now we're going to do
the following setup. So let's go over here and
make it only two steps. And then let's go
to advance over here and make sure that
everything in the center, so it is zero over
here. And that's it. So let's go and hit
ok. And with that, we can see very easily, where are the negative values in our waterfall and where
are the positive values. You can of course, make
it as green and red. So now the last thing
that we have to add to our waterfall is the total.
In order to do that, simple. Let's go to the
analyses on the main menu, and then we go to
the totals over here and let's add Show
Row grand totals. By doing that, we get our
total on the right side, and with that, we get a perfect waterfall
charts in Tableau.
141. Pareto Charts: Now we have the Perreto chart. It is very famous chart
in the statistics, and this chart is based on the Pareto principle where
it used the rule of 80 20. And the principle says
80% of the outcomes are generated from 20%
of work or efforts. And one way to visual
the Pareto charts, we can use two different charts. The first one going to
be the par chart and the second going to be
the line charts. So we can build that in tableau. First, we can start with
the dimension subcategory, drag and drop it to the columns, and then we need our measure. Let's check the sale drag and
drop the sales to the rows. Now, in order to have
the pareto effects, we have to sort the
data descending. So first, should comes the
data with the highest sales, and then we go descending
to the right sides. So what we're going to
do, we're going to go to the sales over here and sort it. Perfect. Now we have
the par charts. The next step we want to do
is to build the line charts. In order to do that,
we're going to go and get the sum of sales
and duplicated, hold control and
duplicate this fields. And with that, we've
got our two charts. So since the second chart can be a line charts, let's
go and switch it. So I'm going to switch the
sum of sales the second one. And instead of automatic, we're going to
have it as a line. And as well, I'm going to change the color to orange, perfect. As usual, we have to go and merge those two charts together. So let's go to the sum of sales, right to clickon and dual axis. And here, our chart is broken because the first
chart is automatic. So let's go to the
first one over here and switch it back to pars. All right, so we
are not there yet because we have to
work on the line. The line should be the
percentage of the running total. So in order to do that in
Tableau, it's really easy. Let's go to the sum
of sales over here, right to clicont and let's go
and add table calculation. Alright, so now we're
going to go and configure our table calculations
for the second measure, and as I said, here, we have to do two things. First, we have to calculate
the running total, and then we have to
apply the percentage. So in order to do
that, let's go and change the calculation
type to a running total. So let's go and select that. And with that, as you can
see in the background, we have a running total, but the principle
here is based on the percentage of
the running total. So we have to go and switch
this to a percentage. In order to do that, we can
click over here and say, add a second calculation. Let's click on that.
So with that we get a primary and
secondary calculations. The first one can be
executed as a running total, and then on top of that, we want to get the percentage. So let's go and switch it
from difference from the secondary to percent of
total. Let's click on that. And that's it for the
table calculations. Let's go and closet. And with that, we have
billed our parto charts, but let's understand what
is going on over here. Now, in order to
easily read this, I'm going to go to the
second one to the line, and let's put the
labels on top of it. And of course, the
principle says 80 20. That means 20% of those subcategories
should cover the 80%. And as you can see, we cannot say that's in this business. So if you took our subcategories in this example, you can see, it's not 20% we have around nine subcategories
in order to reach the 80%. So in this example, our business does not follow this principle. It's 80% of the sales are covered by 20% of
the subcategories. All right, so this
is one method on how to create parto chart in tau, and this is how you can read it. All right, so now we're going
to learn another method on how to create Pardo
chart in Tableau. This time, we're
going to go and use two different measures
using only one line. So let's see how we can do that. Now we have the business
question and it's ask us, do the 20% of the products
makes up 80% of the sales. So now let's go and get
the answer from the data. In order to do that, let's
get first our first measure. It's going to be
the sum of sales, drag and drop it to the rows. And now let's go and
get our second measure. It's going to be the
count of products. So in order to do
that, let's take, for example, the product
name to the columns. And T ACA here, we have a lot of members,
so add all members. So now as you can see,
we have a dimension, but we want to count
how many products. We have inside our data, so tic, and let's go to the measure, and then let's select
count distinct. So with that we got
our two measures. One more thing that
we need inside the details in order to
do the calculations, we need as well the
product name to be on the details
in order to use it. Alright, so I'm going
to go over here and switch it to entire view. So let's go to the
first measure, right click on it, and let's
add table calculation. Here, again, we have
the same stuff. We can switch it to
a running total, and then we're going to go and add a secondary calculation. The secondary
calculation going to be the percent of total, as well, let's specify
the dimension. Let's go and specify the
dimension to the product name, the same as well for
the right sides. It's going to be
the product name. All right, so that we got everything ready for
the first calculation. Let's go and close it.
And now, as you can see, we have already now the percent of the running total
for the products. Let's do the same
stuff for the sales. So right click on the sales and then let's go and add
table calculation. Let's go to running total, specify the dimension,
the product name. Let's go and add the
secondary calculation. It's going to be the
percent of total. Then the same stuff,
we have to go to the specific dimension and specify the product
name. All right. So that we have prepared everything for the
second calculation. Let's go and close it.
Now we have to go and switch it back to line since
we have it as automatic. Tableau decided to
go with the shapes. Let's go and switch it to line. Now with that we
are almost there, we have the running total of p of the measures.
We have our line. But as you can see, the line
is a little bit jittery, and that's because we
haven't sort the data yet. It's very important
for the Pareto charts that we sort the data, like we have done
in the method one. Now let's go and sort their product name by their
sales in order to do that, right click over
here and go to sort, and then we can sort
it by the sales. Let's switch it to a
field and let's go and select the sales from
the field name over here. Convert it, let's make
it as a descending. Perfect. Now we got exactly
the parto chart that we need. Now we have to check
whether it's true that 20% of our products. Make up 80% of our sales. So now in order to check that quickly and easily in the view, we can add the support
of the reference lines. So let's go and add
some reference lines. Let's go to the
analytics over here. Let's take here a
reference line. Let's drag and drop it
first to the first value. And now we can do instead
of having the average, let's go and switch
it to constants. And now here, we're going
to check whether the 20%, so it's going to be 0.2. And now with that,
we're going to get a reference line exactly on the 20% of the products.
Let's go and close that. So with that as you can see,
we have a very nice line indicates exactly the
20% on the products. The next step to that,
we're going to go and add another reference
line for the sales. So let's take a
reference line drag and drop it exactly on top
of the sum of sales. And now we're going
to do the same stuff. Instead of average, let's
switch it to a constants. And since we need 80%, it's going to be zero eight. With that, we've got exactly
the 80% of the sales. Perfect, now we have
our parto chart, and we can easily answer these
questions from our data, so we can say, yes, 20% of our products are
covering 80% of the sales, which is exactly matches
the rule of 80 20, the principle of the parto. All right, so this is the
two methods on how to create parto charts in tau and
analyze your business.
142. Butterfly (Tornado) Chart: Alright, now we have
the butterfly chart or we call it sometimes
the tornado charts. It is great chart
in order to analyze two different measures
by specific dimension. So for example, if you want
to compare the number of customers with the number
of orders by the category, then the butterfly
chart is your chart. So what do you need
first, the dimension, it's going to be as
usual, the subcategory, let's move it to the rows. And then as usual, I'm going
to move it as entire view. Then we need our two measures. The first one going to
be the customer count. Let's move it to the columns. Then the second one going
to be the order count. Alright, so with that, we have our two measures and
the subcategory. Now, in order to form the
shape of the butterfly, we have to have the dimension
exactly in the middle. And then on the right
side, we have one measure, and on the left side, we
can have another measure. So in order to do
that, we're going to use the place holder, the average of zero. So let's have it over here. And let's go and place it
exactly in the middle. So now with that, we have
the measure on the left, measure on the right, and
something empty in the middle. And then let's go and
configure this charts. It's going to be the middle
one, the average of zero. And let's go and
switch it to a text. Now the next thing we
have to go and get the dimension to the
text And with that, you can see, we've got now
the spine of the butterfly. Let's go and make it a
little bit more bold. I'm going to go over here
and just make it poles. But now we have to
have the two wings right on the right and the left you can see the right side is okay, so we
have it as a wing. Let's go and sort
the data by the way. But the left wing
is not correct yet. In order to do that, let's go to the count of customers
over here on the axis. Let's it the x, and let's
go and reverse the scale. So that we get exactly the
opposite in the scale. Let's go and close
it. And as you can see now, we got it perfect. On the left side, the
wing of the customers, and on the right side,
we have the order. Now the next step
is what we usually do is to add some
coloring, for example, let's stay at the customers over here and drag holding control, the count of customers
to the colors. And as well, we can go to the orders over
here and drag and drop the orders by holding
control to the colors. But of course, we
can go and customize the right side with using
different coloring. So let's go to the
colors over here and change the pattern,
maybe to orange. Let's say, as well, we can go and make the
text in the middle, a little bit more bigger. So let's go to the middle, and then let's make it
maybe something like 15. Now we can see
those subcategories in the middle very clearly. But since we have
it in the middle, we don't need it
on the left side. Let's go and hide it,
right click on it. And then let's go and
disable, show header. And as well, we can
go to the axis over here and as well,
disable the headers. Of course, we can
add more formatting in order to remove those grids. Right click over here on the
empty space to the format. And then we can go to the
columns tab and as well, remove the grid line. With that, we've got a
clean charts represent a butterfly or a tornado
depends on how you see it, where you can go and compare two different measures
by specific dimension. Alright, so now in the Mito two, we're going to bring
those two wings together. In order to do that,
we're going to get exactly the
same information. Let's go and get the
subcategories to the rows. And then as usual,
switch to entire view. Let's go and get our measures. The first one going to be
the counts of customers. And then the second one going
to be the counts of orders. But we have to put it now
on top of each others. And since we are using
the same type of charts, we're going to use the mejor
names and measure values. So take the order counts and
drag and drop it on top of the axis over here in order to generate the measure
names and values. Alright, so we have
those informations. Now we're going to go and
take the measure names. We don't need it on the roads, so drag and drop it to
the colors over here. And just to make sure that
everything stay as bars I'm going to go from here and switch it from automatic to bar. And now the next step, we're going to go
and sort the data, click on the axis over here
and then sort the data descending both of the values or the wings are on
the right sides. So now in order to have the
effect of left and right, we don't have here two axis. What we're going to
do, we're going to do a very small trick. In order to do that, let's go
to the customers over here, double click on
it and just go to the front before the
counts and put a minus. So let's go and hit enter. So with that, we get again, the effect of the
butterfly where we have the left and the
right wings together. But of course, what is
missing here is the spine, the dimension, the subcategory. So in order to do that,
we're going to do the same. So we're going to go
and have the average of zero as a placeholder. We have it now on
the right side. Let's go switch to it, and then we can
switch it to a text since we want to have a
text of the subcategory. Then the next step, we're
going to go and get the text. It's going to come from
the subcategory drag and drop it on top of the text. And with that, we got the values or the spine of the butterfly. The next step is that we're
going to go and merge them together in one charts
What we're going to do? We're going to go and
use the dual axis, right click on the average, and then here we
use the dual axis. But as you can see, those values are not yet in the middle, and that's because we haven't
synchronized the axis. Go to the average over here and then let's select
synchronize axis. And with that, we got the
spine exactly in the middle. But it's not really
clear because it's red. Let's go and change
those colors. Let's go to the average over
here, double click on it, and let's select complete
white. Let's click. And now the next step, as usual, we're going to go and
start hiding stuff because all those informations
are not necessary. So the average over here, let's go and hide it. And that's we we don't need the header informations because we have it already
in the middle. So right click over here
and disable show header. And with that, we get a very elegant and nice
butterfly charts in Tableau where both
of the wings together. And now we can go and analyze
the coloration between the number of orders
and the number of customers by the category. Alright, so this is how
we can create butterfly an charts in Tableau
using two methods.
143. Quadrant Chart: All right, so now we're
going to go and learn how to build quadrant
charts in Tableau. This type of charts is going
to go and present a lot of data points in one view
using two measures, and then we go and compare those different data points based on their position
on the quadrant. Then we go and split the chart into four different quadrants. This type of charts is
really great in order to do strategic planning or to do risk managements or as
well to find some trends. Now let's go and check in
Tableau how we can build that. The first thing that we need
is two different measures. The first one going
to be, let's take the discount and put
it on the columns. And then let's go and find
the average of the discount, right click on it, and let's go. The average instead of sum. So this is our first measure. Now we need another measure this time going to be
the profit ratio. We don't have it in our data, so let's go and
quickly create it. So create a new calculated
fields, profit ratio. And it's very simple, so
it's going to be the sum of profit divided by
the sum of sales. Okay. So that. Let's go and hit and then let's go and bring it to our rows. So that we got our two axis, but I would like to
have it as percentage. Let's go and change the formats. Let's go first to
the profit ratio. And then instead of numbers, let's go and switch
it to percentage. And then let's go and
remove those decimals. The same thing, let's do it
for the average of discounts. Let's go and format it as well. Two percentage. I'll
remove those decimals. All right, so that's
all for the axis. What do we need now is the
customers as a data points. So in order to do that, let's
go and get the customer ID, and let's put it on the details. So now, as you can see, each of our customers are
presented as a data point. Let's go and change
the visual of that. Instead of shapes.
Let's have circles. And let's go and reduce the opacity in order to see the overlapping
between those points. And as well, we can go and
make it a little bit bigger. Now we need two
values in order to split this chart into
four different quartants. And now here since we have
the titlezed dynamic, we want to offer
it to the users as parameters in order to
specify those two values. So now let's go and create two parameters in the data pane. So we can create the first one. Let's say select discount. So it's going to
stay as float and the display can be
as a percentage. Let's reduce the decimals. And then let's say that the
default going to be 0.15. So with that we're going
to get 15%. So that's it. The first one, we're going
to do exactly the same for the second one in order
to get the profit ratio. Let's create another parameter. And we're going to call
it select profit ratio. We're going to have
the same stuff again. So we're going to have
it as percentage, reduce the decimals, and
let's have it as a 10%, one. So that's it for this one. Let's go and close it
and show it in our view. Show parameter and
show parameter. Now we have it on
the right side. Next, we have to create
now a separation in our view in order to show
how the data are splitted. In order to do that,
we're going to add two reference lines. Let's start with
the profit ratio, right click on it and
add reference line. And then the value
going to depend, of course, on our
new parameters, select Pfitratio then let's
go and make the label empty. And then we can go and change the format instead
of having a line. Let's have a dashed one,
and then let's have the plaque and then
increase the opacity. And that's it. Let's okay and do the same as well
for the discount. So right click on the
discount, add reference line. We need our parameter. It's going be select discounts. Remove the label and
we'll do the same stuff. The customization, so we can have it as
dashed and as well, have it clear on our view. Now let's go and it or. Now, as you can see, we have
already our quadrant charts where we have splitted our data into four different sections. Of course, we can
go now and change those splitters using
the parameters. Let's got the buft ratio
and change it to 0.2. With that, we move it to 20%. Now, of course,
what is missing in our quadrant is the
colorings of those points. So each section should
has its own colors. And in order to do that,
we have to go and create another calculated field
to have those four values. Let's go and create one. Let's call it quadrant. Color. So now we have
to go and identify the position of each data
point inside our cordons. So let me just move it
a little bit over here. In order to do that, we
can use the FL statements. Let's start first identifying the points on the upper right. So all those points on the upper right. So how
we're going to do it? We're going to say if the profit ratio to the parameter value that is
selected from the users, so we're going to say select
and then the profit ratio. That means we are
checking whether the user on the upper section, and now we have to check whether it's on the left or the right. So we're going to talk
about now the discount and the average discounts as well, higher or equal to the value
selected from the parameter. So we're going to
select and discounts. So now we are targeting all the customers
on the upper right. So what can happen if the
condition is fulfilled? We're going to say
upper right. All right. So now we're going to go and do the same stuff for all
other three sections. So let's go and just
copy it from here. And then we're going to say SF. Then let's go and paste it. Let me just make it literleitqigger,
in order to see it. Now we're going to
do, we're going to go and target the upper left. In order to do that,
we have to go and change the discount to smaller. Now we are saying
if the discount is smaller than the selected
value in the middle. So that means we are
on the left side. What can happen, we
will just go and flag it with the following
value. Upper left. Then we have to do
the same stuff for, let's say, So now we're going to go and target
the bottom right. Let's call it bottom. For the discount part,
it is not correct. Let's move it like this in order to have
the right section. And for the ratio, in
order to be in the bottom, this time it's going
to be smaller. So with that we are
at the right side, and for the last section, in order to target it, we don't have to go and specify it. We would say just simply else because if none of those
conditions are fulfilled, we will end up by the last one. So we're going to call it.
Bottom left. Okay. That's all. Let's go and end
our FL statements and the calculation is
valid. Let's go and hit. And with that, we got our
new calculated field. Let's go and drag and
drop it to the colors. So as you can see, we
have a dedicated color for each different sections
inside our ardent. Of course, if the user goes over here and change the
values of the parameters, the coloring will react as well. Since we have the parameters
inside our calculated field. For example, instead of 15, let's have it as 0.25. So as you can see
the reference lines goes to the right
side to the 25%, and as well, the coloring
will be adjusted. So, that's all. This
is how you can create a very nice dynamic
quardan chart in Tableau.
144. Box Plot: Now we're going to talk about
the box plot inter blow or sometimes we call it
box and whisker plots. This type of chart
going to help you to understand the data
distributions of your data sets. This chart has a box and two whiskers on the
top and on the bottom. And then in the middle, we have the median and the
edges of the box so that we will get five
different numbers in how our data is distributed. Let's see how we're
going to build that inter blow.
It's really easy. Let's start as usual
with the sales. Let's drag and drop
it to the row. Then we're going to
see how the sub of categories are distributed
on those cells. Let's take the sub category
to the details first, and then we have to change
the visual to circles. Let's go to the marks over
here and change it to circles. Now in order to have
different charts, I would like to add the category to the columns over here, and then let's go and make it a little bit bigger to
the middle over here. Now let's go and reduce those circles a little bit in order to
have it more clear. With that, we have
the first part of the box blots where
we have circles. Next, we have to
get those numbers or the shape of the
box and the whiskers. In order to do that, we have
to add a reference line. So let's go to the
sales over here, radically connect and
add a reference line. And here, everything is
prepared from Tableau, if you go to the boxplot
over here, and that's it. Let's click. And
that's it, actually. With that, we got a
poxplot in Tableau. So now, if you go and
mouse over on the charts, you will get the five
different values, the upper whisk the lower
w the median and so on. Alright, so now, the question is how to read the boxplots. Well, there are a lot of
informations over here, but the first thing
that you can do is to compare the position of
the median of each box. If you have a loover
here, you can see that those two boxes are
at the same level, so they are very
similar categories. But if you check the
office supply that you can see the median
or the box itself, it is below those
two other boxes. This can indicate for
us that the furniture and technology has the
same distribution, but the office supply
has a different one. Another thing that you can check is the size of the box itself. If the box is tall or the
lengths of the box is long, then that means the
subcategories inside this category are not really similar and they are far
away from each other. But if you check
the office supply, you can see that
the box is shorter. So the links of this box is smaller compared
to the other two. That's going to give us the
information or the hint that the subcategories
of this category, the office supplies
has a similar sales. So that means if we
have a shorter box, the members of this category going to have a
similar behavior. But if you have a toll box, that's going to suggest that the members of those
information going to have different sales. But if we have a
big or tall box, that means the members of this category gonna have
different behavior. And, of course, this
type of charts can help us to find the outliers, especially on the upper
and on the lower whiskers. Alright, so that's all about
the box plot in Tableau.
145. KPI: Okay, so now we're
going to talk about the KPI charts, key
performance indicator. We usually use it in order to analyze the performance
of our business, whether it is succeeding
or failing. All right. So now let's go and
build a KPI in order to track the performance of
our sales in our business. So let's go and do
that. As usual, we're going to go and get the
subcategories to the rows. Let's take the sales as
well to see the numbers. The next step, let's
say that we want to check the sum of sales
for each country. Let's go and grab the country
field to the columns. Then the next step,
we have to define the core of the QBI, the rule. When the sale is going to be
considered as a success and when it's going to
be considered as fail or maybe in between. What we have to do is
now to go and create a new calculated field in
order to define the QBI rule. So now let's go and
call it QB colors. So now by checking the data, let's say that if the sum of
sales is higher than 50 K, then it's going to be
considered as a success. Or if we're talking about
colors, it's going to be green. We're going to work
with the FL statements, so we're going to check
whether the sum of sales is higher than 50,000. Then
what's going to happen? We're going to say it's green. So now the next step we have
to define the second rule. Let's say that if the sales
is between ten k and 50 K, this can be medium
or let's say orange. So let's go and build
that using LSF sum of sales less or equal 50 k and the sum of sales
we are making like a range is higher than ten k. Let me just make it
a little bit bigger. Then what can happen?
It's going to be range. All right. Then we
have the third rule. If it's not in between or
not higher than 50,000, then it's going to
be less or equal to ten k. What we're
going to do at the end, we're going to say L
it's going to be red. That's it. Let's end it. This is our KB rule in order to track the
performance of the sales. Let's go and hit ok
with that we got a dimension here on the
left side, the QBI colors. Let's go and grab it and
put it on the colors. So the next step, let's go
and assign the correct color, double got it almost correct. Let's addit the colors,
the rage is orange, red is red, but the green is blue. Let's go and switch that. And with that we can immediately track the performance
of the sales, where we can see immediately where we are performing good, so we can see those
green numbers or we are performing bad
by the red numbers. But if you saw any
KBI dashboard, you will see that they are
using a lot of shapes. So now instead of those numbers, let's go and get shapes
assigned to those three values. So that means we
can go to the marks over here and switch
it to shapes. Now, things are ugly currently. So let's go and take the sum
of sales to the details, and then we're going
to take the KB color to define the shape
of our visual. So with that we got
different shapes for each level of our KBI. But I would like to change it. So let's go to the
shapes over here, and then let's go to the default and then
switch it to QBI. So now we have better
icons for our KBI. Let's go and switch stuff. So green, it's going
to be this icon. Orange it's going to be this, and then the red, it's
going to be the red one. All right, so that says,
Let's go and hit or K. And now we can go over here
and make it entire view. And as well, change
the size of our KBI. And with that, we've got a
nice KPI where we can see immediately where we are doing good and where
we are doing pads. So this is how we can
create KPI in Tableau.
146. Bar Chart & KPI: All right, now we're
going to learn how to combine a QBI together with any other type of charts like for example,
the par charts. So now we're going
to go and build view in order to compare two years. In order to do that, we're
going to get the same stuff. So let's get the
subcategories to the rows. And then here we have
the sales of 2022. Move it to the
columns over here. So with our par charts, but I would like to move it from automatic to par in order to make everything stable and not later break in
our visualization. So the next step,
I would like to go and add as well the coloring. So let's take the sum of sales 22 and put it in the colors. And now the next
step, let's take the 2021 as a reference
inside our view. So let's move it to details, and then let's go to the axis, right it click on it, and
let's add reference line. So here we would like
to have the value of 2021 for each category. So let's switch it to per cell, and then select the 2021. And then let's go
and hide the labels. This is only customizations. Then let's move it to a little
bit heavier line and then increase opacity and as well change it to orange. That's it. Let's go and hit. Now in order to see
the data better, let's switch it from
standard to entire view. And with that, we got a reference
from the previous year, and the parts are
the current year. That you can see
quickly, the differences between the two years, but we are not done yet. This is only the bar charts. Now we have to go and
add a KPI for it. Here we have to
define the rule of the KPI and this time
is going to be easy. If the current year is less than the previous year,
then it's going to be red. If it is more or equal,
it's going to be green. Let's go and define this rule. As usual, we're going to go and create a new calculated field. We can call it KPI. Colors. Now we're going to go
and define the rule, we use as well,
the FL statements. If the sum of sales
of 2021 is higher or equal to the sum of sales
of 2021, then we are safe. It's going to be green. Let me just make it a little bit bigger in order
to see everything. But if the condition is not fulfilled, what's
going to happen? We will have bad performance, so it's going to be L,
red, and then ends. So this is our rule.
Let's go and hit OK. So now for the QBI, we need another chart inside this view. But since it is
like a dimension, if we bring it to the view, it will not split into
two different visuals. So in order to generate
another chart, we will use the trick of
using the average of zero. So we have to create a
placeholder, average of zero, and with that, as you can see, we will get a new chart
on the right side. In this measure, we will
go and configure our KBI. Let's go and switch
to this marks, and now we're going to switch
it from bars, to shapes. It's like we are
building any other QBI I will go and get rid
of those informations. Now we're going to go and get
our new calculated field, the BI rule and put
it on the shapes. Next, we're going to go and
define the shapes of our KBI. Let's click on shapes. Let's say if it's green, then it's going to go up and if it's red, it's
going to go down. That sets for the
shapes, click OK, as well, we want to change
the coloring of those stuff. Let's take the KPI colors, hold control and put
it on the colors, and let's go and assign it. So dit colors, green can be
green and red can be red. So that's it. Click Okay. So now we have our KPI
on the right side. We can go and make
it a little bit bigger in order to
see the shapes. So now we have two
different charts. The next step, we're going
to go and use the dual axis. And that's because they
have different shapes. So let's go to the right sides. And have the dual axis. As usual, we're going to go and synchronize the axis
and remove one of them. Let's go to the average as
well and then go and disable. Show header with
that, we hide it. With that, we got the two
QBs on top of each others. But still here we have an
issue, as you can see, the icons of the QBs are exactly on the top of
the edge of the bars. That's because
everything is starting from zero and we have
here the average of zero. Now what we're going to do we go to move it a little bit to the left side using
the negative values. Let's go to the average
of zero and switch it from zero to minus ten k. So that we can see our KP is perfectly on the
left side of the bars, and we can see immediately
where we are doing bads. So here we can see
that almost all of the subcategories
are doing grades. So we have all
those green icons, but only two the envelopes and the machines are doing bads. And that's because the
sales of the current year is less than the sales
of the previous year. So that we have
learned how to cobine the KPI charts with
any other charts, it should not be a bar charts. It could be an area
or a line charts.
147. BANS: Okay, so now we're going
to create bans in Tableau. There are those big
numbers that you can see usually in
KBs or in dashboards, where you're going
to see the total of something like the
total of sales, the totals of profit, how many customers do we
have inside our datasets. So it's very common and you can see it almost in each dashboard. So let's go and create it. So what we're going to do first, we have to go and switch. Our visual from
automatic to a text. Since we are working with text, there is no charts
or any visuals. So let's take the sales
and put it on the text. So now with us, we got one
number without any charts. Only one big number, the
total sales of our data. Now we can go and split it by
a dimension like a country. So let's take the country, boot it on the columns. So now we can see the total
sales of each country. So now since we are
talking about pans, those numbers should
be really big. So in order to change that, let's go to the text over here, click on those three points, and then let's go to the sales. Make it really big. So we're going to go to the
size over here. Let's take, for example, 22 and make it pooled. And then you can check
by hitting apply. The size of those
numbers, they looks good. Now let's go and hit, and let's make the
alignments correct. Let's have everything centered on the horizontal
and the vertical. Now, Drex said we can go and change the format
of those numbers. Let's go to the sum of sales
over here and go to format. Then we can go to the numbers over here in order to
change the format, Let's go for custom. So there's no decimal
places. Let's make a zero. And then let's say
we're going to display the unit as 1,000 as a k. And then we can add the dollar sign on the briefix over here. So let's
go and do that. So that's all about the formats. Let's go and closets from here. And now with that, we have
created really nice pans. For our dashboard, we can go and make a
little bit bigger. Not see those numbers. And now you might
say, You know what? I would like to
have those texts. Beneath the numbers,
not on top of it. Inder to do that's what
we're going to do, we're going to take
the country again, and let's put it to the text. And with that, we're going
to get the text below it. But of course, we have
to make it really small. Let's go to the text over here, then to the three points, and then let's go
to the country, remove the pled and let's
move it for example, like 12. All right. Now let's go and hit a line in order to
check the formats. So as you can see, we've got those small text
beneath those numbers, but we can go and as
well reduce it to ten. To make it really small
beneath those pig numbers. So now let's go and hit okay. And with that, we got
really nice small text below our numbers. But we still have an issue where we have the header informations. In order to remove it, just go to any values like
Germany over here, right click on it and
disable the show header. And with that, we
got really nice pans where the text is
below the pig numbers. So as you can see here, we
didn't use any type of charts. We just used the text in tau.
148. Funnel Chart: Now we can learn how to build
a final chart in tableau. Final charts are really
great in order to show the progress of your data
through different stages. Let's see how we can build that. Let's take the seals
and put it in the rows, and now we want to
see how the seals are progressing through the
different subcategories. Let's take the
subcategories from the products and put
it to the colors. Now, the next step, we
would like to change the size of those blocks
based on the sum of sales. So in order to do that,
let's take the sum of sales by holding control
and put it to the size. And now let's go and
switch it from standard to entire view in order to see
the size of each block. And now we need to form
the shape of the funnel. In order to do that,
we're going to go and so the data descending. So the biggest one is
going to be on top, and then we go to the small. So in order to do that, let's go to the subcategory
of our here, radically con and
let's go and sort it. And then we have to change
the sort pie to a field Then move it to descending. And that's it, as you can see, from the background, we have
now the shape of the funnel. Now the next and, as well, the important step
in the final chart, we want to show the percentage
of total for each block. In order to do that,
let's take as well the sum of sales and
put it to the text. And with that we
got the total sales for each subcategory,
but we don't want that. We want the percent of total. In order to do that,
radically connect and let's go to quick
table calculations. Then let's pick the
percent of total. Great. So now we have those
percentages on the funnels, which is very nice
on the final charts. Let's go and add as well, the text of the subcategory. Let's take the subcategory
and put it to the labels. So now we can go and customize our view a little bit
where we say, Okay, let's put the text of the subcategory on
top of the sales, so switch the order. And then let's go and
change the labels and make the subcategory a
little bit bigger and polled. Let's say, as well, we can go and remove
those grid lines, right click over
here to the formats. Let's go to the
lines, and then let's go to the zeros over
here and make it none. Alright, so that is more clean. What we can do, we can add
the category to the filter. So let's go to the category, show it as a filter. And with that, we
can go and select specific category in
order to see the data. So with that, we get
less blocks inside the final chart or you can go and add all of
them. So that's it. This is how we can create final
chart in Tableau in order to track and check the
progress of your data.
149. Progress Bar: In our KBI departs, we can add stuff
like a progress bar. Let's see how we can
build that in tableau. Now let's go and get a dimension like the country to the rows, and then we're going
to go and track the progress of our
sales as a progress bar. In each progress bar,
you have like 2 bars, the one in the
background for the 100%, and then your actual progress. That means we need
two bar charts. Let's stick with
the first one and switch it to bar, and as well. Let's show that text. But now instead of
the total sales, let's go and switch it
to percent of total. Let's go and switch our sales to a quick table
calculations 2% of total. Now the next thing,
we're going to go and add the background bar. So in order to do that, let's
go and add our placeholder. It's going to be the
one average of one. So now we got our background on the right side and
on the left side, we're going to get
the actual progress. Let's go and merge them
together using the dual axis. Right click on the right one and then move it to dual axis. Okay, so as usual,
we're going to go and synchronize those two axes, and let's go and
make it a little bit bigger in order to see the bars. So now we can see
that the average the background is in the front. In order to switch that, let's go to the axis
of the average, dicli on it, and then
here we can say, move marks to the
back. All right. So now on the next
step in order to get the effect of
the brokers bar, we have to change the
coloring of the background. So let's go to the colors, edit, and then let's
select the average and let's take the blue. Let's select something lighter. So let's take a light blue. Apply. Okay. All right, so with us, we get the
effect of the progress bar. Let's go and hide
a few stuff like, for example, the x over here. And as well, let's hide those
numbers on the background, so let's go to the
labels and hide them. Alright, so that's it.
This is how we can create a really nice progress
bar in Tableau where you can put it
inside your dashboards.
150. Choose the Right Chart !: All right, so we
learned how to build 63 charts in Tableau and
what are their use cases. But you might be still
overwhelmed with all those options and all
those charts in Tableau. And it's still not that clear
how to answer the question. How do we know which chart, which visualizations
that we have to pick. So that's why we're going
to go now and summarize and group all those charts
under different categories. So we have the change over time, magnitude, part of whole, creations, ranking,
distribution, spatial and flow. And each of those
categories is going to focus on a specific question, specific problem in order to answer it using
visualizations. So now let's go through
all those categories one by one in order
to understand them. Alright, so now we're going
to start with the first one and the most basic
category we have, the change over time, or sometimes we call it
trends over time. This category is going
to show us the trends or the patterns over a
continuous period, it usually answers the question, how does the data
change over time? Or another one, are
there any trends or patterns that we can uncover
from the data over time. You have this kind of questions, then you are talking about the category, change over time. And the best chart
in the category, we have the line charts. Because the line chart
focus only on one thing, the changes over time,
the trends over time. Because mainly the line chart focus only on the
changes over time, the trends over
time, nothing else, as well, visually, it makes it really easy to spot trends. As we learned before,
we have multiple charts that covers the topic
of change over time. Of course, all the line charts usually are change over time. So we have the line chart
as the perfect one. Then we have as well
the spark line charts. We can use it if
you want to have a compact charts for the
trends analysis over the time, or we can use the
sloppy charts to see how the ranks is
changing over time, or as well we can
use a par charts. So we can use the parts as well in order to
analyze the changes over time and as well to go and compare different
time period together. Not only the par charts, we
can use any type of a charts, for example, the area chart. Here we have
different use cases. One of them is the
change over time, and as well to go and compare different categories together. And as well, we can go and
use the calendar chart or the circle pupple time line in order to visual
the change over time. As you can see, if you want to have only one use case inside your visualization to show the change or the
trend of our time, then go with the line charts. If you want to go and cover multiple use cases in one chart, then you can go and use
the area chart bar chart or the circle time charts, because they don't focus
on only one use case, they can cover
multiple use cases, and one of them is
the change over time. All right, so now we have
the magnitude category or sometimes we call
it size category, and it uses the size in
order to compare values, so we could use relative or absolute values
in this category. So for example, if you have the following task or question, find out the highest and the lowest sales
of the categories, or we have to go and compare the different categories
by sales in one chart. If you have such
questions or task, then we are talking about
the category, magnitude, and the best chart for this question is the
bar chart because it makes it very
easily and clean in visualizations in order
to compare values. You can compare very easily
the data by comparing the length of the bars
of each category. Under this category, we
can find multiple charts, and most of them are par charts. We can use the raw bar
chart as a main one or we can use a bar chart
columns, as we learned before. If you have a dimension with high cardinality, you
can go with a row. But if you have a chart
with low cardinality, then go with a column. Hose two charts only
cover one dimension, but if you have
multiple dimensions, then you can go with the side by side bars or the stacked
bar charts or as well, the full stacked bar charts. Then we have different
charts under this category like
the pop charts, pupple charts, and
the scatter plots. You might ask why scatter plot
and Y pupplechart because the size of the pubble can
be used in the analyses. So we can see immediately
that the technology and the furniture has the highest sales from the
size of the pupple. Thing goes for thecterplots. Here again, it's really
depends on how many questions you want to cover in
one visualizations. If it's only one use case
to go and compare the data, then go with the R par chart
or the columbar charts. But if the size comparison is not only the use case
that you want to cover, you want to cover
multiple stuff like adding multiple
dimensions and measures, then you can go with the other charts
under this category. All right, now we have the
category part to whole. It shows how a whole or value breaks down into its components, and how each component contributes to the
whole to the total, and it's going to show how each component contributes
to the whole to the total. So if you have a
question like, how does the value contribute
to the total, then we are talking about
part to whole category. And the best chart to visual, the answer is the Pi charts because visually it's
very easy and as well, very effective to show
how each slice of the Pi contributes
to the whole pile. In this category,
the part to whole, we have different chart types. Like as we said, the main
one is the pie charts, but we can go and
use the dona charts. Especially if you want
to show the information of the whole, the total, so you can present it in
the middle and around it, you're going to have the slices. Or we can go and
use the part chart, for example, the full stacked part chart or the area charts, the full stacked area charts, as well, you can go
to the tree map, if you want to analyze not
only the part to whole, but as well, you want to
show the hierarchical data. And as well, we can
go to the waterfall in order to show part
to whole and as well, the flow of the data. Here again, if you
want to only focus on the part to whole use case,
go with the pi charts. But if you want to
add more information and analyze different use cases, then you can go with
others. All right. Now we're going to talk about
very important category. We have the correlations. It's going to show the
relationship between two or more measures
in one visualization. This category can
answer questions like, is there any relationship
between two measures or how strongly related are two
variables or two measures. If you have such a
questions, then we are talking about the
category correlation, and the best chart
in order to visual, the correlation is
the scatter plot. The scatter plot is
very effective in order to show the relationship
between two measures. And it covers a lot
of use cases like discovering the outliers.
It's very flexible. We can add a lot of information
to each data point, and as well, it can help
us to build clusters. Question to show the relationship
between two measures, the best chart is to
use the scatter plot. And underneath this category, we can find different
type of charts, not only the scatter plot, but scatter lot is
the favorite one. So we have the quadan charts. We can use it as well to analyze two measures
and as well to cluster our data or to
split it to four sections. Or we can go and use
the dual line charts. If you want to see as well
the changes over time, not only the delation but you
can see the trends as well. So we can go and use
two lines in order to analyze the coloration
between two measures, or we can go and use one
line and 1 bar charts. Color and as well, we can
go and compare the sizes of each Moving on to
another chart which is very beautiful in order to go and compare two measures. We can use the butterfly
or tornado charts. The last one, you
can use as well, the histogram in order
to find the correlation between two charts
and as well to show the distribution
of your data. Again, if you want only to
focus on the correlation, nothing else, you can go
and use the scatterplots. But if you want to go and
add different use cases like the change over time or the distribution or
comparing the sizes, then you can go and
use the other ones. Moving on, we have another
category called ranking. We use this category if the
most important thing to show is the position of
the item in a sorted list. For example, if you want to show the ranking of customers, the top ten customers
by the sales, or the lowest ten
products by the sales, then we can use the
ranking category in order to solve those tasks. Charts in this category
is the par charts. Be par charts are really
amazing in order to build a list and as well to go and compare different ranks
together. All right. In order to show the ranking, we have different
types of charts, the basic one as we saw, we have the par chart,
whether it's raw or columns. Then we have different
charts if you want to add more informations or more
use cases in one chart. For example, the Lolipp charts, where you can go and put
one extra information inside the circles or you
can use the sloppy charts. Here, not only we are seeing
the ranks between countries, but we can see how they
are changing over time. We have other charts
like the final chart or the pump charts as well, here we can show the ranks, how they are changing over the time The last one,
we can use as well, the butterfly in order to show the ranking
of the categories, for example, here, and as well, the coloration
between two measures. Again, as usual, if you want
to focus only on ranking, only on this, you can go
and use the par charts. But if you want to go and cover multiple use cases
in one visual, then you can go and
use the other charts. All right. Now we have the
distribution category. We can use it in order
to show the values of the data sets and the
frequency of their occurrence. If you have the
following question like, what is the distribution of customers age or if
the question is, what is the busiest
time in the workday? If you have such a
type of questions, then we are talking about the
distribution category and the pat chart to visual
those questions and the answers is to use
the histogram.Histograms are amazing way in order to
show the patterns using pens, and it's going to
make it very easy to understand the
distribution of the data. Under the distribution category, we can find different
type of charts. The main one going
to be the histogram. We can go and use
different type of plots like the box
plots in order to see the distribution of data as well for the dot
plot over the time. As well, we can go and use the scatter plots or
the quadrant charts. In order to see the
distribution of our data, and as well to show the
coloration between two measures. We can go and use as
well the barcode charts. For example, here we can
see the distribution of each product in
each subcategory. As well, the paper
chart considered to be a distribution chart. Again, if you want only to
focus on the distribution, then go and use the histogram. But if you want to cover
multiple use cases in one view, you can go and use
the other charts. Moving on, we have
the spatial category. Use it when the
geospatial pattern of your data is the most important thing that
you want to show. If you have questions
or tasks that involves informations
about the location, like country, cities, states, like, for example,
you want to show which city has the
highest sales, then we're going to go with this category, the
spatial category. Of course, the charts that you're going to use in this type of visualizations is
the And in this course, we have built four
different maps. The first one, the field map or we call it choroplith map. So, as you can see the states
are filled with colors, or we can go and use
symples here we are using the star in order to
show the sales for each state. Then we have learned how
to customize the maps. For example, here we have
created the night vision map. All right. So now we're
going to talk about the last type of category.
We have the flow. We're going to use it
in order to visual the movements or the
flow of our data. If you have a question
like how the data is moving from one point
to another point, then we are talking about
the category of flow. One very common chart
in order to show the flow of the data or
the process of the data, we can go and use the
waterfall charts. With this chart, you
can see the movement of data or the flow of the
process of your data. As well, we can analyze
here the part to All right. So what do we have covered the eight different categories, and we mapped
different charts that you have learned in this
course to those categories. As you can see, the
process is really simple. In order to understand
which chart of visualizations you
need in your projects, first, you have to understand the questions that
should be answered. Once you understood the task
or the business question, you can go and map it to one
of those eight categories. And after that, you're
going to go and choose the best charts within each category in order
to answer the question. And with that, you have
learned the process of choosing the right
visualization, the right chart
for the question. Make sure to check
the description. I leave their link for the
visualization sheet sheet. And as well, you'll
find the table file, where I have sorted all those charts under
the eight categories. Alright, so with that
we have learned how to choose the right chart
for your requirements, and with that, we have completed
the table chart section. Now in the next
section in our plan, we going to learn
how to create and design our dashboards
in Tableau.
151. Introduction To Tableau Dashboards: A dashboard. Now we can learn
the basic principles about how to structure our chart
inside dashboards in Tableau, and we're going to
focus on the containers in order to structure
our dashboard. So once we build all
those beautiful charts, we can go and group them in one place using Tableau
dashboard. So let's go. Okay, so if you create
a new dashboard, you will get different
options on how to customize and design
your dashboards. So for example, we
usually go and start changing the size of our
dashboard of this white space. So in order to do that, if you go to the size on the left side, we have here three
different options, fixed size, automatic range. What I usually do, I
go to the fixed size. So here we can go and customize
the width and the height. So for example, let's
s with the width with 1,200 and for the
height with hundred. And then beneath that,
we have a list of all worksheets that we have
insides, our dashboards. And then here, it's
really important is the objects that
we have in Tableau. So here we have a list of different objects
like containers, text extensions, images,
blanks and so on. Those objects, you
can use them in order to build up your
dashbards in tableau. And the very important
objects here, we have the containers in
tableau and they are really confusing if you are
new to this tool. So we will be focusing
on how to work with the containers in order to build the structure
of our dashboards. So the first question
is, what are containers. Containers in tableau can
allow you to group up different tableau objects
together in one place. The objects could be
anything like worksheets, blank text images or
even another container. Once you have all those
different objects in one place, you can
do many stuff, like, for example, moving them all together using the container from one position
to another one. So let's have a quick example. Let's take one of
those containers. Let's take the
horizontal container and drop it to the middle. And here's the first
thing to notice that that's the
coloring in tableau. As you can see, we have now a dark blue
border around this space. The blue border can indicate
that this is a container. Now we can go and drop anything
inside this container. It could be a worksheet. It could be a text.
Plank anything. Let's go with any sheets. For example, I have
one prepared one, drag and drop it exactly in
the middle of the container. Now you might note
that we don't have any more the blue
color, the blue border. We have now a gray border. That means in
Tableau, currently, I'm selecting an object
that is not container. Now we can go and grab anything, like, for example, a text. Let's take this object and drag and drop it on
top of this charts. And here, let's
write anything like the sales dashboards and just make it a little
bit. Bigger. He. So now with this,
you can see, we have another object that
contain only a text, and as well, it
has a gray border. So that means we
have one object with gray border and another
one with gray border. So now the question
is how to select the container that has
those two objects. There are many ways
in order to do that. So for example, let's say
we are selecting the text. If you go over here to those two lines and double click on it. So once we do that, as you
can see now, we have, again, this blue border, that means we are now selecting
the whole container. So that means by double clicking on this small icon over here, you are going back
to the container that's grouping
up those objects. There's another way in order
to select the container. Now let's go inside it and only click on the
sheets over here. Again, we have this gray border. Now if you go to this
small arrow over here, we're going to get more options, and then here we
have the option of select container
vertical container. Once we do that, we will go
back again to the containers, where we have those
objects inside it. This is another way in how to select the current All right. So now, you might
ask, you know what? Why we are selecting
the container, Well, for the following reason. For example, if you are
just selecting this charts, you can go over here,
and you will get different options
about the worksheets. So for example, you can show
the titles, the filters, the highlights, and you can configure only this worksheets. Those options are only
related to these objects. But now, if you want to go and configure the whole container, you have to go to the container. So for example, let's go and Dublilis if you go to
the options over here, we will get completely
different list of options. And anything that you are
selecting here can be reflected for all objects
inside this container. For example, in the
current container, table can show us there is still space left inside this
container in order to fill it. So the whole space over here is not used, which
is naturally good. And as you can see, we
have the text objects is way smaller than the
worksheet object, which is now fine, but what you can do in Tableau is that, you can go and split
everything evenly. So if you go to the
containers options, you can see over here,
distributes contents evenly. So if you sell like
that, what can happen, as you can see Tableau
can go and automatically, split the size of the container
evenly for all objects. This is really
helpful if you have different charts
in one container. So Ta're going to go and split the space evenly
for all objects. So as you can see, the
options of the containers can affect all the objects
inside the containers. And one more thing to
notice in Tableau that Tableau is knee key container
always on the right sides. This container is a
special one where Table can put all the
filters, legends, highlighters, and as we parameters always on top of each other's on
the right sides. So for example, in
the subcategories, we have the filter
of the order date, and immediately
Tableau can create a special container
on the right side and can place the
filter inside it. So for example, if you take any other charts that
contains those informations, let's take this one over here
and put it on the bottom. You will see Tableau
immediately going to go and add the filters inside the worksheets
beneath the first one. So here we have the filter of
the categories that comes, From the charts. And if we take the next one, the
customer distributions, as you can see,
we'll get a lot of filters in Tableau
on the right side, and as well the legends. So here we have
the profit sides, here we have the country
colors and so on. So all parameters, all legends, or filters go to be
packed on the right side. And of course, if you
want to customize the container that table
creates on the right side, you can go to any objects
and then double click on it, and then you can go
and customize it. So, for example, I can
go over here and split everything evenly. All right. Moving on about the
containers in D, we have two different types, the horizontal container
and the vertical container. Let's start with the first
one, the horizontal container. If you use this type,
what can happen, all objects inside your
horizontal container going to be side by side
next to each other. So let's try that. Let's take
the horizontal container, drag and drop it
to our dashboards, and then let's take one
sheet, for example, the subcategory over here, and then let's take another one. So once you can select
it, as you can see, Table can offer you either to put it to the left
or to the right. For example, let's go and
drop it to the right. And with that, we've got
two charts side by side near to each other's using
the horizontal container. Of course, if we go
and add anything, it's going to be
as well, either to the left or to the
right or in the middle. So once you drop it, you will get it as well, side by side. So this is how the horizontal
containers works in Tau. The next time we have
the vertical container, what can happen here? All objects inside this
container are going to be on top of each
other's like the stack. So let's have a quick example. Let's take the
vertical container, drop it to the dashboard, and then let's take any charts, and we'll drop it over here. And now, once we
select another one, we can put it, for example, below it and the third one either below in the
middle or in the top. So let's drop it in the top. So as you can see the
vertical containers, we are putting those objects or those charts on top
of each other's. So that we are stacking the objects on top
of each others, and this is how the
vertical containers works. One more thing about the type of containers, which
is very confusing. Starter in Tableau, that you
can decide on the type of container as you are
dropping the second objects. So let me show you what I mean. Let's take for example, the
horizontal container drag and drop it to our dashboards, so now we can go and drop different sheets next
to each other's rights. So let's take the
first one as usual. Let's put it over here. And now we come to
the second sheet and our expectation that's we can put it either
to the left or to the right because we have
horizontal container. Second sheet or the second
object is a special one. You can use it in order to change the type
of the container. So let's take for example,
this one over here, you can see we can put it
left, we can put it right. But as well, we can put it
on the top or on the bottom. So once I drop it to the bottom, what can happen table
going to go and convert the type of this container
to a vertical container. So now we cannot go and change our mind. It's
going to be fixed. This is going to be a
vertical container. So for example, if I
take the third one, t change my mind by putting it to the
left or to the right. I can put it only to the
top or to the bottom, so it can stay as a vertical, and the third one will not
change the container type. Here I can drop it for
example here at the bottom. On the second sheets, we still
have the option to change our mind to make it either horizontal or
vertical container. Depends on how you are
dropping the sheets. But after that, for
the third sheets, you don't have anymore
those options. You can drop it only depends
on the container type. Alright, so now, the
more thing that we put inside our container, the things gets more
complicated in order to control the structure
of our dashboards. So there will be a lot of nested containers on top
of each others, and you will lose
control with the time if you are building a
complex container. And for that, table did provide a view of the current
structure of our dashboard. So now we are currently at the dashboards in order
to go to the view, let's go to the layout. So let's switch that.
And then here in the pton we have something
called item arch. So here we will see the
structure of our dashboard. So it starts with the tilts. So if you click on that,
you can see table can go immediately and select.
The current objects. So he will see the structure
of our dashward and it starts with still since
we are using these methods. So if you click on that,
table going to go and select the current
object in the hierarchy. So this is the highest
container where we have everything in our
dashward inside it. So let's go and
expand our hierarchy. So you can see that it then splits into
horizontical container. And that you can see it clearly, we have one container for all those filters legends and so on. And on the left side, we have a container for
all our worksheet, and you can see
that by just like moving this slider over here. So as you can see,
the first object is horizontal container. Then inside the
horizontal container, we have two vertical containers. So the first one going to be this container for the chart, and as you can see, things are stacked up on
top of each other. So this is our first
vertical container. And if you click
on the second one, now we are selecting the
container on the right side, and it's as well a
vertical container, as you can see,
all those filters and stuff on top of each others. And then, of course,
we can go and expand those containers
to see the content. So as you can see we
have here three sheets inside the first container, and in the second one
we have three filters, and then we have
those two legions. So having this item here a key, it can help us with
a lot of stuff. For example, it can help us to understand the structure
of our containers, how things are nested to each other's and another
use as well to understand whether we have made any errors by building
the containers. So as you are dropping stuff
inside your dashboards, weird stuff might happen
in Tableau where you are creating way more
containers than you need. And it can help us as
well to select stuff, for example, if I would like to select the horizontal container. It can be a little bit harder by double clicking on both
different objects. It's going to be easier
if I go over here into the item hierarchy and just click on the
horizontal container. So can see, it's
really easy to go and select stuff inside
the item hierarchy. And as well here, we can
go and have options. For example, let's go to the
subcategories over here, right click on it,
and with that, we'll get all the options
of the worksheets, or if we go to the containers, you will get the
containers option. So the item hierarchy are really important in order to
structure our dashboards. Alright, moving on, we're
going to go and learn how to drop objects
inside the container. Now, just to make things easier, I just went through
all the worksheets. I removed all the filters,
legends, and so on. Just to keep things simple. So, for example, let's go and start with the
horizontal container, drag and drop it
to the worksheets. So now let's take an object like the sheet and drag
it to the view. Table can show you
different visuals to indicate what can
happen if you drop it. So for now, everything
is gray and we have a clear border
of the container. That means now we are dropping the objects inside
the container. So once I release it over here, what can happen if
we go to the layout, You can see the
horizontal container contains the work sheets. So that means with this action, we placed the objects
inside the container. Let's check another options. Let's go to the dashboard over here and take another sheets. So now if you drag it, and as
you are moving your mouse, you'll find different
shapes and different stuff. So for example, if you move your mouse a little bit to
the lift, you can see that. The gray line is
on the left side, and the container, the
blue container is marked. This is going to
mean if you drop it, Tau can add it inside the
container to the left side. If you move it to right, can happen the same stuff
path to the right side. So as long as Tau is highlighting the dark blue
color for the border, it means we are dropping the objects inside
the container. But now check this. If you keep moving your mouse
to the right sides, you will see that
table can change the color from dark
blue to light blue. That means now we are dropping the objects outside
the container. So let's go and
do that. I'm just going to drop it to
the right sides. And now let's go
to the layout in order to understand
what happens. As you can see, the first sheet is inside the
horizontal container, but the second sheet is completely outside
of the container. So if you just
minimize it over here, you can see that it's not inside the horizontal container. That means you have to
be really careful how we are dropping the objects
inside dashboards. Table can react differently
depends on the shapes. Now let's go and
drag a third one. Let's take the
customer distribution. Now as we are dragging, here you can see that
table is highlighting the container because the
mouse is inside the container. Here we can drop it either to the left, right, bottom on up. But if I move my mouse
completely outside, tu drop it outside
of the container. For example, I can put it to the left to the
right to the bottom. All of those stuffs are
not inside the container. Now let's go back
to our container. I will drop it to the bottom.
Let's go and do that. Of course, to check
what happened, we're going to go
to the layout in order to check the
item hierarchy. Now as you can see table
changes it from horizontal to vertical container because
we have dropped it below, and you can see
that this object, this sheet is inside
the container. That sets, be careful
how you are drag and dropping stuff
inside table daps. Moving on to the
next one, in table, we have two different
options on how to arrange our objects
inside the dashboards, and we have the
tiles and floating. As a default, table going to use tiled option for
all our objects, but you can go and
switch it to floating. What those objects means? Let's start to the first
one, the tiled option. If you use this option tiles, table going to go
and automatically arrange your object
as a grid layout. That means, for
example, if you go and resize the dashboard, table going to go and
automatically change the size of all objects inside
the containers and dahard So let's
take an example. Now we are selecting the tilt, and if you take anything like the sheets over here and place
it inside our dashboards. Table go to go and automatically
use the whole space. So that means the work sheet is going to take the size
of the dashboards, because Tab go to say, okay,
we have a lot of spaces. Let's go and use everything. But the other option, we have the floating in the other hand. Here if you select it,
here you have the freedom, the flexibility on how to
customize the objects. And another advantage
of the floating ad, we can go and do overlapping between the different objects. But the disadvantage
of the floating ads, it's time consuming, and you have to do everything manually. Let's check how this works. Make sure to select
the floating. Let's take another sheet and just drop it
wherever you want. As you can see, we have
now gray box indicate the place where we are
putting the charts. So let's drop it over here. And now we have the full control where to position the objects. For example, let's got
this icon over here and just drop it on
top of the old one. So as you can see,
we are now just overlapping or we can
change the size as we want, so I just can make it like this. So as you can see, we are
having the full control of this chart of these objects
without any limitations. Now the question is, should
I use floating or tilt? Well, in table projects, you can end up
using both of them. And we normally use floating for the big containers inside the dashboard layout
and the tilt for all objects that we have
inside those big containers. Alright, so those
are the main options on how to work with the
containers in tableau. But of course, the
best way to understand the containers in tau that
to have real projects. And that's why as a next, we're going to have
a mini projects in order to understand
how to design and build the layoff of our dashboards using
the containers. Alright, so that was
the basics about tableau dashboards and how
to deal with the containers. Next, we're going to build
a simple dashboard and learn the dashboard
development process.
152. Tableau Dashboard Project: All right, so the task
or the project is to create a dashboard
for the sales. And one of the first steps
that we usually do in order to plan our dashboard is to
create first a skitch. So we're going to go and draw a very simple skitch for
the sales dashboards, where first, for example, we have the title of
the dashboards, like the sales performance. And then beneath it, we can have three p numbers or three puns. So we have the total sales, the total profits, and
the total quantity. And then beneath that, we're going to have three
different charts. The first one on the left
one we're gonna have, P chart in order to show ranking or the top sales by category. And then on the right side, we're going to have two charts. The first one is going
to be a line chart, where we're going
to go and compare the sales with the performance, and below that, we're
going to show the sales by category using Pi charts. So with that we have a sketch, we have a plan on how to visual our informations
inside the dashboard. Now, in the next step,
we have to go and plan the structure
of our dashboards, I tableau using containers. So if we're going
to go and translate this sketch to containers, we're going to have one
big vertical container that has three objects
on top of each other. We have the title, then the
pans, and then the charts. And since they are on
top of each others, we're going to use the
vertical container. So now we're going to go in more details on each information. So let's start with the
first one. We have the text. In the text, we don't have any other informations like
beneath it or side by side. That's why we will not
use any container here. And then moving on to the
next information to the pans, as you can see, they
are side by side. That means we can go here
and use the horizontal, container. That means
the horizontal container is inside the
vertical container. Moving on to the next
one, we have the charts, and here it's going to
be a little bit tricky. So first, if you
check the sketch, we have charts side by
side, left and right. That means we're going to go and use the horizontal container. Again, here, this
horizontal container is going to be inside the
big vertical container. Now if you check the right side, you can see that on
the right side we have two charts on
top of each other's. So that means on the right side, we can go and use the
vertical container in order to cover
those two charts. So this vertical
container is going to be inside the
horizontal container, and both of them going to be inside one big
vertical container. So as you can see,
everything makes sense, if you are organized
and you start sketching and planning
your dashboards. So now we have a plant enough. Let's go to Tau and start
creating this structure. All right, so now we're going
to start from the scratch. We have one empty dashboard. And now let's go and follow
our plan where first, we're going to have
the main container, the vertical container. So let's take it from objects, the vertical container drag and drop it to the dashboards. Now, as you can see, if
you don't select anything, it's going to be
still a white page. In order to have
an identifier for this container and
make it easier to see during the design. What I'm going to
do, we're going to go to the layout over here, select the container, and then we're going to
have a border for it. So let's go to the border
over here, make it a line, and then let's make
it a little bit heavy and give it
the color of orange. So now, if I D selects, you will see that we have one big container, the orange one. And this can indicate for
me, this is a vertical And as well, what we
can do, we can go to the item here a key over
here and give it a name. Let's go and give it a name. Now, let's call it the
main vertical container. All right. What we have inside this
container, three informations. The first one can be a text, the title of the dashboard. Let's go to the dashboard
over here and grab our text objects and drop
it inside this container. Let's call it sales
performance and pktle bit pk. Let's make it 2022, bold That is the first information. The second information, that
we're going to go and add a horizontal container
for the different pans. Let's go to the objects
of here and grab the horizontal container and just put it beneath the text. So now, with that, we've
got a horizontal container, and let's go and make
an identifier for that. Let's go to the
layout, make a border, and now we're going to give
you the color of blue. So now we can see that we have a plue container inside
the orange container, and we can go and
give it a name. Let's go to the hierarchy. And let's give it the name of pans. Now what are
we going to do? We're going to go and add
planks inside this container in order to have a placeholder
for the actual pans. In our plan, we're going
to have three pans. What we're going to do? We go to go to the
dashboard. Let's go and add three planks. As you can see now, we have it very small since it's plank. Let's make it a
little bit bigger, and let's go and
add the second one to the right side
and another one. To the right side. So
now what we can do, we're going to go
to the layout and go and check the
structure over here. So as you can see,
everything is fine. Those planks are inside
the horizontal container. Alright, so that's all for
the container for the pants. Now, next information, we're
going to have the charts. So again, here, we're
going to go and add as our plan horizontal container
beneath this one over here. As usual, we can go
to the layout and give it a color and
as well a border. So now, as you can see, we have one container beneath
another container, and both of them are
horizontal container. So let's go and give it a name. We're gonna call it charts. Now we're going to go
and add the planks to the placeholders for the charts. So what we're going
to do we go to grab a plank over here. It goes again, small.
It's smoke it bigger. The second one to
the right side, and with that we got
the left and right. So now, as usual, go back to the layout and check
whether everything is fine. So you can see those two planks are beneath the
horizontal container. Now, as you can see, I'm
always going back to the hierarchy in order to check whether
everything is fine. And here is exactly
my tip for you. Always to check, and don't
leave it until the end. So don't check the item
harchy at the end, after you drop everything
in the charts. I promise you will see stuff
here that you didn't plan. So always as you are dropping
new stuff to the dashboard, go and check the item hierarchy whether everything is fine. Alright. So now only on
the right side over here, we're going to have two charts
on top of each other's. So that means we're going to
have a vertical container, only on the right side. So let's go to the
dashboard over here. And now I'm going to go and
remove the right plank, because instead of
that, we're going to have the vertical container. So let's click on this plank
over here and drop it, and then let's go and get
our vertical container. And just put it to
the right side. So make sure it's placed
on the right side, and we still inside the container off the
horizontal container. So let's drop it. And
now you can see we have something on the right
and something on the left. So let's make it a little bit bigger to the
middle over here. Let's go back to the layout
and check everything is fine. So you can see we
have the horizontal container, this main one, and then inside it on the left, it's plank and on the right, we have the vertical container. So let's go to the right
side and give it a color, so it's going to be a border, and this time going
to be orange. And inside this container, we're going to have two charts. So I'm going to go with
the planks again and put it here inside
underneath each other's. Now let's go back to the layout. And as you can see, we have those two planks
for the charts on the right side and one big
plank for the left one. Now the next what
we're going to do, we're going to go and
make sure that everything is distributed evenly. Let's start with the container on the right side over here, right click on it, and let's click on distribute
contents evenly. Then let's go to the next one to the horizontal container
for the charts, right click on it, and
distribute the evenly. And then we're going
to go to the next one, radically connect and distribute
things as well evenly. Now for the last one
for the main container. I would not do that
because things here has different sizing, so the text can be
smaller than the pans and the chart is going to take
the most of the space. All right, with that,
as you can see, we have built the basics
for our dashboards, and we have
implemented our plan. Now the last step we're
going to go and bring the content inside
our containers. Let's go to the
dashboards over here. Let's start with the pans. Let's take the pan sales. Then the profits
and the quantity. And what we're going
to do, we're going to go and remove those planks, since we don't
need them anymore. Now things here
don't look really nice because here
we have titles. So let's go and remove the
titles from each one of them. As well, we would like
to have everything in the center in
order to do that, click on the objects and go instead of standards
to entire view. Or for example, if
we go over here to those more options fit
and then entire view, and for the quantity,
we're going to go and switch
it to entire view. With that, we have our
three pans as plants. The next thing
we're going to have the par charts on the left side. In order to show some ranking, let's go and grab
our par charts. And what we can do,
we're going to go and remove the
placeholder, the plan. Then the next step
we're going to go and add the last two charts. So first, we have
the line charts, going to be sales versus
profits over here. And as well I'm going to
go and remove the plank, and the last one it's
going to be the Pi charts. Sales Pi category. So let's drop it over here
and remove its plank. Now the next step we're going to go and make sure that everything has entire view,
same for the Pi. All right, as you can see, as
we have a solid structure. Everything else is
going to be easy. We are just drag and drop
stuff and remove the planks. Now with that we
have everything, let's go and remove
those porders let's go to the layout
and go to the first one. Let's remove the porder to the horizontal,
we'll remove this. And All our containers removed. Alright, so that we have our
dashboard, and of course, we can go and add a lot of designs and a lot of
customizations For example, we can add a border
for all those pants. So let's go into
it just quickly. So we can add a great border for each of one of them in
order to separate them. And with that, we have built a very organized and
simple dashboards in table using the
power of containers. As you can see, it's
very easy once you organize your staff and
do it step by step. Instead of rushing
things and dropping your charts immediately to the dashboard without any plan, it's going to be really hard
to control, and as well, the look and feeling of your dashboards
can be really bad. Especially if you want to add more elements with the time, it's going to be really hard
to extend your dashboard. Slow down, make a plan, and then implement it
using the containers in Tableau and at the end,
bring your contents. All right, so that's all
about dashboards in Tableau. Alright, so with that, we have a solid foundations about
the Tableau dashboards. In the next section,
we're going to do a real tableau projects where you're gonna learn
how to execute table project step by step.
153. #14 Section Introduction | Tableau Project: Projects. Now we can
work together in order to implement
Table projects. But what's special about
this project is that you will not only learn
how to work with Table, but also you will learn how I usually implement projects
in pig companies. I'm currently leading
big data and business intelligence projects
in Marcedes Pens. So that means I'm sharing
with you now a knowledge of real life skills on how we implement staff
in real projects. It's not just another online So I'm going to take you in the projects from
the starting point, the user requirements,
and we're going to end up by having a wonderful
table dashboard. So the first step,
we're going to go and analyze the user requirements. We're going to design and
draw a dashboard mockups. And then the first step
in the implementations, we're going to prepare
our data source. And after that, we go to start building the
different charts. And once we have all the charts, we're going to start planning
our dashboard containers, and we're going
to start building and designing the dashboard. So let's start first by
understanding the phases, the steps of any table
projects. So now, let's go.
154. Tableau Project Steps: Projects are like
any other projects, for example, building a house. The first thing that does, we
have to sit with the users and understand the
requirements and their wishes. So that means we have to
analyze the user requirements. And then before starting
constructing the house, the architect can go and
create a blueprint and the layout by defining the structure of the house
and their rooms. And then, everything is planted,
the foundations of the house can be created, and this is very crucial
step in the construction. And now, once the foundation
is finally stable, the construction going to be starting by building the floors, walls, roofs, and so on. And the last phase, it is the finishing touches
by adding doors, adding electricity, choosing the paint colors
and the decorations. So the project
phases of building a house is very similar
to table projects. I'm going to show you
now the different phases that I have usually
in each do projects. So the first phase
of each do projects, we going to start
with collecting and analyzing the requirements. So first, we have to understand
the user requirements, then we have to go
and decide on which chart types we're going to
use for each requirement. And then together
with the users, we're going to go and
draw the first mocap of our dashboards and as well
decide on the colors. Then after we have
understood the requirements, we can go and start building
stuff in Tableau and we start with the first step by preparing the data source. Here we have the following
steps. First, we have to connect our data. Then we have to
build a data model. Then the last step of that we're going to go and understand the data model and the data
inside our data source. Then once we have a
solid data source, we can start
building our charts. And here we have
different steps. First, we have to
check whether we have all the data inside
the data source, or we have to create a
new calculated fields. And then once we create
those calculated fields, we have to go and test them first before we start
building any charts. Then after that, once we have
all the data that we need, we can start
building the charts. And then once we have
the basic charts, we're going to go
and start formatting it by adding colors, removing grades, editing the a headers. And now
once we are building all our charts using
the worksheets, we're going to go to
the last phase where we can start building
our dashboards. And now for this phase,
you have to slow down and start planning
everything step by step, and rushing on this phase
will not help you at all. So first, we start planning the whole structure
of the dashboard by planning the containers. And once we have a plan, then we go to the
next step where we start building
the foundations. We start building the
containers of the dashboard. And once we have a
solid structure, we're going to go
and start adding the content to the dashboard. And after that, we can have the step where we can take care of the filters and the interactivity
inside our dashboard, and then the last step
of building a dashboard. We're going to have
the final touch by adding icons like
icons for the logo, icons for the filters or for navigating
between dashboards. Alright, so those
are the main phases of building a dashboard tableau. And of course, my recommendation is to take it step by step, and don't rush things. Otherwise, you're going
to end up by chaos. And it can be as well, really hard to maintain the
dashboard later. So don't rush building
the dashboards. Always take time in
analyzing the requirements, understanding the data, planning the structure,
planning the moko ups. And by that, I promise you go to deliver a
professional work.
155. #1 Step | Requirements analysis: All right, so I'm
going to start with the Tableau project
from the scratch, where I'm going to show
you step by step how I usually implement
projects using Tableau. And we start right now. All right. The first step in each project that
we do with that, we're going to go and
sit with the users in order to understand the
requirements, their wishes. And we usually document the requirement in something
called user story. Now we're going to go
through these requirements. I'm going to leave the
link in the description, and then we're going to
go and start choosing the right charts for
each requirement. The user story or the project
is about sales performance. And here in the introduction, it says we have to go and build two different dashboards using Tableau to help the managers, the stakeholders in order to analyze the sales performance and as well the
customers That means we're going to go and build two dashboards inside Tableau. So let's start with the first
one, the sales dashboard. The main purpose of this
dashboard is to provide an overview of the sales
metrics and trends. And here it says in
order to analyze a year over year
sales performance. So that means here we are
comparing two years together. Let's check the key
requirements in the dashboards. The first one is that to provide an overview for the
KPI where we have to display a summary of total
sales profit and quantity. The current year and compared
to the previous year. So that means in the dashboard, we don't have to
present all the sales. We have to present
only the sales of the current year and as
well the previous years. And now let's go and
decide which type of charts that we have to present
for these requirements. We can go with the bands. Bands are very useful in order
to show the main matrix, like the total sales profit
quantity and big numbers. For this requirement,
we're going to go and create bands for it. Let's go to the next one.
We have the sales trends. Here we have to present
the data of each QBI. That means the total
sales profit quantity on a monthly basis. So here we are talking
about change over time, for both the current year and compared to
the previous year. And as well, here they
want us to identify the months with the highest
and the lowest sales. So that means we
have now to choose a chart that presents
change over time. Of course, discuss it
with the users and show them different types of
charts as we before. So for now, I'm going to
go with the line charts. And precisely, we're
going to go and use the spark line charts in order to highlight the
max and min values. Alright. Moving on to
the third requirements, we have the product
subcategory comparison. So here we have to
compare the sales of different subcategories
for the current year and as well, the previous year. And it says as well,
we have to include in the comparison as
well, the profits. So here we are comparing
multiple stuff. First, the subcategories
with each other. We have two measures, the sales of the current year,
the previous year. And as well, the profits. So here we can
understand that we are comparing the members
of the subcategories, and for that, we can
use the bar charts. And since we have two values, the current year and
the previous year, we can use, for example,
bar in bar charts. Then for the second
point in order to compare the sales
with the profit, we can present as well another
bar chart side by side to the sales in order to show the profit information Alright, so moving on to the
last one, we have the weekly trends for
sales and profits. So with the requirement sales, we have to present
the weekly sales and profit data for
the current year. So here we are
talking about change over time because we
have the time aspects, and we have to display as well
the average weekly values. We have to highlight the
weeks that are above and below the average in order to understand the
trends in our charts. So here, again, we are talking
about change over time, but on the weekly basis, we have it before as a monthly. So here we can go as well
with the line chart in order to compare the sales
and profits. All right. So with that we have covered
the main requirements of the sales dashboards, and as well, we have
a plan on which charts to be used for
which requirements. Alright, now we're
going to move to another type of requirements. We have the interactivity
requirements. So here it says
that the dashboard should allow the users, to check the historical data by allowing them to select any desired year and not limited to just the current year
or to the last year. So that means the dashboard
should be dynamic, where the users select
the year that they want to compare it with
the previous year, so it should not be always
the last current year. And for that, we
can use parameters in order to solve this task. Then we have that
second requirement. It says that we have
to provide the users the ability to navigate through the dashboard
very easily. And for that, we usually aptoms inside our dashboards
in order to switch, back and forth between
the dashboards, and the next requirement
about interactivity, the user should be able to filter the data
using the charts. And for that, we can
use dashboard filters. And now moving on
to the last one, it's about data filters. So we should allow the
users to filter the data by product informations like
category and subcategory, and as well by the location
like region states, and city. So that means we have to provide all those filters inside our dashboard as well.
All right, guys. So with that, we have covered
the first two steps inside our projects where we understood
the user requirements, and as well we have decided and choosed the right charts
for each requirement. Let's move to the third
step where we're going to build a mocap for our dashboard. All right. So this is
how I usually draw a mocap for a
dashboard in Tableau. As usual, it starts
with the title. So it's going to be
sales dashboard. And we can put as well in the title which year
is currently selected, so it can be, for example, the current year 2023. And now below that, we
can have our pans, right? So we can have three sections or three pans for the total sales, total profit and total quantity. Now in each of those blocks, we're going to show the
following informations. First, we have to
show of the total. So we're going to show the
total sales as a big number, and then below it,
we're going to show the difference in percentage. To the previous year. And since we are talking about KPIs, we have always to show
a symbol in order to show the performance
of the current year. So it's going to be
either up or down. So that we have covered
the first requirement. The second requirement is
to present the data on a monthly basis and compare the current year
with the previous year. And for that, we're going to use the spark line in order to show the curves and as well
the progress of each line. So we're going to
have two lines, one for the previous year and
one for the current year, and we're going to
show the max and the min values using like a circle that we can
position it on the lines. So with that we have covered as well, the second
requirements, and we're going to do the
same stuff for each KBI. So we're going to do the
same stuff for the profit, As well, for the
quantity. All right. Moving on to the
third requirements, we have to present the
subcategories comparison, we're going to go
and use the bar in bar charts in order to compare the current with
the previous year. For that, we're going to
have the background bar in order to present
the previous year, and the current year going
to be the one in the front. What is missing
here is the profit, so we're going to present
the profit side by side to the sales to
the right side and as well using the bar charts and the profit could
be plus or minus. The next info that
we can present in this chart is the profit
side by side by the sales, and as well, it's going
to be a bar charts, where it's going to have
plus and minus values. Alright, moving on to
the last requirements, we're going to have
the weekly trends for sales and profits. And here, as well, we can use the line chart since
it's change over time, and we can have two sections. One for the sales and
one for the profits. We will not bring them together
in one because we want to show the average
line for each metric. So that means we can
have a reference line in order to show the average
for the sales and as well, another one for the profits. And then we have to go and
highlight using the colors the data that is above the line and below
the average line. Alright, so the dots,
we have covered all the charts inside our cab. Of course, we have to add
different stuff like a filter. So since we have
a lot of filters, and there will be no space
inside our dashboards. I'm sure about dots, we're
going to go and have an icon in order to show
and hide the filters. So that means we're
going to have a dedicated section
where we can put all our parameters
and filters like the product filters and
the location filters. And the users can go
and hit the buttom in order to show or
hide this section. And now we come to
very interesting part of the design of our
dashboarter dots, we have to decide
on the coloring. It's very important to decide on the coloring at the start of the projects so
that you don't have to adjust a lot of stuff later. You have to decide on
the coloring as you are creating the mocaps
together with the users. What I usually do, I use maximum of four colors
inside the dashboards. The first two colors
are the basic colors, and they really depend on the background color of tableau. If you are using
the white color as a background inside
the dashboards, then I usually go
with a very dark gray light gray. So those
two colors are the basics that I usually use in each dashboard
that I creates, and the other two colors really depends on the
user's preferences. You can lead the users to
decide on those two colors or you can take it as well
from the icon of their logo. As you can see in the
MCA we are not designing only the chart types and the position of the charts
inside the dashboard, but also the coloring
of the dashboard. Now we have the
final toast that we can add to our Map dah. We can add a logo for the
dashboards, and as well, we can add that
dynamic where we can switch to another
dashboard by using ptoms. So as the requirement says
we have two dashboards. We have the sales dashboards
and the customer dashboards, and we can introduce on the
header of the dashboard two buttons in order to switch between those
two dashboards. The user clicks
on the customers, it's going to switch to
the customer dashboards. But if the user clicks
again on the sales, it's going to switch back
to the sales dashboards. Alright, we will not design now the customer dashboard. I'm
going to leave it for you. In order to practice. We are focusing only
on the first part of the requirements of
the sales dashboards. All right, guys. So now we have a mocap. We have a blueprint, and if the users agrees on
this blueprints, we can go and
execute our plan and we can start building
that in Tableau, and we will start by preparing
the tableau data source.
156. #2 Step | Building Data Source: All right, so so far, we have understood
the requirements, and as well, we have a
mocap for our dashboard. The next step it does,
we're going to go to Tableau and start building
stuff. All right, guys. So the first step is to
prepare our data source, and I promise you start
from the scratch. That's why we're going to start our Tableau public as an empty where we don't
have anything inside it. So now, the first thing
is, of course, our data. Go to the link in
the description and download the data that I
leve there for the projects. Then we're going to
go and connect it. In order to do that,
we're going to go to the left side over here. So make sure you are at the home page or the
starting page of Tableau. So let's go to the text file. And then he previously we worked with the PC and
small data source. Now we're going to work
with the Tableau projects, sales dashboard.
Let's go inside it. And here we get files, which has similar information as
the old data sources. Let's go and select something
over here and click Open. Now we are at the data source
page, and as you can see, we have connected now our
data to Tau. All right. So the next step at that,
we're going to go and create our data model inside
the data source. So here we have to go
and understand our data. I'm just going to go and
remove this from here in order to have everything
from a scratch. So we have to understand our
data inside those files. In order to know what is
dimension and what is fact. So let's go for the customers over here and click view data. And as you can see here,
we have only two columns, customer ID, customer name.
This is the dimension. It doesn't have. Facts. So that means the customer's
table is a dimension. Let's go and closet and go to the next one, we
have the locations. Let's go inside and
check the data. As you can see, we have city, country region,
states, and so on. Those informations are
dimensional information as well, because we don't have
any events inside it. So it's not really facts.
Let's go and close. Let's check the third
one, the orders. So now we can see over here, we have some IDs like
the customer ID, order ID, product ID. Then we have some dates,
like, for example, here, the order dates, we
have the ship dates. And as well some
numbers like the sales, quantity, profit, and so on. So this is an indicator
that this table is e fact because we
have a lot of measures, and as well, we have dates, which can indicate that
this table contains events. So once you see such a setup
where you have IDs, dates, and measures, this is a big indicator that
this table is efect. So the orders are facts. Let's go to the last
one to the products. So we can see that
we have the product ID category, product
name, and so on. Those informations
are a dimension. So that means this table, the products is a
dimension table. All right, so that we have
now an overview of our data, and we can start moduling
In table data source. The first thing we can start is by drag and
dropping the facts. So that means we're
going to go and get the orders and put it in
the data model over here. And then after that,
we start bringing all other dimensions
to the data model. So let's take the customers, for example, drag drop it
over here as a relation. Now, as you can see, table
can create a relation, it's very important to
check the relationship. So as you can see, we
have the customer ID equals to the customer
ID, which is correct. We will leave all
other options over here in the performance
as a default. Since we don't deal now
with the performance, first we have to
build stuff, and then check whether the
performance is bad or good. At the start, leave
everything as a default. Let's go to the next one, get the location drag and drop
it as well over here. And we're going
to check as well. The relationship, it's going
to be the postal code, equal to the postal
code as a key. And the last one, we're going
to get the last dimension, the products and drop
it to the data model. And as well, we go to
check the relationship. So as you can see, we
have the product ID equal to the product
ID. All right. So with us, we have our
data model where we have one fact and all the dimensions are connected to this fact. Now the next it that,
I'm going to go and start changing
the names around. So for example, let's go rename our data source to
sales data source. And then we're going to
go to the table names and remove the CSV. Right click and let's rename. Let's remove. The extensions
and as well for everything. Just to have it nice
in the data model. With that, We have very
nice naming in the tables. All right, This is
about the renaming. The next step at that we're
going to go and check the data types for the fields, whether they are correct or not. Sometimes if you have bad data
quality from the sources, you will get strange data types, which can make later
a lot of issues if you don't check the data
quality at the starts. It quickly, we're going
to go to the bots. And as you can see,
everything here, we have characters, and
the data type is string. So everything is fine
to the products. Let's go to the locations. Now we can see that
all those informations are geographical informations,
and as you can see, all the data types are correct beside the region over here, so we can go and
switch to a region. Let's click on dos and
go to geographical role. And here we have the type of country region. Let's
go and select that. And we can see that's all of
the contained characters, and they are the
data type of string. So everything as well and the customers, let's
go to the orders. And here we have
a lot of fields. What is very important to
focus here on the date field. As you can see, the order
date and the shipping dates, both of them has
the data type date, which is really perfect. In many situations, I see a lot of information
as the dates, but the data type is string, and that's because
we have corrupt data inside those fields. Now the next important thing
to check inside our data, we have to go and
check our numbers. So let's make sure
that all our numbers has the data type number. See all our fields has
the data type number. This is really important because
we want those numbers to be continuous measures in
order to build the charts. That means if you
have any of those informations as a string, what can happen table I
think this is a dimension, and then you cannot use
it in your visuals to do aggregations like S and average
because it's a dimension. That's why it's really
important to check that. All your numbers has
the data type number in order to have it as
continuous measure. All right, with that, we have very good and solid data source. The next step that
I go and try to understand the data before I start building visualizations. Let me show you what I mean. Let's go to the worksheet page, and let's start just randomly check the data inside
the data source. All what I want now
is to get closer to the data to the
content of those tables. Because normally on projects,
we have a lot of tables, and if you don't understand
the content of the tables, it can be really hard to find your informations and
build the correct charts. I know that you
have practice with most of those
informations before, but I wanted to show you what are the steps that I usually do inside the projects in order to build really nice
visualizations. I go for example and
check, what is category, which values are inside it, and with that, I can see
that we have three values. That means we have low
cdonalty inside the category. And then I go check
another example. Let's say the subcategory,
dragon over here, I can see that's, there's here Key between
those two dimensions. And then I go and take something else like the
segments over here. Now we can see
that we have a lot of duplicates inside the data, which means maybe
there's no relationship between those two dimensions
and the segments. If I drag it to the starts, still there's like Dublicate, there's no relationship
between those informations. I go and drop those information. I can see we have
three segments. Those are actually segments of the users and not
for the product. As you can see, step by step, we are learning the data
inside our data source. Then the next step,
which is interesting, do we have a lot of countries
inside our data source? Let's drag and drop the country. As you can see we have
only one country, this data is about the USA data. Then interesting, which regions do we
have inside the data, so we have all four regions
and states, and so on. So as you can see, I'm
just browsing the data. So this is really
important step in order to understand
the business and start discussions with the users of those dashboards
that you are creating. Reading your data,
understanding your data before creating any charts or any
visualizations. All right. So now, once you
are done browsing and understanding the
content of our data, we can go to the next step, where we're going to go and
start building our charts.
157. #3 Step | Building Charts: All right, so now we're
going to start implementing the requirements by
creating the charts, and we're going to start
with the first charts where we're going to
go and build pans. The requirement says, display
a summary of total sales, profits, and quantity for the current year and
the previous year. Let's not forget the
requirement that it says the dashboard
should allow users to check historical data by
offering them the option to select the desired year
to be the current year. So now let's start
with the first pan, where we're going to
focus on the total sales. So now let's go to our data. Let's go to the orders and check the information that we
have inside the sales. Let's grab it to
the text over here. And now with that, we
have the total sales inside our data for all years. But the requirement
says we have to show the total sales for
the current year. So let's take, for example, the order date and put it
to the roads over here. So as you can see,
now, we have the sales for all years and not only
for the current year. So that means I need
feel that shows only the sales for the
last year for 2023. In order to do that,
we have to go and create a new calculated field. So let's go and do that. And we're going to call
it current year sales. And then the function
can be really easy. We're going to check whether
the current year is 2023. If it's true, then we're
going to show the sales. Otherwise, we will show nothing. And for that, we're going
to use the F conditions. So let's go and choose that. And then what do we
need is the year of the order date because the condition is
based on the year. So if the year equals to 2023, then what can happen, we
will get the sales right. Otherwise, if it is not 2023, I don't want anything, so
it's going to be null. So that's it. Let's end it. So again, the logic
is very easy. We are checking the
year of the order date. If it is 2023. Then show the sales. If it's false, then
don't show anything. It's going to be null. So
let's go and hit okay. And with that we've got
a new calculated fields, the current year
sales, let's go and grab it to the view over
here to check the data. So now, as you can see,
this field now is showing us only the sales for
the current year 2023. So this is for the first fields. But in the requirements,
it says we need as well to show the sales of
the previous year. That means we have to show
the sales of the 2022. In order to do that, we have
to create as well, again, a new calculated field to
fulfill this requirement. So let's go to the current
year sales and go duplicate it in order to create the
new calculated fields. Let's go and edit it. Now what we're going to
do, it's really symbol. Instead of having 2023, we're going to go and
make it one year less. It can be 2022. All right, so let's go and hit. With that, we have the previous year of the sales. Now let's
go and check the values. I'm just going to
take it and put it here in between
those two values. And with that acc, we have
the previous year of sales. So with that, we have
the sales of 2022. So now we have the two main calculations for this project, we have the current year and the previous year for the sales. So how to make those
two als dynamic, we can go and use the
parameters in Tableau. Before we create the
parmeter we have to create one more calculated field in order to have the
years of order dates, so that's later we can use
it inside the parameter. So let me show you what I mean. Let's go and create a
new calculated field. Let's call it order
dates and be the years. Then what we're going
to say, we can use the function year and inside it, we're going to have
the order dates. So this field can return always the years
of the order date. So that says let's go and hit. And now we're going to go
and create our parameter. So right click over here
and create parameter. Now we have to go
and give it a name. It's going to be select a year. And the data type
going to be integer, since it's going to be
years, so there is no float. And now we have to
define what is allowed to be used as a value
inside this parameter. If you leave it all, then the users can go and
insert anything, which is not really good because then the
users have to go and guess how many years do
we have inside our data. And instead of that, we have to give them a predefined list of all years that we
have inside our data. And for that, we're
going to go and check a list over here, and then the values inside this parameter
going to come from the new calculated field that we called it years
for the order date. So let's go over
here, add value from, and then we're going
to go and pick our new calculated field. This is really good first
because it is automatic. You don't have to go and
manually add all those years. And second, later, maybe
you get a new year inside your data and you
don't have to go manually and adding
those informations. It's going to be automatically
added to the list. So we are almost fine, but I'm not really
happy with the format, as you can see, we have
hit the Southern point. So let's go to the
display format. And what we're going
to do, we're going to go to the Number custom. Let's remove all
those decimal places. As well, the display unit
is going to be none. That's it. What
we're going to do, we're going to go to the
number custom over here. Let's remove all
those decimal places and as well remove
1,000 separator. All right. That's all.
Let's click over here. Then as you can see, we have now the years without any separator. That thing that we
have to go and make the current value
as the last year. So let's go to the current value over here and select 2023. That's all for this parameter. Let's go and hit or K.
And as you can see, we have it on the left
side now, the parameters. Let's go and show
it for the users, show parameter to the view. And now the users
can go over here and start selecting what
is the current year. As you can see, if I'm
selecting the years, nothing is changing
inside our view, and that's because
we haven't now link this parameter
inside the calculation. And this is exactly
our second step. Let's go and do that. Let's go to the current
year sales over here, and let's go and edit it. Now instead of
this static value, the 2023, we're going to
go and add our parameter. So let's write the
name of the barometer. It is select year, and that's it. What
you are saying now, The year of order date equals to the selection
from the user, then show the sales,
otherwise, show nothing. So let's go and tok.
Let's go and try that. So let's focus on the
current year sales, and let's go and change
the value to 2022. And as you can see now, the
current year for the sales, it is the 2022. And the same if you go over
here and make it 2021. So as you can see,
everything is dynamic, and the users now can go and select what is
the current year. Now the next step with
that, we're going to go and integrate it inside
the previous year. So let's go to the
previous year edit it. And the same thing.
Instead of 2022, we're going to say, select year. But now since we are talking about the previous year,
what we're going to do, we're going to go and subtract
one year. So that's it. Let's go and tok. And now
let's go and test again. So 2023, everything is fine. Let's go and switch the
current year to 2022. So let's do that. And now we can see that both of those two values did
react to our selection. So now the previous
year is 2021, and the current year is 2022. So with that we have completed
the first requirement inside our user story
where the users can go. And decide which year going
to be the current year. And we made it completely
dynamic using the parameters. Alright, so with that, we have
our main calculations for this projects where we have the current year and the
previous year of the sales. So now, the next step, as
we decided in the MCP, we want to show the differences between the current
and the previous year, and we're going to
have it as percentage in order to show the KPI. So let's go and create
a new calculated field, and we're going to call it
percent difference sales. So the calculation
can be really easy. So we're going to
go and subtract the current year of sales from the previous
year of sales. But now, since we want to
present it as a percentage, we have to go and divide
it by the previous year. So let's add starting and ending brackets and divide it
by sum of previous year. With that, we will get the
percentage of the differences between the current year and the previous
year for the sales. So let's go and
hit, and with that, we've got our new
calculated field. And now what we're going to
do, we're going to go and change the format
two percentage. So right click on that, and then let's go to
default properties. Number format. And now
let's go to the percentage, and let's have only one decimal. Let's hit okay. Now in order
to show those values year, let's go and remove the year. And now let's go and
check the value of the differences between the current and the previous year. And with that, as you
can see the differences between the current year and the previous year is around 29%. So again, we can go and check our parameter to see whether
everything is working fine. So let's go to 2023. As you can see the
difference now is only 20%. Alright, so with us, we
have almost everything that we need in order to
build our first pane. So I'm going to call this
first sheet as a test. In order just to test the data, so let's go and create
a new worksheet. KPI sales, and we can start
building our first charts. So now if you check our mocap, our KPI has two parts. The first part going
to be the pans, where we have the big numbers, and the second part going
to be the spark line. So here we have two options. Either we're going
to go and make a dedicated sheet
for each section, or we make everything
in one sheet, like the whole QBI in one sheet. And we're
going to do that. So what we're going to do in the title, it's
going to be the pan, so we're going to put
all the informations of the pan inside the title, and then inside the view, we're going to go and
build our spark line. So let's start with
the pans first. What we need for information is the current year of sales. Let's go and grab
it on the details. And then the second
information that we need is the
difference of sales. So let's grab it as well
to the details over here. And that's it for
now, let's go now to the title and start
building the pan. So, double click on the title. And now in the first
line, we're going to give the name of the measure, so it's going to be
the total sales. And then the second
information, it's going to be years of sales. So
let's go to insert over here and add the sum of
the current year sales. And the third
information is going to be the differences.
So a new line. And let's go and add our calculation, the
difference of sales. So now let's go and hit a line in order to
see the information. As you can see now,
we have total sales. We have the total number
of sales for this year. And as well at the ends,
we have the differences. So now we're going to go and
start formatting this pan. So what we're going to
do, we're going to go over here to the total of sales. Let's make it the font Tableau Pook then let's go and reduce it a little
bit more to 14. Now the next year we're going
to go to the total sales, and we can make it really big. So let's select that.
Let's take the font to Bold, so table bold, and then let's go and
increase the font to, for example, 2022 and
make it bold as well. So here we have really
to make it really big. Let's go and hit apply
just to check the numbers, as you can see a
total sales small, then a big number,
which is really great. Now for the next one, we
can go and select it. Let's choose for example, the tableau semi bold and
then make the size two 20. Then we're going to
go and add that takes off versus previous year. All right, so let's
go and hit apply. So now everything looks fine. This information
is really relevant to show it very bold
inside our data. So let's go over here and change the fonts back to Tableau pock, And as well, let's go and
change the coloring as well, something like here,
really light gray. So as you can see,
everything looks fine. Now, let's go and
change the coloring and the format of the text because this is not really
relevant in formation. So we're going to go
over here and change it again to Tableau Pook then let's go to the
coloring and make it like light gray little bits. So let's go and hit okay.
Now you can see that. Our pan look really nice. So let's go and hit okay. What I'm going to do,
I'm just going to go and change the format
of the total sales. Right click on the
current year of sales, and then let's go to format. Then instead of having the axis, let's go to the pan over here and go to the format of numbers. Let's go to the number custom. Remove the decimal numbers. Let's have the unit as thousands in order to make
it more easier to read, and let's add that dollar
sign in the prefix. So now, things looks
more professional. So we have the dollar sign, and as well, the number
is rounded 2000. Alright, so now the next what
is missing inside our KPI. If you look to the MoCap, we have decided to
add the Pi simple. So we need an icon to indicate whether the sales is
going up or going down. In order to do that,
we're going to go to the differences and
change the formats. So let's go to the
differences to the formats. And then let's go to the
format of number over here, and let's go to custom. Then we're going to go and add the following format in
order to indicate the KPI. I will leave this format
in the description as well in order for you
to copy and paste it. So here what we are saying, if the percentage is
a positive number, it's going to be up. If it is a negative
number, it can be down. Of course, if you want to add more decimals to the percentage, you can go over
here and add zero. So as you can see,
once I add zero, the format can change. But now for that, I would like
to have only one decimal. All right, so that's
all. So as you can see, now we have a really
professional band where we have the total
sales of the current year. And as well, we have
the differences between the current year and the previous year using
a really nice KPI. Of course, we can
go and test it. Let's go and show the
paramo to the right side. And let's go for
example, to a 2022. And as you can
see, everything is changing perfectly, 2021, and now you can see the
arrow is down because the previous year was higher than the current year perfectly. So with that as you
can see, inside the title, we have
created the pan. Now the next step at
that, we're going to go and create the spark line. All right. So now, let's go
and build our spark line. It's going to be
based on the months. Don't forget the requirements. It's to show the current
sales based on the month. And then compared to the
sales of the previous year. So first, let's go and switch
the parameter to 2023, and let's go and get our
order date to the columns. And now what we're going to
do instead of having years. Let's go and switch
it to months. And then we're going to go
and grab the first measure. It's going to be the current
years for the sales. Let's put it to the rows. And now instead of
having discrete line, I would like to have
it as continuous line. So let's go to the months of
our year right click on it. And switch it to continuous. Now what we're going
to do we want to compare it to the previous year. In order to do that, let's go and get the previous
years of sales. And now since both of the
charts are going to be line charts and going to
be on top of each others, we're going to use the
measure names and values. So let's drop it on
the axis over here. Now you might note that
we have brock in our pan. So we have here like a range between the lowest value
and the highest value, we don't want that, but we will fix it later. Don't
worry about it. So now let's keep focusing
on the spark line. So with that we
have our two lines. Now, what is missing
is to highlight the highest value and the lowest value of
the current year. Now in order to get those two
circles on top of our view, we have to go and
add another measure But first, we have
to go and calculate it using calculated fields. So let's go and create
a new calculated field, and we're going to call
it min max of the sales. So now we're going to
go and search for the highest and the lowest
values of the sales. So in order to do that,
we're going to go and check a condition using
the FL statements. So let's start with
the first one. We're going to say if the
sum of the current year. And now we're going to go and
check whether this value is the highest between all
other current sales. So what we're going to do
we can use the function of Window and max, since we are searching
for the highest value, and then inside it, we are comparing all those
current ears. So current year of sales. So now we are just checking whether you are
the highest value. If it's true, then what can
happen, then show the value. So some of current
year of sales. So that means if you
are the highest value, then show yourself
show the value. Otherwise, we're going to go and search for the lowest value. So LSF, we're going to
take the same stuff, some of the current year equal. But now instead of Window Max, we're going to use Window in. So I'm just going to go and
copy everything from here. And replace the max with men. So now, what can happen if
you are the lowest value, we're going to do the
same, show yourself. So we're going to show as well the value of that current
year for the sales. Otherwise, we don't want to see any value. So what
you're going to do? We're going to go
and say that's it. The calculation is
valid. Let's go and hit. So now we have it as a field, but I would like to test the
value whether it's working. So instead of throwing
it now to the visual, let's go in to another sheet. Let's grab the or date to
the rows switch it to month, I just want to check
whether everything is fine. Let's grab the current
year of sales to the view. So now, with that, we have
the sales of each month. And now let's go and grab
the new calculated field, the min max, and
drop it over here. So now let's check the table. What is the lowest value? It's going to be the February. So as you can see,
we have the men, and what is the highest
value. It is November. So now as you can see, this
calculation is working. So commendation for you if you are creating
something complicated. Always go and test on the
table in order to see the numbers before you switch
it to circles or lines. Because with those tables, we
can go and validate Peter. So let's go back
to our KBI sales. Let's grab our new value Min Max sales and
drop it to the rows. So with that we
got our new charts because we have a new
measure over here, and we have as well in the
max new tab for the minmax. So now let's go to this tab. In order to configure
the min max, instead of automatic, we
want to have circles. And as well, we're going to
go and make it a little bit bigger in order to
see those circles. So we have here the
min and the max. Now let's go to the first chart, so we're going to go
and switch it over here and make sure
instead of automatic, it's a line because we're
going to go as an x and merge. Those two charts in one. So in order to do
that, we're going to go and use the dual axis. So right click on the
min max over here. Use the dual axis, the axis on the right side, and maybe just hide it from
the right side over here. So as you can see we have now those circles on top
of our line charts. And with that, we are
highlighting the highest and the lowest value
inside our spark line. So now we have our spark line. But now, let's go back
to our pan and fix it. So as you can see,
we have a range, and that's because
inside the view, we are using the month as continuous fields, and
Tableau going to go, and make it as a range. And
this is the disadvantage of having everything
in one chart that are related to each other's. So what we're going to
do is going to go and fix it by doing the following. So now in order to fix this, we're going to use
a trick in order to make it fix and does not like react to the things that we
have inside our view. So let's go and double
click on the first one, and we're going to add
at the end open Pracket. So let's add it at the end. And as well to the starts, and let's go and hit
k. And nothing is changed because we
have to go inside the title and change stuff. But let's keep
changing those stuff. Let's go to the second one, double clic, open
brackets at the end. Let's add it to the starts. Let's go and hit k.
So now the next si that we're going to go inside the title and start fixing it. So double clic as you can see missing fields because for
Tableau, this is a new fields, side by side, I'm
going to go and add the sum of the
current year of sales, and then I'm going to go and
remove the missing fields. The same thing for
the second one. We're going to go and
add that differences and remove the missing field. And as well we have to go
and change the coloring again from reds because
it was a warning, and let's add it as plaque. For the second one as well. All right, so let's
go and hit okay. Now as you can see,
everything is packed to noural and we have
again, our pan. Alright, with that,
we have built our chart, and the
next step is that, we're going to go and
format it in order to make it a beautiful
chart right. And this includes a
lot of stuff like removing the lines,
removing the grades, removing the headers, axes, adding coloring, simplify
everything, right. So let's start with the
easy stuff where we're going to go and remove those
grades and those lines, right click here on the
empty space, go to format. Go to the left side over
here. Let's go to the lines. Let's check the
zero lines to none. Let's go to the rows, remove the grid as well. As you can see, we don't have any lines
here in the middle. Let's go to the grid over here, and let's go to the sheets and
start removing everything. A line should be none. So with that we are removing
everything inside our grid. All right, as you can
see, we have cleaned up all those lines
inside our charts, and everything
looks really clean. The next step with
that, we're going to go and work with the
axis and headers. Let's go and remove
the axis over here, right click on it, and
let's remove the header. So now we might ask why we
are removing a lot of stuffs. And that's because
in the dashboards, if you add a lot
of reformations, You're going to distract
the users and they will not focus on
the important stuff, which is showing the
trends inside the view. So we have to produce
a lot of information and only present the
relevant information. So really here, we have to be very minimalist in the design. So now what is lift is
the months over here. So right to click on that,
let's go to the DTX. We want to remove
the title from it. So let's go and remove that. And as well, we're going
to go and indicate that those informations
are months. So right click on
that and formats, And then let's go to
the dates over here, and let's have an abbreviate. So as you can see now
we have abbreviations of each month. Let's
go and clear this. So now the goal is to
show for the users, this park line is
based on the months, and we don't want to show
all those information. So it's enough to
show only few values. So I would like now to show only January and December and remove all
other information. So once you see it's
January and December, you will immediately understand this is based on the months. So what we're going to
do, we're going to go and edit the X again and change. The x is. So let's go to
the tick marks over here, and let's go to fixed. Now next, we're going
to go and change the tick so it's going
to start from January, and it's going to show
the value of December. After the interval of 11 values, it's going to show
the last month. So as you can see
now, we are showing January and only December. And everything is between
is not shown, so that's it. Let's go and close it. And
as well we have those nulls. Let's go and remove them, right click and hide indicators. Now as you can see, we
have everything cleaned up and we have only
the line charts, and here we are indicating
that it's based on the month. Cause now what is left is
the coloring of our charts. As I said, I'm following
here only four colors. So here we have
our basic colors, but now let's go and
change those informations. So now we're going to do, we're going to go and
change the lines. Let's go to the
lines over here and start working on the
coloring. So it colors. So now, we'd like to
have the current year of sales to be very dark gray, and the previous year
going to be like in the background as light gray. In order to do that, let's go and double click on
the first value. Now what we're going
to do we can add our colors inside the
custom colors over here in order to
configure it only once and keep using it
in all other charts. So let's start
configuring the colors. Let's click on the
first cell over here. So make sure you
are selecting it. Then let's make it as
something like here, a very dark gray. Then the next, we're
going to go and add to custom colors. So
let's click on that. So with that as you can see, we have defined the first color. And let's go and hit k. So with that we have
defined the first color. Let's go to the
previous year sales, and as well, make new color. So let's go to the seal
over here beneath it. And let's make it
something like here. It's going to be the light gray, and let's make it more lighter. Alright, something
like this. Let's add to custom colors and hit ok. All right. So now
let's go and hit or. And with that as you can
see, the current year is going to be the black one
or the very dark gray. And in the background, we have the previous year of sales. So now, next, were
going to go and change the coloring
of those two circles. So let's go to the minimax
and the marks over here, and let's grab the
minimax sales by holding control and put it
to the colors. All right. So now let's go
colors edit colors. And now instead of automatic, let's go and switch it to
custom over here, the last one. And then we're going to change the steps to only two steps. So now we're going to
start on the right color, where we're going to
define the max value. So let's go inside. And now we're going to define
our third color. Let's click on empty
cell over here, and let's add the code of our
third color the turquoise. Then let's go and add to
custom colors over here. As you can see, we
have our third color. Let's click here. And now we have to define
the left color. It's going to be the main value, click on dots, and we're going to define
our fourth color. Click on the empty
cell over here. Let's add the code
for the orange, and then let's go and
add it to custom colors. And with that, we got
our four colors that we can use in all our chart
inside these projects. So that sits, let's hit and
hit ok. And as you can see, we got our two circles, the highest value, the mean
value using our coloring. Now the last touch that I'm
going to add to this chart is to reduce the opacity
of those two circles. So let's go to the
colors over here and reduce it from 100 to
something like 70%. So that sits. Alright, now, the next step after
formatting our charts, what you're going to
do, we're going to go and work on the tool tip. Mops over anywhere in the lines, you can see that we
have a tool tip, and it's not really nice. As you can see, it looks like calculations and
not human readable. What you're going to
do now, we're going to go and edit those informations. Now in order to do that,
let's go to the tool tip over here in the marks and then we're going
to get this box. Here we can see in this window, it's very similar like you are editing a title or
any text in tableau. Here you have two
different types of text, the one that is not highlighted, this is going to be static
and the one that is highlighted with this
light gray background, it's going to come
from the charts. What we're going to do,
we're going to go and remove all those informations and
start creating our tool tip. Let's start with the
first one, sales, and then we're
going to have off, and then we're going to
go and add the month. We're going to go over
here in two inserts and then let's insert
the month or dates. Here we're going to go
and add the current year. We can go and use, for example, the barometer for
the selected year, but we're going to have a
problem as we're going to show the sales of
the previous year. For that, in order to show the
years inside the tool tip, we're going to go and create
some calculated fields. Let's just close this and we're going to
go back to it later. Now just check the tool table. You can see we are
going to get sales of March, April, and so on. So we don't have a
lot of formations. But now let's go and create
a new calculated field. Now we're going to call
it the current year. So it's going to
be really simple. It's going to be the value that the user selected
from the parameter. So that's it select
year. It's it okay. And as you can see, we have the current
year on the database. Let's go and create another
one for the previous year. Previous year and it's going
to be as well select year. But this time, we can
subtract one year from it. That says Let's go and hit. But now, I would like
to go and change them to dimensions because
they are not measures. Right click on the current year and let's change
it to dimension, the same for the previous year. Let's go and convert both of them to
dimensions. All right. Now we're going to go and grab all the information that we need in the tooltip to this
box over here to the tooltip. As well, the previous year, just drag and rub it on
top of this box here. Let's go and show the
informations about the current sales and
the previous sales. And the differences
between them. All right. So now we
have all the information that we need for the tooltip. Let's go inside the tool tip
and start configuring it. So let's go over here. And now after the
month, what we can do, we're going to have a comma, and then let's mention the year. So it's going to be
the current year, this one over here. All right. So after that, let's
have double points. And let's go and insert the current sales
insert and now make sure to select the
current year of sales this one over here
and not the fixed one. So it's like fixed, but now
we would like to show in the two tip the sales
of the current month. So in order to do that, we're going to go and select the sum of the current year for the
sales without any fixed. So let's go and select that. We're going to go and
do the same stuff now for the previous year. Sales off, we're going
to add again the month. So now we're going to go
and do the same stuff for the previous year. Sales off, we're going to have again the month Let's
go and grab the month, come on, and then
we're going to go and add the previous year. It's going to be this one
over here, previous year, double points, and then let's go that gets the sales
of the previous year. Now the next information,
the next line going to be the
sales differences. Let's say, S differences. Then double points, now let's go and add
that differences. Here again, make sure to not use the fixed one that we
have inside the title. Let's go and get
the variable one. The one that we added
from the data pain. This one, the last information
that we're going to show inside our tooltip is
the men max values. The highest lowest Sales, double points, and
let's go and grab our measure, it's going to be
the Min Max sales, so let's go and sell like that. All right, so that's all
the information that we want to add
inside our tooltip. Let's go and ok and
check the results. So for example, let's go to
the blue point over here. Now we can see that the sales of the current year for
the month, November, it had this value, and as well, it can be compared for the sales of the previous year
for the same month. And then we can see
the sales differences and what is the highest
and lowest value. Now as you can see, as we are
moving to different months, the values inside the
tooltip going to change. Now as you can see the
format and the design of our tooltip is not
really nice, right? So for example, we have
the thousands dots, as well, everything bold, so it's not really
easy to read, as well, the alignment of those
informations are not really nice. So now we're going
to go and format it. All right. Now let's
start first with formatting the current
and the previous year. Let's go to the current
year and let's have the default properties
and then format number. We're going to have
it as a custom. Let's reduce the
decimal numbers. And as well, remove include thousand separator. All right. So now let's go and hit
okay let's just test. So as you can see, 2023,
don't have any dot. Let's go and do the same
for the previous year. So let's go to the
default properties and then number format. And as well, let's go
to the number custom, reduce the decimals and
remove the south separator. So now the next one,
what we're going to do, we're going to go and adjust
the format of the numbers. As you can see the
current month has different format than
the previous month. Now in order to do that, let's go to the previous
sales over here. Write it click on it,
and let's go again to the default properties.
Number format. And we're going to go again
to the number custom. Let's remove the decimals. The unit display is
going to be thousands, and we're going to
add that dollar sign. So let's go and add it, and then it's okay. So
now let's check again. So now we can see now both of the numbers have the
same part formats. Let's check the max and min. You can see the Max and Man has as well, the same problem. So let's go to the minmax value as well to the
default properties, number format, and then let's go to the custom,
remove decimals. Add the dollar sign, and don't forget to add the
unit. So it's going to be. The south and. Let's go and it all our numbers has
exactly the same format. Now what we're going
to do we're going to go and format the text. Let's go back to the
tool tip over here. Now we're going to go and
work with two colors, the light and very dark gray. Let's select the first
part where we have a text. We don't have a value. This is going to get the light gray. Let's check this
value over here, and let's remove
the bold as well. Now let's do the same
for all other stuff. We're going to select the
text, have the light gray, remove the bold as well for
the next on formations. All right. Now for the next information. As you can see, they
have exactly the color that we need as
well, they are bold. Make sure that everything has a dark gray and as
well as the ball. Everything so far is fine. Let's go ahead to and tests. Let's over to this
point over here. Now as you can see, it's really easy to
read where we have a different coloring for the text and the
value. All right. Now the last thing
that we're going to do inside the tool tip it does, we going to change the
alignment of the numbers. As you can see,
all those numbers starts from different positions. Now let's go and
change the alignments. In order to do that, let's
go again to the tooltip. Now what we can do, we can
go and add a tab exactly after the double points and make sure there are
no white spaces. So we're going to
go over here to the first one. Let's add a tab. Now let's go to the second one. I believe we have
here an empty space. So let's just remove
it and add a tab. All right for the next one, I believe I have space, so let's remove
it and add a tab. And for the last
one, the same thing, remove the space and add a tab. The tab can go and
automatically and do the alignment for
all those numbers. So that sets. We
have all the tabs. Let's go and tok. Now
let's go and test. So as you can see
all the numbers, start from the same position. Let's go to the point
over here as well. So as you can see, everything
looks really nice. Alright, so that we are done, and we added a very nice and
158. #4 Step | Building Sales Dashboard: All right, so we're
going to start talking about building the dashboards. The first step of
that we have to plan the structure and the
containers of our dashboard. All right, so let's start sketching the
container structure. The first one is, as usual, going to be the main container, and it's going to be
a vertical container. And then we're going to
start from top to bottom. So first, we have a
title and two buttons. So for that, we can include a horizontal container where we have the title
and the buttons. Moving on below thats, we have the information
of the kBides. So we have side by
side objects here. Again, we can go and
use another container, another horizontal container in order to have all those
QBI side by side. Then moving on below that, we have the charts rights. So it's again two
charts side by side, and we will use a third
horizontal container for them. So this is the main
object that we have inside the main
vertical container. But of course, in
our dashboards, we have as well,
a lot of filters. So what we're going
to do, we're going to build a vertical container, where we're going to put all the filters for the dashboards. But this container can be outside of the main
vertical container, and we will use the
floating options. And this vertical
container going to be outside of the main container,
the vertical container. And for that, we're
going to use the option of floating and as well, the ability to hide
it or show it. So I would say we will
go with this plan, and of course, it is a plan. That means, as we are
building the dashboard, sometimes we add like an extra container,
organized stuff. So we will not cover
everything in the plan, 100%, but we will
cover the main stuff. Alright. So now with that, we have a plan for our dashboards. Let's go and implement
it in Tableau. Alright, now, let's go and
create a new dashboards and wig call it sales dashboard. So now, the first step that I usually do is fixing the size. So let's go in the
left side to the size, change it from range
to fixed size. And then let's go to the width. I usually go with the
1,200 and for the heights. Let's go for 800. Okay. So with that we got enough white space
for our dashboards. And I usually start with
the main container. But since we have another
container which is going to be hidden and
shown for the filters, I'm going to start
with that first. So in order to create
this vertical container, I have a quick way in
order to catch it. So what we're going
to do, we're going to take any worksheets. Let's for example, go
with the QBI sales. Let's drag and drop
it to the middle. So as you can see, table
can go and automatically create a vertical container
on the right side, where it can put
everything inside it, the parameters, filters,
legends and so on. And this is the container that we can use for our filters. So we're going to
go and convert it to a floating element
or floating container. In order to do
that, hold shifts, and then click on this icon over here, and
then just move it. As you can see now it's like
freed and drop it anywhere. Now let's just move
it here to the ends. And what we're going to do, we're going to go and
remove this chart because we have to go now and
build the main container. Let's go and just remove it. And as you can see, we still have it here
on the right side. Now what we can do, we're going to go and
color the container. Make sure to select the
container over here. Let's go to the layouts, and then let's go to the porter, make it a line, and then
let's choose any color, for example, the purple one. As well, let's go and
put a background for it. Maybe the purple as well. With that, we can see that
we have here a container, floating container
on the right side. The next step, we're going
to go and give it a name. So we have a here in
the item hierarchy. Let's go to the vertical
container, click on it, and then let's give it the name of filter, container filter. All right, now we have
our first container. Let's go back and start building the main container
for the dashboards. Let's go back to the
dashboards and let's grab a vertical container
for the main one. Let's draw a here in the middle. And now we're going to go
and add the coloring for it. Let's go to the layouts. Let's go to the borders. And let's have it as an orange. And as well, I would like to add a background color for that. So let's take the
orange as well. So with that, we have
our main container. On the left side,
you can see we have the tilts and then the
vertical container. Let's go and rename it. I'm just going to make it a
little bit bigger over here. So we're going to say you
are the main container. Alright, so now the
next st of that, we're going to go and add
planks in order to have a placeholder for the elements
inside this container. Let's just go and add one, and then let's go with the first container inside the main one. We have the horizontal
container for the title. So let's take a
horizontal container, drag and drop it here below. Make sure that is inside
the main container. So do that carefully. All right. So we have our
horizontal container. Let's go and put
some coloring on it. Layout border.
Let's make it blue. And as well for the background, let's have it as well as blue. Of course, let's go and
check stuff over here. So we have the
vertical container. We have our plank on top, and then we have the
horizontal container. Let's go and rename it. You are the container for.
The title. All right. So now let's go inside it
and put some contents. What we have, we have a text. So let's track and drop it inside the
horizontal container. Let's say you are
the sales dashboard. We will format everything
later. That's it. Let's go and it okay. Now as you can see our container
can be very small. Let's make it a
little bit bigger. And now we have to go
and add the two buttons. Let's go with the navications. Make sure to add it inside to the right side because it
is horizontal container. Let's go and rob it and
we need another one. Let's go and rob it as well to the right side
or in the middle. Doesn't matter. All right.
Now let's go quickly and check the layout to make sure
that everything is fine. Inside the title, we have a text and then two buttons grades. Now let's go to
the next contents. We're going to have another
container for the KPIs. Let's go again to the
dashboards and take horizontal container
and make sure to put it beneath the
first container. Let's rub it over here and
now make sure to click it and let's go and
add the coloring to it so it's going to be line. As well plu, the background is going to be as
well blue. All right. So now, the next step,
we're going to go and add again a name for it. So let's go inside. You are the container
for the Keeps. Okay, now let's go and add some content inside
it using the planks. So the first plank,
make sure to drop it in the second
horizontal container. And now we have it very small, so let's go and extend it. And then let's grab another one, make sure to put it
on the right side. So now with that we
have two planks, and let's go and grab the
third one to the right side. So with that we have our Three
place orders for the KPIs. And again, I always go back to the layout to check that
everything is fine. So as you can see,
those three planks are inside the QBI, so
everything is clean. Let's go back now to
the dashboard and add the last container
for the charts. So we're going to
go and grab again, horizontal container, drop it below the middle one, and let's go and add
some coloring to it. So let's go to the layout. We add some border blue and as well, a
background for that. Now, let's go and
give it a name. So you are the container. For the charts. Okay,
now let's go and add some planks in order to have
some content inside it. So the first plank inside it. And now we have it very small, so let's extend it and the second plank to the right sides. Now we have two places
for our charts. Let's go to the
layout and check. As you can see, we
have the two planks underneath the
charts. All right. With that, we have the three
containers for our content. Let's go and remove
the first plank, since we don't need it anymore, so we have it in
the top over here. Let's go and draw it. So with that we have
built the foundation, the structure of our dashboard. So we have the container
for the title, we have the three QBs, and then place for
the two charts. And as well, we have
here on the right side, our floating container
for the filters. All right. So as you can
see, it's really easy, just do it slowly step by step, check everything, give it
a name. Don't rush it. All right, so that's
all for this step. Now finally, let's go to the step where we're
going to put everything together and put the content
inside our dashboard. Okay. So now let's go and put all our content inside
our dashboards. Don't worry about the filters, we're going to do it at the end. Let's start to the KPIs, we're going to take the
first one, the QBI of sales. Make sure to put it
near the planks. Then let's go and grab the second one next to it
and the quantity as well. Next to it. Let's go to the
layout to check everything. So as you can see, we have
this container for the KPIs, and inside it, we
have our three KPIs. Now, we don't need
anymore of the planks. Let's go and start
deleting them. All right. Now, let's
keep going and put the other charts
inside our dashboards. Let's take the subcategory, make sure to be inside the
third horizontal container. Let's drop it over here, and then the last chart is
going to be the weekly trends. Let's drop it side
by side over here. Let's go to the layouts and
check so that you can see the horizontal container
for the charts has our two charts
and the two planks. Let's go and remove
the planks Great. Now you can check
again our structure in the item hierarchy to see that everything should
be looking like this. We have the main container where we have inside it
three horizontal containers. The title should has the
title and the two buttons, and then the KPI should have the three KPIs and the chart
should has the two charts. If you have it like
this, that means everything so far is clean, and we are in a good way. All right, guys. That's
it for this step. We have the main content
inside our dashboard, and it was very easy and fast. Now in the next
step, things can get interesting where we
can start formatting, coloring, positioning
the stuff in order to have a clean and
professional dashboard. Okay. Now let's start
formatting our dashboard. The first step at that we're going to go
and make sure that our content is distributed
evenly in each container. Let's go to the KPI container over here, make
sure to select it, and let's go to the
small arrow and let's click on distribute
contents even. Let's move to the next
one as you can see, those two charts are
not distributed evenly. Let's select the
container and let's go to the more options and
distributed evenly. With that, we're going to get a fair alignment for all charts. We will not do that for the
first container because the title should be bigger
than the ification patterns. Okay, so now let's start
from top to bottom. Let's start with the title. Let's go inside the title over here and start
formatting it. We're going to call
it sales dashboards, and then let's have a pipeline. Then let's have the year, the current year that
the user selects. What we're going to do,
we're going to go to insert and let's
add our parameter. Now let's go and
change the font sides. Let's select everything and
make it, for example, 24. Now let's go and
change the coloring. Let's go to the colors and
pick our coloring right. Let's go and pick the dark one. And for the year,
let's have it as table medium and pick the
other color that recuse. All right. So that
we have our title, let's hit and check
how it looks like. Yeah, I think it looks fine. Let's make it a
little bit smaller. That's all for those
two containers. Now, let's go and
check the patterns. We have to make sure
that those patterns has exactly the same sizing, which is really
hard to configure. What we're going to do
we're going to go and grab a mini horizontal
container in order to put those two buttoms inside it and
distribute it evenly. What that we're going to
get a perfect sizing. Let's go to the dashboards. And let's get a
horizontal container. Make sure to drop it
to the right sides. So that we have a
small container, let's make it a little bit. We go to see it. I'm just
going to remove stuff. Now we're going to go and
move those buttons inside it. Let's drop it inside it. As we'll pick the second one and put it to the right sides. Of course, let's go quickly and check that everything is fine. So now let's me close
all those stuff. We are the title. We have our title, and then we have the mini
horizontal container. And inside it, we have the
two patterns. Alright, great. So now let's go and make
everything distributed evenly. So let's go to the
horizontal container. Let me just quickly
give it a name. So you are the horizontal
container. For the buttons. Perfect. And let's
go and distribute this container evenly so make sure to select the
horizontal container. Let's go to the options and
distribute content eval. So as you can see,
those two buttons going to get exactly
the same size. As I'm reducing or
making it bigger, both of them going to get
exactly the same size. Let's just make it a
little bit smaller. Now let's go and change the
design of those buttons. Click on the first one.
Let's edit the button. Now let's say the
first button going to be for the sales dashboards. Let's go and select it. It's going to be the
sales dashboards. Now let's go and give it a title or a name. It's
going to be sales. Dashboards. Now let's go
and format the fonts. It's going to be white,
so everything is fine. Let's go to the backgrounds. Let's pick our colors. So let's go to more colors
and pick our blue key. What else? Let's go again to the fonts and make
it instead of 12. Let's make it around ten. All right. That's it.
Let's go and hit. Now with that we have
configured the first pattern. Let's go to the second one. Let's go and edit the button. Now since we still don't have
this customer dashboard, we cannot go and select it, but still I want to format it. Let's go to the fonts, make it ten, and this time, I'm going to make it plaque. Let's give it a
title, it's going to be the customer dashboard. For the background, it's
going to be the whites and let's go and add a border for it, so
it can be the line. Something like this maybe. And then gray. Now, let's add a toll tip. It's going to go to
customer dashboard. Let's check that. As you can see we got the
second bottom. It's still gray because we
haven't select any dashboard. Once we have a dashboard,
it's going to be white. Now let's go and make
it a little bit bigger. Select the container.
Just make it a little bit bigger.
Okay, so that's it. We will visit it later once we have the customer dashboard. All right. So that's all for
now for the first container. What I'm going to do,
I'm just going to go and remove the background
coloring of the container. So let's select the title. Let's remove the
border and as well, the background color. So
let's have it as none. Alright. So now let's move to the next one we have our KPIs. So the first thing
that I'm going to do. I'm just going to make
it a little bit bigger, maybe to the middle
somewhere like this. And then what we're
going to do, we're going to go and add the
background color. So as you can see we
have here a white color, but here we don't have any
coloring for that title. So in not to do that, let's
click on each one of them. And then we go to
the background. Let's make it white
then to the next one, white and the third one. It's going to be as well white. Okay, so now we
have a big card or big KPI for all those informations
for each one of them. Alright. So now the
next step that, we're going to go and remove the coloring of this container. So let's remove the poder. And remove as well, the
background. All right. So now let's start with the
first container over here, what I'm going to do. I will just as well, add a background color for those two charts, go
to be the whites. Now what we can do in order
to configure those stuff, we still have this container, which is really bothering me. Let's go and select
the whole container. Let's move it to
the top over here. And then let's go
to more options, and we're going to
select this one, add show hidden button.
Let's click on that. So once you do
that, you will get small in order to show and
hide the whole container. What we're going to do,
we're going to hide it. So click again on the
options and hide it. Now, the whole container
is inside this icon. I will just place
it over here in order to work on our charts. All right. So the next
that I would like to go in each charts and make sure
that it fits the entire view. So let's go to the first one. You can check it
from here. You can see it is entire view. The next one as well. Third one and as you can see,
it's standard. So let's go and switch it to entire view and the same
thing for the weekly trends. It is entire view. So with that, we make sure that Tau is
using the whole space, and we can make this
one little bit bigger. And as well as we still
have a little bit space. So let's go to the middle
over here and make the QBs a little bit bigger in order to use the whole white
space. All right. So with that, we have
a perfect positioning for each charts. I'm
really happy with that. All right, so now the
next step of that, we're going to go
and add some nice legends to our charts. So now for the first charts, we have to give the following
information for the users, so the dark gray going to be The current year and
the background color is the previous year. So now I'm going to go and
customize a nice legends. I will not use the
one that's from Tableau because I
want to customize it. So for that, we're
going to go and create quickly a chart for the legend. So let's create a sheets, and all what we need is the text of the current year
and the previous year. So we have it as
calculated field. So let's move the
current year to the text and as well the
previous year to the text. So now let's go and customize
those informations. Okay, so now we're going
to start on the left side. So Met's make the
alignment to the left. I'm going to start to the first information, the current year. So we're going to say
the current year Sales. Let's make the bigger. Let's go and change the fonts to something like
maybe a medium. As with the coloring, it should follow the pattern in the chart. The current year of
sales, it was a dark one. Let's come and pick our dark
color for the previous year, it was the light color. So let's do that. Let's make the current year as bold.
Let's go and test it. Let's go and apply.
Now, public to show it as hashes because the
size is really small, so let's go and
hit ok and we can go to the standards and
make it entire view. Now we can see it
over here, 2023 sales versus 2022 sales. Now as you can see
it the current year versus the previous year. One thing that I'm
naturally happy about it, let's go inside it and remove the bold. Let's give it a name. This can be. The legend
of subcategory charts. So that's it. Now, let's go to the back to the dashboard
in order to use it. Now, I would like to
have the legend between the title and the charts.
We cannot do that. So instead of that, we're
going to go and make an extra container for
those three informations. So we have a title, legend,
and then the charts. So as I said, again, we cannot plan everything
at the starts. As you are building
the dashboard, you will understand the needs,
and you will adjust stuff. So now what we can do instead
of having this charts, we're going to have
a vertical container inside the horizontal container. So now let's grab a
vertical container. The best thing to do
it here in the middle. And what we can
do, we're going to grab the chart and put it inside this container so make sure to drop it inside
this container. Of course, let's go quickly and check the layout whether
everything is fine. It's inside the
tilted main charts. So now, instead of
the first charts, we have a vertical container. Let's go and give
it a name quickly. You are the container.
Of let's say chart one. And inside it, you can
see we have our charts. So now our vertical container we're going to
start with a title. So let's go and grab a
title or a text on top. And now we're going
to give you the name, sales and profits subcategory. So now let's go
and format you're going to be table
medium as a font, and then the size
going to be 14 and the color ink going to be the dark one. Let's
go and lick that. Okay. So that's it.
Okay. All right. So that means we don't need
the title of our charts, right click on it
and hide the title. Great. So now, finally, we
can go and grab the legends. But now in this chart,
I would like to have as well a legend on the
right side for the profit. So that means we
have a legend on the left and legend
on the right. And in order to do that,
we're going to have another container in order to put those two
legends side by side. We cannot do it
currently because we have a vertical container. So let's go and grab a horizontal container and just put it in the
middle over here. I just resize it makes you
to select the container, and let's put the first
legends inside it. Now we have a title
for the small legends, let's go and hide it great. Now let's go and make
everything smaller. A that we have
really nice legends. Where we are telling the users, we are comparing the
sales of 2023 with 2022. Now let's go and configure
the right legend. We have to tell
the users, this is profit information and the blue color
indicates for profits, the range can indicate for loss. For this legend, I'm just
going to use that text object. Let's drag the text
Make sure to put it inside this mini
container to the right side. First, let's indicate
the current year. Let's go to insert and
have the parameter because here we have the profit only for the current year. Next we're going to say, circle, is going to be profits and another circle, is
going to be a loss. Now let's go and make
sure that the font is a table medium. It's
going to be a nine. Let's go and make sure that the coloring that is
used is the dark one. But now let's go and change
the coloring of the circles. The first one is going to be the blue and the loss is orange. So our orange. Now let's go and it
okay and test it. Now, as you can see,
we have it really big. Let's go and make it smaller. With this legend,
the users can see immediately that we are
talking about 20:23. The blue one can be the profits and the losses can
be the orange. All right. I'm really happy
with the first charts. Of course, we still have the
coloring of the background. Let's go to the
layout and make sure that everything is correct
of the containers. Let's go to the chart one. As you can see, we have
a vertical container. We have a text, and then we have a horizontal container
for both of the legends. Inside it, you can see
we have the chart for the first legends and
the text of the second And then below that,
we have our charts. If you have it like this, you
are following me correctly. Now, what we're going to do
we're going to go and give a background color for the whole container for
the first charts. Let's go to the background over here and make it as a white. So with that the user is
going to get the feeling that everything is in
one unit in one charts. All right. This is
for the first charts. Let's go and do the same
stuff for the right one. In order to do that, let's go and grab a vertical container, and let's grab it to
the middle over here. So now with that we
have our container. Let's go and grab our chart
and put it in the container, the new one that
you have created. So now with that, we have our chart inside
the new container. Let's go and check the layout. To make sure that
everything is fine. So let's go to the charts. We have Cart one, and the new one can be
for the Cart two. Let's go and rename it. So you are the container for Cart two. Okay. And inside it, we have our chart so perfect. So that means we're
going to go and grab a text objects and drop it on top of our chart
inside the new container. Let's call it sales and
profits, trends over time. Now we're going to go
and start formatting it. Let's go and grab
the table medium, and as well, going to be 14. Let's go and pick our color. It's going to be the dark one. What that we're
going to get exactly the same title as the left one. The next step, let's go and hide the old title from the charts. And next we're going to
go and put our legend. It's going to be
it takes objects. Let's put it in the middle between the title
and the charts. So what we're going to
say in the legends. Let's enter a parameter. In order to show the
year and after that, we're going to have a circle and we're going to say this is the above and another one,
it's going to be below. Now, with that, we can
indicate whether the line is above the average or
the below the average. And we are using the coloring. The above can a p, the blue one, let's go and choose thus, and below can P the
orange. Our orange color. Now, what you can do, we
can make sure that we are following the same font, so it's going to be
the table medium and it is a nine. All
right, so that's all. Let's go and hit okay. I think we missed out the
coloring of the 2023. Let's go inside it
and make sure to choose the dark color
for it. All right. Let's hit okay. So we've
got a quick explanation about the coloring inside
our chart on the right side. Now what we're going to
do we're going to go and select the whole container, and we're going to change the background color to white in order to have this one
unit feeling in the chart. So let's go to layout And let's go to the background and choose the white color. All right. So that we are done
with the container of charts, and what we can do, we're going to go and
select the whole container and remove the border and as
well, the background color. Okay. So now, by looking to our charts inside
our dashboards, we still are missing some
information about the kips. We have to present here
a legends explaining those two points and as well the coloring
of those two lines. So we will have something very similar to the legends where we're going to say
2023 versus 2022, in order to explain
those two lines, and then we can explain
those two circles. So in order to
create the legends, what we're going to do,
we're going to go to the legend of subcategory. Let's go and duplicate
it. Let's give it a name. You can app the legend of QBI. Let's just move the dash word to the end in order to have all
the sheets on the left side. Let's go to the legend of
BI and start formating it. Now since we have different
KPIs, not only the sales, I'm going to go and remove
the sales word in our text. Let's go to the text
to the three points, and then let's go and
remove the sales. Let's have only the years. Then let's go and
add our circle, and we're going to
say, highest month. And another circle
for the lowest month. Now, as usual, we're
going to go and start formatting
those informations. It's going to be do low, medium and nine, so
everything is fine. Let's go and change the
color of those circles. So the highest going
to be the blue, and the lowest going
to be. The orange. So let's go and hit okay
and check the results. Looks nice right, but I think
here I have an extra space. So let's go to the text again and let's have only
one space. All right. Let's go and hit ok.
Now let's go and use it inside our dashboards.
So what we go to do? You're going to go to
the dashboard over here. Let's grab the KB,
the legend KPI. And let's drop it
just below the title. So we're going to have it
between two dental containers. So let's drop it first. And the next, we're
going to go and remove the title, so
let's go and hide it. So now, it's really small
between those two containers. What I'm going to do
in order to select it, let's go to the item hierarchy. And now we can check and see we have the container
for the title, the container for the KPIs, and in the middle,
we have our charts. All right. So now, maybe
let's go and make the title. It's just a little bit smaller. Like this, and let's
go to the legend K drag it a little bit below. All right. So now it looks fine, and we have an explanation
for the three KB. All that we have everything ready inside our main container. What is missing, of course, is the hidden container
where we have the filters. But I will leave
that until the end. Now what we're going to
do, we're going to go to the main container. Let's select it and
remove the border. And as well, the background.
Let's have none. All right, now the final touch, the last step of
formatting the dashboards, we're going to go and add spaces in this dashboard
between the charts. Adding spaces between
the charts going to have a huge effects on the user experience
for your dashboards. As you can see, those two
charts are really near to each other like they are
not able to breathe right. Adding space between
those two charts will not only add a balance
between the items, but also it's going to make it easier to read for the users. Now let's go and start
adding those stuff. The first thing that
we're going to do is that we're going to change the background color of
the whole dashboard. So in order to do
that, let's go to the main menu over here
to the dashboards, and then let's go to
the format option. And here, the default
going to be white. Let's go and move it to the lightest gray. So
let's select that. So now with that,
we are separating the charts from the background, and we can see immediately the spacing between the charts. So now if you look
to the three KPIs, you can see we have a
minimum space between them, but between those two charts, there is no space at all. So now let's go and fix the
spacing from top to bottom. First, I would like to
have the background color of this legend to be a gray. So in order to do that,
let's go to the sheet, so I'm just going to
switch to the sheet. And then let's go to the format. But if you don't
have it open, just right click on that white space, go to format, and
let's go to shading. So now we can go and color the background of the worksheet. So let's go and
say no. All right. So now let's go back
to our dashboard and as you can see for
the legend over here, we don't have a coloring. We need a background color of white only for the
charts. All right. So now let's start working on those three QBs in order to increase the spaces
between them. So in order to do that, let's go and select
the first one, Let's close the formats, and let's stay at the layout. So now here, if you go
to those two options, we have the outer badding
and the inner padding. The outer is the space
between the objects, and the inner is the space inside the chart itself.
So now what do we need? We need to increase the spacing
between those three KPIs, and as well the spacing between
the KPI and the charts. Alright. So now let's
go and start with the outer badding.
Let's click on it. Now here, as you are
increasing the numbers, as you can see the bd, the spaces between this chart and the neighbor charts can be increased and as
you can see it can increase for top,
right, bottom left. As you can see, everything
is connected together. If you change something here, it's going to change
for all values, and that's because all
sides should be equal. And here, it's very important
to understand that. You have to make a decision about the spacing
between your charts, and you have to commit to your decision for
the whole dashboard. This is really important. Otherwise, The dashboard
going to be ugly. So now we're going
to go with the value 20 for all the charts
inside these dashboards. So now, let me show you
how we can do that. Let's go and make
everything to ten. And now, what we are doing this chart is taking
a ten on the left, right, top button, and
our goal is to have a 20. So if this chart on the
right side is taking a ten, and the neighbor QBI is taking from the
left side as well, ten, then we will have a 20. So that means in order to have a 20 between all our charts, each one of them
should has a ten. But now I care only
for the spaces between the charts and
not the legend over here. So what we can do,
we're going to go to the outer
padding over here, and then let's remove
all sides are equal. And from the top, I
really don't care. So let's make it as a zero. So now our chart is not
taking any spaces to the top. We are taking only space to
the right, bottom, and left. So now let's go and do exactly
the same for each KBI. So let's go to the profits. Go to the padding. We have
to have it here as a ten. And now let's go and
disable all sides equals, and we don't need any
spaces to the top. All right, so let's move to
the next one, the same stuff. Make a ten, and let's
remove the tube. So now we can see
clearly there is space between all
those three KPIs, and this space is equal to 20. So now let's go and add spaces to the two
charts over here. So make sure to select
the whole container. And now the same thing, we're going to go to the
padding over here, and now we're going
to make it a ten. This time we care about the
top to be ten in order to have a 20 between this
charts and the QBI above. Alright, so that's
all for this charts, let's go to the next
one and do the same. Make sure to select
the whole container and let's move it to
ten. All right, perfect. Let's go and deselect. As you can see the whole
look and feeling of our dashboard look more
professional and easier to read. And this is exactly why we add spacing between our charts. Okay, guys, now, not
only the spacing between the chart is
important, but as well, the inner spacing,
the inner budding is important between the content and the border of the content. As well, adding spacing inside the container
or the contents, going to make things
look more bitter. For example, let's go
to this QBI over here. You can see the total of sales is very close
to the border right. Now what we're going
to do, we're going to go to the inner budding. Now let's go and increase the size a little bit and
see how things look like. Let's make it maybe seven. Now, as you can see, as I'm
increasing those numbers, content are getting pressed and move away from the border. If you increase
this, for example, like two 20, and as
you can see now, we have a lot of spaces between the title and the
border of the content. Now let's go and
move it to seven. We will go and do the
same for all other KPIs. Let's go to the right one, and we're going to make it
seven and to the third one. Let's go and make it seven. As you can see
moving the content away from the border little bit, going to make everything
breathe better. Let's go and do the same
for all other charts. I'm going to go over here
to the whole container. Let's add a seven as
well over here and add Seven. Alright, so that's all. With that, we are done
formatting our dashboard. The next step with that,
we're going to go and start working on the filters
and the interactivity. Now let's quickly what
was the requirements. We have to allow
the users to filter the data by the
product informations, like category and subcategory, and as well by the
location informations, like the region,
states, and city. And we have another
requirement about interactivity and
filtering, it says, we have to allow
the users to use the chart and the
visuals as a filter. All right. Now let's go and
add the requested filters. We didn't add any filters
inside our worksheet. So let's go to any
of those worksheets, for example, the QBI sales. Let's start adding the filters. So the first one is what's about the products informations. So let's go and get t
159. #5 Step | Building Customer Dashboard: Alright, so now I
hope you are done building the customer dashboard. Now, I'm going to
show you my version how I did implemented. So now let's have a quick
overview on the requirements. Let's start with the
key requirements. We have here the same stuff. It says that we
have to show KPIs, where the KPI should display the total
number of customers, sales Bar customers and as well, the total number of orders for the current year
and the previous year. And the next requirement
is about the trend. We have to present the data. On a monthly basis
where we have to compare the current
and previous years, and as well we have
to identify or to highlight the highest
and lowest values. So those two requirements are exactly like the
sales requirements, but with different measures. So for the chart type here, we're going to go exactly like the sales dashboards where we
can have bands and as well, spark lines with small circles. Alright, Moving on to
the third requirement, we have the customer distribution
by number of orders. So here we have to present the
distribution of customers, based on the number of orders. So here we are talking
about data distribution. And for that, we have
a perfect chart. We have the histogram. Okay, so now for the
last requirement, we have to show the top
ten customers by profit. So we have to show
the top ten customers with the highest
profit, and as well, they need a lot of
information like the rank, number of orders, current sales, current profits, and
the last order dates. So here in this requirement,
we have to present a lot of details about
the ten customers. And for this, I have
decided to go with a symbol table where we're going to have rows and columns. Alright, so this
is about analyzing the requirements and
deciding on the chart type. For the next step,
we're going to talk about the Mc up at the coloring. We're going to use
exactly the same stuff like in the sales dashboard. And that's because
the two dashboards are in the same projects, and it makes no sense to create each time for a new
dashboard, a new mokp. So here we have to follow one Mc up for all our
dashboards in order to have the same
look and feeling of our dashboards inside
this projects. So as you can see, things goes easier for the next dashboards, now we can go and start
implementing the charts in Tau. Al, sa for the first charts, we have the three
QBIs customers, Sales per customers and orders. They are the usual
stuff like before. It's just copy paste and
switching the measures. And of course, if you're
interested in how I implemented, I'm going to leave the file
as well on the project, or you can go to my public profile and download
it from there. Maybe one interesting
thing to show you how did I calculate the sales
pair customers. So let's go over here. And since now we have a lot to filter, we can go and search
for customer. In order to check the
calculated fields. So first, we have to decide
which customers did order for the current year and
which one did order for the previous year.
So it's pretty simple. If we go over here to the
current year customers, and let's go and edit. You can see over here we
have the same condition. If the year is equal to selected
year from the parameter, then show the customer
ID. Otherwise, it's null. With the previous year,
we're going to have exactly the same part
subtracting one year. So this is the first step. Then the next step we're
going to go and calculate the current year
sales per customer. So we have it over here. Let's go and check inside it. So for that, we have the
farming calculation. We can divide the current
year for the sales by the count of the distinct
value of the customers. And with that you're
going to get the average sales per customer. So we will do the same stuff as well for the previous year, and there is going
to be as usual, finding the differences and
finding the minmax values. So that's it for the
sales per customers. Now, let's go and start implementing the
first chart using the histogram in order to show the data distributions
for the customers. So let's go and
create a new sheet, and we can call it
customer distribution. Okay. All right. So now, since we are
talking about two measures, the count of customers
and the count of orders, we have to go and use
the LOD expressions in order to generate the pens. And I explained
that in details in the LOD expressions
using the fixed. So make sure to check
that in order to understand the LOD expression that we're going to use now. And for that, we're going to
go and convert the number of orders into pens using
calculated field. In order to do that,
let's go and create. Let me just remove the search. Create a new calculated field. Here we want to find
for each customers how many orders they placed. Of course, we are talking
for the current year. For that, we're
going to go and use the function fixed from
the LOD expressions, and then we have to
define the dimension. It can be the current
year for the customers. Here we have all
the customers that did order in the current year. Then after that, we have
to do the aggregation, and it can be the
number of orders. So we're going to go and
count distinct As well, the current year for the orders. The current year for the
orders is like the customers, all the orders that are placed
in this year. All right. So that's all let's go and close the fixed over
here. All right. So again, what we are doing over here, for each customers, we are going to
find the number of orders that are placed
for the current year. All right. So now
let's go and hit. And now we have it over
here as continuous measure. Let's go and change it to dimension. So right click on it. Make it a dimension
because pens in the histograms are
usually discrete values. Now what we're going to do, we're going to go
and test the values. Let's drag and drop
it to the view. We got our pen for
the histogram. But I would go and
test those data. In order to do that, let's
go and create a new sheet, let's call it test histogram. What we can do, we're going to go and
check our customers. Let's pick the customer name. Now as well, let's go and
grab the order ID over here. Let's show all the values. All we need the date, let's
go and pick the order date. It is over here in
order to see the year. Then what we're going to
do we're going to go and check our new calculated field. Let's drop it over here, and then let's go and
switch to a measure and I will go and drop
it on the labels. Now let's go and check
one of those customers. Let's focus on Adam heart. Radically. Let's say keep only. Now we can go and check
all orders of Adam. As you can see we have a lot
of orders in the history, and none of them going
to be counted inside our calculated field because we are focusing only on
the current year. As you can see, we start
counting from 2023. In 2023, we have five orders, one, two, three, four five. You can see the measure is
returning a correct value. We can go and test
the other years, for example, let's go
and show the parameter. Let's go and switch it to 2022. So with that, you
can see in the 2022, we have only three orders. Let's go and switch it to 2021, and we have here only one order. So that means our
calculated field is working as attendance, and we can use it now
for the Hestogram. This is what I usually do once I create a new calculated field, especially if it is
LOD, I go and test it. I go and create a simple table in order to see the
data and focus, for example, on
this one customer. Instead of testing
directly in the Hestogram because it's really hard
individuals to test the data. So now let's go back to
our customer distribution, and let's get our bars. In order to do that, we're going to go over here to the rows. Let's say count distinct. And now we're going
to go and count the customers for
the current year. The current year
customers. Let's go. And now we have to go and change the visual to pars since
histograms are bars, and with that we
got our histogram. So that says, Now next, we're going to go and start
formatting our histogram. So the first thing, as usual, we're going to go and
remove the lines. So let's go and format.
Let's go to lines. Let's go to rows and
remove the grid. All right, so that's
all for the lines. Next, we're going to go over
here and remove the headers. And let's make those pins
and make it more readable. So let's go and format. Maybe I'm going to make it bold and change the color. All right. So now we have the name of
the dimension over here. We can go and hide it. Okay. So now let's go and
start with the coloring. Let's hold control and drag
the customer to the colors. And of course, we're going
to go and use our coloring. So let's go and edit it. And let's pick the plu one. All right, so that's
it. That's it. Okay. Next, we can go and add some borders to those parts. So let's go to the colors to the borders and make it
something like this. All right. Now the
next step. I'm going to go and add some labels. So let's get the
customers to the labels. And I think with that, you
are done with the Hgram we can go and test it by
adding the parameter. Let's select another
year like 2023. And as you can see
everything is reacting. And that's it for
this requirement. Now we are showing for the
users the distribution of customers by the
number of orders. Let's go now for the
next requirement, where we're going
to show the top ten customers by the profit. Alright, now let's go and
create a new worksheet. Let's call it top customers. So now we need our
customers to the rows, and now we're going to show
only the top ten customers buy the profit for
the current year. Let's go and get our measure. It is the current
year for the profits. Let's drop it on
the text over here. Now next, we're going to
go and make the filter in order to show only the
top ten customers. Hold control, drag and drop the customer name
to the filters. Now here, we're going
to go to the tab of top and then let's
switch it to buy field. We have top ten by the profits and the aggregation
going to be the sum. This is exactly what do
we need. Let's go and it. With that, we're going to
get a very simple list of the top ten customers
by the profit. Let's go and change the format in order to see
the whole number. Let's go and format where I'm going to go
and remove the unit. Remove decimals,
let's have the dollar signed at the starts now we
can see the whole number. Let's go and sort the
list by the profit. In order to do that, go to the customer name.
Let's go to sort. And we're going to go to a field in order to have a ranking, we're going to switch it to sort order by descending and make sure that we have the
field name current year of profit. All
right. That's all. It's close it, and
as you can see, the first customer on top, it's going to be
the top customer. Now the next step at
that were going to go and add the rank to this list. In order to do that,
we're going to use the function index. Let's go to the roads over here. And just write index,
and that's it. And then let's go
and switch it to discrete and just
put it at the front. And with that we
have a ranking 1-10. Alright, so now we're
going to go and add additional information for each customers like the
sales for the current year. So let's go to our data pin. And let's grab the
current year for sales, drag and drop it on
top of those numbers. So that we can see as well, the sales for the current year. Let's just make it a
little bit bigger. Now the next information
that we're going to go and add is the number of orders for the current year that is placed from
the customers. In order to do that, let's go to the major value over
here and double click on the empty space and write down count distinct in order
to count the orders, so we're going to go and type current year off the orders. Let's say, okay.
And now we're going to see the number of orders that each customer did place in
the current year. All right. Now the next information
that we're going to add is the last order date did
the customer place. Now we need the last order date in order to do that,
right click on it. Let's go to the measures
and get the maximum. So with that we can see now, when was it the last time did our top customer order from
our business. All right. So with that we got
all the informations that we need inside our chart, the next stepdt we're going to go and start formatting it. First, we're going to
start with the lines and the grids as usual, right click on it
and go to format. Now I'd like to get
rid of this line in the middle between the
measures and the dimensions. Let's go to the grids
and let's go as well to the column
divider and remove it. With that, we don't have
the line in between. Now the next step
we're going to go and get rid of the gray
background color. So let's go to the shading, and then here we're going
to go to the row banding and reduce the size
to the minimum. With that, as you can see, the background color did
disappear. All right. That's all for the
lines at agreed. Let's go and start formatting the ponts and the
colors of our phonts. First, I would like to
format the index over here. Let's go to it format. Let's go and make sure
that you are selecting the correct field. Yeah,
we are selecting it. Let's go to pan. Now let's
go to the numbers over here, and I would like
to add a prefix. So let's remove the decimals
by the number custom and add the briefix of hash in order
to have ranking. That's it. What else we can add
to this ranking is that we can go and add the
background color for it. Go to the shading
over here and make it very light gray. That's
all for the ranking. Let's go to the
next one and start changing the font color. Format. Let's go to the font, so we can leave it
as a tableau poke and we can go and change the color to something like black. That's it. Let's go to
the next one format. And we're going to go over here, make it black. All right. I'm moving on to the measures. Let's go and remove the
unit from the sales. Let's go to the sales
over here for mats, and then we're going to go
and format it as usual, to the number custom,
remove the decimal and add $1 sign. All right. And for the number of orders, we're going to leave it as
it is. All right. That's it. Let's just keep it very
simple and with that, we have a really nice
detailed table to show the top ten customers with
additional information. All right. So with that we are done
building all the charts. The next step, we're
going to go and start building the dashboard. So now in order to create
the customer dashboard, we will not create
everything from the scratch. We're going to go and Dublicate the sales dashboard in order
to have the structure. Let's go to the
sales dashboards, radically connect and Dublicate. With that, we got two
identical dashboards. Let's go to the second one
and start formatting it. First, we're going to
start with the naming. It's going to be the customer. Dashboard. Now let's
start from top to bottom. We're going to start
with that title. Let's go over here,
change it from sales dashboard to
customer dashboards. So as the casin creating the
second dashboard can be very easy once you have a really
solid structure. All right. Now next what we have, we
have the three charts, we're going to go and replace
them all with the new ones. The first one is going
to be the KPI customer. Let's just drove
it to the starts. Of course, T going
to go and start adding stuff to
our new container. Don't worry about it, we're going to go
and delete it later. Let's go and get the next KPI, sales pair customers and the
orders. Okay. All right. And now let's go and
hide this container. So right click on the icon, and let's go and hide it. All right. So now
we can go and drop those old KBs from
the dashboards. So let's just remove them. And with that we
got our three Vys let's keep moving
and add our charts, it's going to be the histogram, so let's drag and drop it
below the legend over here, and we can go and
remove the old stuff, so the old chart, and as well, we don't need the legends. Let's go and drop
the whole container for both of the legions. And let's go and
change the title to customer distribution
by number. Of orders. Okay, let's say okay and let's remove the title
from the charts. As you can see, this
container keep popping up because we have a new
legends and new stuff. Let's go and hide it again. Let's work on the right charts. It's going to be the detail
list for the top customers. Let's drop it over here and we're going to go and
remove the old one. Now we're going to
move on to check that. Everything fits the entire view. Let's go check one by one, entire view, entire view. This one as well.
Everything looks fine. Let's check the last
table. It's standard. Let's go and switch it to entire view to use the whole space. All right. Now we put everything together in one dashboard. The next step that
we're going to go and start formatting this dashboard. It will not be that bad because we have
almost everything. Let's start with
the first chart. Let's make everything
with a white background. Let's go to layout and change it to white as well
for the next QBI. Just to make sure that we
have done for everyone. So with that we've got a
card for the whole QBI. The next step I would say, let's go immediately and
start working with the spacing between
those charts. Let's click on the first one. If you remember on
the sales dashboards, we have agreed to have a
20 between each charts. Let's go to the outer padding and make everything as a ten. But only on the top, we
don't need this extra space, let's disable all sides equal and make it zero,
only for the top. As well we say it,
the inner padding going to be always seven. Let's have it like this
and do it for the others. Outer is ten on top is zero, and the inner padding
going to be seven. And as well for the last
one. So you are ten. Remove it for the top and the
innard going to be as well. Seven. Let's do it like this. All right. So with that
we are done for matting, the three B. Let's
move on to the charts. So now let's go and select
the whole container. And as you can see we have
everything done as before, so the outer padding is ten, and the inner padding is seven. Great. Let's go and
check the right one. I think we're going to
have it as well correct. So you can see things get
really fast as you are building the second dashboard
using a solid structure. Now we're going to do
one more thing about the top ten customers
by profits. As you can see, those
heather informations or the field name
is not really nice. Now we're going to go and
remove those informations and we're going to build our
own custom field names. Let me show you how
we're going to do that. Let's go to dashboards
and let's grab a horizontal container
on top of our table. Here we're going to
go and put inside this container the field names. Let's just make it a
little bit smaller. Let's start adding texts. This is the first text.
The first information going to be the rank.
Let's have a rank. Let's change the
font to a medium. Let's change the size
to ten and make it a little bit lighter
for the colors. All right, so let's go
with this. Let's get okay. Let's go and add another
one for the next field, so make sure to be
on the right side. Customers. And we're going
to do the same stuff, you're going to be
medium and this color, we can go and copy
it for the next one. Let's go and tok. Now let's
go and keep adding our field, so the next one going to
be the last order date. Let's paste the old one and
we can call it last order. So that sets, and then we have the current
profit. Let's grab a text. Instead of the current profit, I'm going to go and
add the parameter, and then the word profits. Let's go and make sure that everything has the same format, so you're going to
be table medium, ten and the same coloring. Let's copy it for the next one. So we're going to add
another text for the sales. Paste. Let's have a sales, and the last one is going
to be the number of orders. So let's write it like this. Paste it remove the ear. We don't need it here.
So that as you can see, we got our titles. What
are you going to do? We're going to go and
remove the titles from the original table. Let's hide the field labels and as well, let's
hide the header. Next, we're going to start working on the alignment between the titles and the detail list. We're going to start
moving stuff around. First, I'm going to go and
make it a little bit bigger. Then we can start moving
those boxes on top of the informations until
everything matches. The last order a little
bit to the right side, maybe make this field
a little bit smaller, and then let's go and push
the sales a little bit to the right sides and
as well the profits. Now we're going to go and push this a little bit
to the right side. Can see we don't have any
more spaces for the order. Let's go and just
call it orders. All right. And we're
going to go and move it again a little
bit to the top. Okay, so I'm happy with
that. Everything is perfect. And now we have formatted all the charts that we have inside the customer dashboard. Next, we're going
to go and start cleaning up the
filter information. So let's go and show the
filter what is happening here. Okay, now what
we're going to do, we're going to go and remove all additional informations that Tableu did add to
our new container. We don't need all
those informations. So let's go and remove them. One by one, and with that we got exactly like before
the same container. Of course, we can go and start testing your dashboard again. We can go and switch it
for example to 2022. As you can see
everything changed even we have a new
top ten customers. We can go and add, for example, different subcategories
and everything is reacting.
Everything is perfect. Let's go and put
everything back to 2023. With that, we have
fixed our filter. Let's go and close it.
Let's hide it. All right. Now the next step of that
we're going to go and add interactivity
in those charts. Make sure to select the histogram
and use it as a filter, and with that, if they
users go anywhere and start selecting staff,
for example, those two. And with that as you can see,
the dashboard is reacting. Let's deselect. All right. So now let's do the same
stuff for our top lists. Let's go and make
it as a filter, and now we can go and
select our top customer, and we're going to
have a quick analysis only for this customer,
which is really nice. So let's go and de select that. And with that we are done
with the interactivity inside our dashboard. Now moving on to the last step where we're going to
work with the icons in order to make navigating our two dashboards
very easy. Okay. So now let's go
and fix this icon over here. So double con it. And now, finally, we can see it can navigate to
customer dashboard. Now since we are at the
customer dashboard, we're going to show an icon
that is like an active icon. In order to do that, let's
go and choose the icon. So as you can see,
this one can be the active icon if the customer select the
customer dashboard. So let's go and select that. So now, everything looks
good. Let's go and hit okay. And with that, you can see,
we have a new icon that indicates we are now at
the customer dashboard. Alright. So now, next,
we're going to go and fix the sales dashboard
icons over here. So let's go inside it and navigate to the
customer dashboard. And let's choose the
one that is not active. So we're going to go and select this icon. All right,
so that's all. Okay. So now let's go to
the sales dashboards over here and change it
to an active icon. We're going to choose
this one over here. Sales dashboards active. So select that. And let's
have an okay. All right. So that's it with that
we have fixed the icons. So the sales dashboards
going to be activated. If you go to the
customer dashboard, it's going to be exactly the
way round. All right, y. So with that, we are done with the second dashboard
inside our projects. Let's go and taste everything. Let's go in the
presentation models over here and let's
check the data. All right. So now we are
at the customer dashboard. Let's go and click on
this container over here. So as you can see
everything is working. Nice. Now let's go and switch back to the
sales dashboard. Let's click on this icon. Now as you can see, we are
back to the sales dashboard. With that, the users should
not go to the taps and switch between those
two dashboards, the users can just
go and click on those icons in order to switch between those
two dashboards. With that, I'm really
happy to announce our project is completed and we have fulfilled all
the requirements. I will leave this project
inside Tablea public, or you can get it from
the download link. Alright, so with that,
we have completed our tableau projects, and we walked through
all the phases that I usually follow
in order to implement any table projects
from the scratch from the requirements until the
delivery of the dashboards. And here, again, my
recommendation that to not rush the projects
where you can go immediately start
building charts and dashboards without having
a clear or organized plan. So do it step by step in
order to deliver clean work.
160. HR Project | Introduction: Friends, so today,
we're going to go and implement an amazing
table project, where we're going
to go and build an H R dashboard using Tableau. And what's special about
this project is that, you will not only
learn how to use Tableau in order to
create visualizations, but also you can
learn how I usually implement professional
table projects at my work. If you are new here, welcome. My name is Bara, and I lead Big Data and BI projects
at Pacida S Pens. I'm here to share
everything that I know about working with data. So make sure to subscribe
so you don't miss anything. In this table project, I'm going to guide you step by step, starting from the
user requirements. Then we're going to go and draw the concepts and the
mockups of the dashboards, and at the end,
we're going to have a fantastic dynamic
dashboard using Tableau. That means by the
end of the projects, I'm going to leave
you with a table dashboard and as well, real life skills on how to implement table
projects. My friends. Before we jump to the project, I would like to take a moment
and say the following. Everything in this
project is for free. And as well, I highly
recommend that you follow me along with this
project, step by step. Because just sitting
and watching, it will not really help, you have to get
your hands dirty. And, hey, this is your project, so feel free to share it
in any platforms you want, like in Linked in or in
Tableau public as a portfolio. So that's all for now, let's jump and get started
with the projects. Now, my friends, by the
start of each project, first, I decide on the coloring. The first decision that I
make is whether we want to have a dark or light
theme in the dashboard. And since the last sales
project was a light theme, this time we're going to
go with the dark theme. After that, we have to
decide on the four colors, not more, and we divide
it into two categories. The first category is
the basic category, and here we have two colors. Black and white. Usually, I
go with the gray coloring, so we have a dark gray
and very light gray. Now, the second category, we have the custom category, and here we have the two
colors of our own style. So for this project,
I'm going to go with the green and pink. But wait wait here,
we have an issue. My wife said this is not green. This is Persian green, and the other one is not pink. This is royal Fuca. So sorry. All right. So those
are the coloring that I've decided
for this dashboard. Of course, you can go
and add your own style. You don't have to
follow my coloring. All right, friends,
Table projects has mainly three phases. The first one is by preparing
our data where we go and connect our data to Tableau
using a data source. So we have always to
do this step before building any charts
or doing an analysis. In the second phase, we're
going to go and build many, many different charts and visualizations based on
the user requirements. And in the last phase,
we're going to go and put all the charts in one single
consolidated dashboards. In this phase, it includes
a lot of formatting and refining in order to make the dashboards user
friendly and effective. So let's start with
the first phase, where we're going
to go and build tableau data source
for our project.
161. HR Project | Build Data Source: All right, friends, now
we're going to go and build the data source
for our projects, and here what we're going to do. First step, we need data. We're going to go and download
the data for the project, and then we're going to
go and connect the data with Tableau using
a data source. After that, we're
going to go and check the quality of the data
and the data types. And the last step, we have
to go and understand and explore our data before
building any visualizations. Okay. The first step of building a data
source in Tableau, we have to go and get a data. And to BNS I've checked a lot
of projects and datasets, and I didn't find anything that is suitable
for these projects. That's why I have decided
to generate my own data. Of course, I have a
personal assistant in order to help
me with this task, and that is the SGBT. I have asked the
SGBT to generate a Python code in order
to generate a data set. After a long shot
and twisting around, Finally, I've got a really
nice code in Python using the library faker in
order to generate data. If you want this
Python code that I've used and the prompts
in the SGPT, you can find everything
in the project link. Friends, as you
can see, SGP here, help me in order to generate
a datasets for practicing. Now let's go and get the data. In the video description,
you can find a link for this page where I've collected everything that
you need for these projects. As you can see here,
we have a Zip folder where you have all the
files for these projects, and if you scroll
down over here, we have the user story
for this project. Here we're going to go and
build tableau dashboard for the human resources based
on those user requirements. L et's go and download the
Zi folder, it's over here. Let's click on it, and you can have it in the
download folders. Now the next tab, we can
write click on it and extract all and then extract.
We have it over here. Now what I usually do,
I move this folder to somewhere else
because I tend to clean up the downloads
and if you lose the connection between
tableau and the data, you will get a lot of errors. Let's go and do
that. I will just copy it and put it
somewhere like here. Now let's go inside it and
check what do we have. What do we have over here,
we have icons and images. You can find all
those stuff that we need later for the dashboard. And as well, you can find
the Tableau project file, and of course, you
can go and download it from the Tableau Public. And here we have our data,
human resources, CSV. This is the data
of our projects, and you can find the
dashboard mockups that I've created using
the Draw AO. All right. So with that, we have our
data for this project, and the next step of that,
we're going to go and connect Tableau to our data. All right. So the
first step of that, we're going to go and
start Tableau Public. Then we are now at
the landing page. Let's go and connect to our
file using the text file. Then we're going to go and
open that downloaded data, human resources, CSV. Let's go and open it. Now, usually, the next spit
that we're going to go and build a data
models from the files. But now for this project,
we have only one file. That's means we don't
have to worry about relations and joints
and union, and so on. Our data model has
only one table, one file for the whole projects. Now the next sib of that,
we're going to go and check the quality of the data
inside this table. The first thing is,
of course, if you are using text file das, the columnames
should be correct. We can find over here that
everything looks fine, right? We have employee ID, first name, last name, gender, stage, and so on. So the
names looks okay. And if you don't
have it like this, we have to go and check the
properties of the file. So in order to do that,
right to click on the table. Usually in text or CSV files. The first row should be the filled name or
the column name. So make sure this is checked, and then we're going
to go to this option. Text file properties,
let's coincide it. And here, it's very
important to that. You have the setup like
me that I'm showing now. So the filled separator
should be the semicolon. And if for any reason that tableau did select
something else, make sure to select Semicolon. And the third option
is important, it is the encoding of the file. It should be as well UTF eight. So if you have those
options like this, you should be safe, so
let's go enclose it. That's means Tau is
reading the files correctly and the column
names are correct. Now the next exhibit that we're going to go and
check for each field whether Tableau did assign
the correct data type. Let's have a look. The first column then blo ID,
it is a string, and that is correct
because here we have a character
between the numbers, so we cannot have
it as a number. First name, last name, gender,
all those information. Has characters inside, and
of course, it is a string. Let's move to the right side. Now we can see we have two
columns about the locations. As you can see
Tableau did assign this correctly to
a geographic role. If you don't have it like
this, it's very simple. Go over here on this icon, and then we have here the option of geographic role and make sure that we assign it to
the correct information. Now, let's keep
moving, we have here, the education level, which
is correct. It is string. Then after that,
it's very important. We have several dates. We have the birth
date, the higher date, and the termination dates,
and all of them has correct data type. Now let's keep moving to the right side. And as you see, we have
department, job titles, all of them are string,
and we have salaries. So the salts is the
only field inside our datasets that has
the data type number. The last one is the
performing strting, it is string, which is correct. As you can see, Tableau
did wonderful job by mapping the correct data
types to the columns, and having the
correct data types is very important in your
project in order to do the calculations correctly and to have good data
quality inside your dash. It's so good that we have
built our data source and everything
looks really great. Now the next shibit that before I start
building anything, any charts, I would like to understand the data
to explore the data. What I usually do, I go and
create any sheets over here, and then I start
dropping in formations to the sheets in order
to explore the data. For example, which departments do we have inside the data? As you can see we have
seven departments, customer service,
finance, HR, and so on. Then what is interesting,
for example, the job titles
drop it over here. And now we can see
all those job titles, but we could understand as well, there is relationship between the departments and
the job title right. So what we can do over here if you have relationship between columns at that, you go
and create Hierarchy. Let's go and do that.
It's very simple. Let's take the job title, drag and drop it on top of
the department like this. And then you have to
assign a name for it. I'm just going to leave it
like this. Let's go and click. Now on the left side,
we have hierarchy, where it starts
with the department and ends with the job title, the order of the hierarchy
is as well correct. Let's keep exploring.
Let's go and get the education level,
for example, over here, and we can see there is
no really a relationship between the education level
and the jobs and department. I go and go and drop
it in order to see. In our data, we have
four education levels, we have bachelor, high
school, master, and PhD. As you can see we are just browsing and exploring the data. Now my recommendation
is that to bows the video and you go
through all the fields. Only after we understand
the content of the data, we're going to proceed
with the next steps. Now I hope that we have now better understanding
about the project data, and now with that we have
a solid data source in order to start building
charts in Tableau.
162. HR Project | Build Charts - Part1: All right. So now we're
going to go and build the charts for the
first dashboard, the summary dashboards, and
here what we're going to do. First, we have to
analyze and understand the requirements in order
to decide on the charts. After that, only for one time, we're going to go and do
initial steps by formatting the worksheets in order
to use it as templates. After that, we have to
make sure that we have all the dimensions and measures in order to build the charts, and if not, we have to go and
create calculated fields, and only after that, we can
go and build our charts. The last step, we have to
take care of the format. So now let's go and start with the first step
where we have to analyze and understand
the requirements and decide on the charts. Okay. So the first step before
building anything that, we have to go and understand
the requirements. So let's have a look
to the user story. So what do we have over here? We have to go and
build a dashboard for the HR managers in order to analyze the human
resources data. And we have to provide
them with two views. One has a summary view for
high level insights and another detailed view in
order to show a list of employee records for
in depth analyzers. So that means we might end up building two dashboards,
but we will see. Let's start now focusing on the first section,
the summary review. So the summary review
should be divided into three main sections. This
is about the dashboard. We should have an
overview section, demographics, and
the income analyzes. The first requirement for
the first chart going to be display the total
number of hired, active and terminated employees. It sounds like we have different
status of the employees. We have active and terminated. Now in the next
spit, we're going to go and decide on
that chart type. Since we are talking about the
total number of employees, it's like a big number that we should present in
the dashboards, so we can go and use the bands. Bands are a great way
in order to highlight the big numbers that the pig measures inside our
data in the dashward. Pack to tableau, but now
before we start implementing any requirement before we
build any sheets or charts, we have to do an initial step, and that is by formatting
the first sheets to be used as a template for all other requirement
and all other sheets. That means we're going to
go define the background, the colors, the fonts, everything to be prepared. That's of course better than creating the sheets
from scratch each Now with the first preparation
we're going to do, we're going to go to the
format in the menu over here, and then let's go
to the workwok. Now we're going to go
and define the font for the whole projects. Let's go over here to all and then let's go
to the Drop list. For this project, I've
decided to go with the tropuh MS. Let's
go and select it. Now everything that I'm creating in dashboards and shields, going to be using this font. All right Now the next step that we're going to go and start adding the colors that we have
defined for this project. Let's go to the marks over
here and select the color. Let's go to more colors. So now we're going to go
and add our four colors. Let's go and start
with the first see over here, click on it, and then go add the codes, and with that, we have the
green color over here. Let's go and click then,
add two custom colors. This, of course,
can help us to have e quick access to the colors that we defined
for the projects. Now let's go and add
the second color. Again, the same
steps, let's select the sale below it
and add the codes, and with that, we
have the pin color. Let's go and click on,
add two custom colors. Now the next two
colors is going to be our basic colors,
select on the sale. Add it and with that we have our gray and then add
to custom colors. Now let's go and
add the last one. The fourth one, it's going
to be the light gray, and as well add
to custom colors. With that we have
our custom colors to be used in the
whole projects, those four colors.
Let's go and hit okay. Now what we're going to
do, we going to define the default font color
for the whole projects. Again, we're going to go
to the font over here, and then let's go
to more colors, and let's pick the
gray, and then select. So that's all for the
colors and for the fonts. Now, the next step that
we're going to go and define the color
of the background. As we decided at the start, this project going
to be a dark theme. Let's go again to format
and then to shading, and then we're going to
go to the worksheet over here and let's pick
the first dark color. Now let's move to the next step. We want to go and change how the sheet is
fitting the view. For dashboarding, it's always good to have it as entire view. The default tableau
show it as a standard, so let's go and change
it to entire view. Let's click on that, with that, the chart can take always the whole space that is
available in the view. Now maybe one more thing
that's about the title. We don't want to show any
titles in our dashboards. We're going to go and
create our own style. So right click on
it and high title. All right so that we have
done the initial steps, and we have now a template to be used for all other sheets. Now I would say let's
go and save our work, and this is really amazing
new feature from Tableau. Are allowed now in Tableau
Public to store and save our work locally at
our BC without publishing. Let's go and do that.
This saves a lot of time. Let's go to file over
here and save us, and then we're going
to go to the types over here and to make sure that we are selecting Tableau
package workbook TWX. Now we can see over here,
we have a second option called Tableau workbook TW. I have as well a dedicated video explaining the
differences between them, but we will go with the package because I would like
to have everything, the data, the data
source, and the visuals. Go with the second option,
you will not save the data. You'll be saving only
your work and going to be really hard if you lost the
connection to the data. Let's store everything
in one file and choose the tableau
packaged workbook, and let's give it a name. HR dash words So. Let's save it. And
with that we are done, let's start implementing
the first requirements. All right. So now, the first
step with that, we're going to go and ask ourself, do we have all the
data in order to build our visual?
So what do we need? We need the total
hired employees, total active employees,
and terminated. So now if you check
our data over here, we don't have any information about the status of
the employee, right? So that's means we have
to go now and create calculated fields in order to derive and generate
those informations. So the first one is
total hired employee, which is records available
in this data set. We have this as a
default over here, but I would like to go
and create a new one. Let's go ahead create a
new calculated field. Let's give it a name
called Total Hired, and this is going
to be very easy, it's going to be the
count function for the employee IDs. So that's it. Let's go aha and click. Now the next one, we want the total number of employees
that are terminated. Now we have to take a
look to our data in order to choose a column in
order to build this logic. We have here the
termination date. The logic can be very simple, if we have termination
date for the employee, then this employee
is terminated. Otherwise, the
employee is active. Let's go and create this logic. So let's call it
total terminated, and now we're going to
have the following logic. Since it's logic, we're going to go and use the function if, if n is null, for the term date. So we are saying if the
termination date is not null. So we have a value inside
it, so what can happen? Then show the employee ID. And that's it, so
let's have an end. That means if it is null, so we have a null
value inside it, we will get as well null. Let's go and test the logic. I'm going to just click OK. And of course, in
order to test stuff, I'm going to have
a test worksheet. To check the data. So I need the records
of the employees. Let's get the employee ID, yes, add all members. Now let's take the termination
date as well over here, and our new field total terminated as well
to the outputs. So now as you can see over here, we have all the employee IDs. This is normal, and then we
have the termination date. So you can see if it is null, then our new field going
to have as well a null. So since we don't
have termination dates for those employees, then they are active,
so we have here nulls. But only if we have a date, then our new field
going to show the ID. We are doing that because
we want to go and count how many Ds do we have
inside this new column. That means our logic is working. What we're going to do now,
we're going to go and edit. Again, the calculation,
and we will do on top of it over here, just to count So we are counting how many employee IDs going to be used or shown
after this logic. That's it. This is
the total terminated, and to get the total
active employees that are actively hired
and not terminated. We're going to use
exactly the same logic but the way around. Let's go and copy everything
from here and click Okay. So of course, we're going
to get a red one because Tableau used to have it as a dimension and it's
not working anymore. So let's go and drop it. On more thing, as
you can see here, we have it as a blue bill,
the total terminated. Let's go and convert it to a continuous because it is
a major nut dimension. Now let's go and
create our third one, so it's going to be
the total active. And let's have the same logic. But before we start counting, I'll just remove
those staff away, I would like to test the logic. So if is null. So if the terminated
date is empty, then show the employee ID. Let's go and test
it. So I'm going to. And the same thing, let's go and drop it to the
view over here. Now as you can see here,
we have exact opposite. If that terminate date is empty, then show the employee ID. And if we have a value like
here for this employee, then don't show any value. Now, the same thing,
we're going to go and summarize all those values. So let's go and edit it
again and add accounts. Like this and it. Again, it will not work over here and we have to change it as well from a blue pill to a
green one to continuous. With that we got our
new three measures that we're going to
use inside our pans. Let's go back to our
templates over here. Since the band is
only one number, we don't need any
dimensions in the view. Let's go and drop
the education level. The first one is going
to be the total hid. Let's go and drop
it on the text. Of course, I would not
leave it as automatic. I'm going to make sure
it's always a text, and our number is here
on the right side. Let's go and change the setup. Let's go first to the
text to the three points, and now we're going to go
and change the font size to 18 and as well the color
to our light dark. Let's go and hit k, and as well. Now we still have it
on the right side, but it's way bigger than before. Let's go to the alignments and everything to the
center to the middle. That's it. This is the first peak
number from our data set, so the total number of employees inside our
dataset is 8,950. Let's give it a name as well. It's going to be
the pan of yards. So we are done with
the first one, Let's go to the second one. We want to have
the total active. Instead of creating a
new sheet from scratch, we're going to go
and duplicate it. So right click on
it and doblicate. What we have to do is to
take the total active, drip it on the tick over here, remove the old one, and let's go inside in order to make sure that
everything is fine. So we have here a new
line at the start, let's remove it, and hit. That's it. Let's go
and give it a name. You are the ban of active. Now, let's go and
create the last one. Let's go and duplicate it again. You are the ban of terminated. Let's go and get the total terminated two the
text over here and drop the old one away and as well
remove the new line. That means the total
terminated employees inside our data is
966. All right. So those are the
three peak numbers, the three pants for
the first requirement, the hired active and terminated
employees. All right. Moving on to the next
requirement at this says, visualize the total number of employees hired and
terminated over the years. We have to display
how the number of employees are developing
over the time, and the best type of charts for this type of analysis
is the line charts. You can go as well
with the bar chart. The line chart is
the best in order to visualize the
trend over time. So back to Tableau, let's go
and create our line chart. What we're going to
do at the start, we're going to go and duplicate one of those sheets in order
to have the same style, and then let's go and rename it. Going to be hired by year. Let's go and remove
the measure over here and now we have
an empty chart. Since it's over the time,
we need a date field, and this is going to
be the higher date. Let's drag and drub it to
the columns over here, and then the next one, we need a measure and it's going
to be the total hid. Let's rub it to the rows. Of course, our chart
is a line chart. Let's go to the marks over
here and make it a line. Now by looking to the charts, we have a lot of
unnecessary information over here that we don't need. Let's go and edit this x. Let's include zeros like this. Now the data looks way better. Now, the next sib,
we're going to go and edit the design
of these charts. First, let's go to the colors over here and pick our colors, so more colors, and
let's pick the green. The next sib, I
would like to go and highlight all the
area below the line. Let's go and get an
area chart below it. It's just for the design. In order to do that, you're
going to go to our measure, hold control and just duplicate
it as a second measure, with that, we have, of
course, two charts. One going to stay as a line, but the second one going
to be an area chart. Let's go to the
second one over here and change the type
two and area charts. Now the next step with that
we're going to go and merge those two charts into
one using the dual x. Let's go to the right
measure over here and let's use the dual axis. Of course, now things
are not matching together because we
have removed the zeros. Let's go to the right one, right click on it,
and synchronize xs. Now the line chart is exactly
matching the area charts. Now we can go and get rid of
all those lines and stuff, so let's go and remove the
headers from the left side, and as well from the years. And we want to get rid
of all those grids. So right click over
here and go to format. And now we go to the lines
and let's go to the rows. I remove the grid lines. Let's make it none. But
now looking to the charts, there is like a white box around our charts. What
we're going to do? We're going to go to the grid
over here and then go to sheets and let's remove
everything from here. So remove the row divider and
as well the column divider. With that, it's
look really clean, but still it looks
like not a line chart. It looks like an area chart.
Let's go and change that. Let's go to the area chart
and let's go to colors, and let's go and reduce the
opacity 215, like this. One more thing we can go and
reduce the size of the line. Let's go to the
line over here and make it a little
bit like thinner. I'm happy with that.
It looks nice. With that we got the total
hired employee over the time. Now we need the same chart, but not for the hired
for that terminated. What we can do were going
to go and duplicate this, and let's give it the name. It's going to be
terminated by year. And of course, we have to go and change all those affirmations. Now we have to go and replace the higher date with
a terminate date. So let's go and replace it. You can do it on top of it
in order to replace it. Now we have the termination date instead of the higher date, and now we have to go and
replace the measures as well. We need the total
terminated on top of the first one and the same thing
on top of the second one. By looking to the data,
we have here in nulls because we have employees
without any terminations. We don't need that.
Let's go and hide it, right click on it
and click hide. We don't need to remove
any zeros because the first value is one and it's very close. We are
fine with that. Let's go and hide all those
informations left and right and as well from here
or remove the headers. Now let's go and change as
well the color of this. Instead of green, we can have
a pink for the terminated. Let's stay at all and then let's go to colors and to
more colors and pick our second color over here
and click Thus we are applying the same color on both charts, the
line and the area. All right. We are almost there, but there's a white
dotted line over here. Let's go and remove it.
Let's go to format, and I believe it is a line, and it is the zero line. Let's go to the sheet and remove the zero lines,
and let's have a none. Perfect. With us we are done, we have now the total
terminated employees over the time by the years. With that, the
requirement is solved. Let's move to the next
task and it says, present a breakdown of total employees by
department and job titles. This means we have to go
and analyze and compare the values between different
categories, the departments. That means we are talking
about the category magnitude, and the best chart in this category is to go
and use the par charts. Now, my friends, if you need a deeper knowledge on how to
choose the correct chart, I have made a dedicated
tutorial about this topic, explaining the different
types of chart categories, when to use which category, and what is the best
chart for each category. So now let's go and
build a par chart for this requirement.
Let's go and build it. We're going to
duplicate as usual, and let's give it a name. It's going to be
the departments. And as well what
we're going to do, were going to go and
remove everything, all those dimensions
and measures. Now, it's very
simple. Let's go and get the departments to the rows, and we need the total
hid to the columns. Of course, we have
to go and change the marks to the parts. Now, of course, because
of the previous charts, we go and change the
opacity to 100%, and as well, let's go and pick the green color for this charts. Now since we are
using the Part chart, it would be nice if we
go and saw the data. Let's go to the axis over
here and click on sort. With that it is descending, we have the department
with the highest employees until we have the last
one is the lowest. Now since we are
using a par chart, it looks like a rank. We are ranking the
departments by the employees. We can go now and add
like a nice index, a nice rank number near
those departments. In order to do that, let's go to the roads over here
to the empty space, double click on
it, and now we can go and use the function index. We can use it in
order to ranking. So let's go and hit OK, and of course, it can break everything because
it's a measure. Let's go and convert
it to discretes. Now as you can see, we have a nice rank
to those departments, so we have 123 and so on. We can go and move it to the left side to the
names of the departments, and it's like a quick
indicators for the ranks. That's now let's go and format the charts by removing all
those unnecessary stuff. We're going to go to the
axis, remove the header. Let's go to this
department over here, right click on it and
hide field label. Of course, we're going to go
and remove all those lines. Let's go to format, and now let's go to the left
side to the lines. Let's go to columns and remove
the grade lines to none. All right. So that's
it. Now we can see the total number of
employees five departments, and we have a nice rank for it. Okay. Moving on to
the nx requirement, it says compare the
total employees between HQ and the branches. And here as an info,
New York is the HQ. It's like the previous
analysis where we have to compare the values between
different categories, the HQ, and the branches, and the bar chart here is the best type of chart
for this analysis. Now let's go and
create it as usual, we're going to create
a new sheet by duplicating any of
the previous ones. Let's call it location. And of course, the
first question is, do we have the informations
in the datasets? We don't have any fields about
the H Q and the branches. But about the locations, we have only two informations, the city and the states. But in the requirement,
we have a hint where it says the state New
York is the HQ. That means all the other
states are branches. So again, we have to go
and create this logic. So let's go back to
our test over here, and let's go and get
the states to the list. And now we're going to
create very simple logic where we are checking
the value of the state? If it is New York, then it's HQ. Otherwise, it is branch. So let's go and create
a new calculated field. Let's give it a name location. And now since we are evaluating
a value from a column, we're going to go and use the logical function
case statement. So we're going to say case. And then what we are evaluating, we are evaluating
the state, right. Let's write state. Now let's
evaluate the first value, which is the New York, right. Make sure to write it exactly like we have it in the dataset. So the first capital
litter, as we'll here. What happens if the
state is in New York, then you are the HQ,
right? It's like this. Now if the state is not in New
York, then it is a branch. So we're going to go and
use the default se like this and what can be
going to be the branch. So that's it, and don't forget
to add an end like this. So let's go and hit okay. Now with that, we got a
new field code location. Let's go and test, of course, to the right
side of over here. Now we can see in this
field, we have branches and HQ now in order to see all
the values of the states. I don't want to see
all the employees, so let's go and remove
all those informations, and now we can see
very nicely how the states are mapped
to the location. So only New York HQ, all other states are branches. Now we have the field that we need for their
requirements right. Let's go back to the
locations over here, and let's get rid of
those dimensions. We don't need it. We're going to stay with the total hired, but now we need our new
calculated field to the rows. Now, I would like
to go and switch this charts where we have
the locations on the rows. To go and click on this.
And they are switched. That's it, as you can see,
we can now go and compare the total employees between
the HQ and the branches. As you can see in
the HQ, we have way more employees than
the other branches. Of course, now, the
next step with that, we're going to go and change
the designs over here. Let's take the
location and put it to the colors by holding
control, of course. Then let's go to the
colors and edit colors. Now, let's go to the SQ double
connect in order to get our green and as well to the branches doubt and
let's get the gray. For the branches. I would like to sort the
data the way around. I would like to have the
Q first then the branch. Let's go to the location,
right click on it. Then go to the sort, and we're going to go
and sort it manually. I would like always to have
the HQ to the left side, so H Q on top and
then the branches. Now let's go and
remove some headers in formations from here. Of course, as usual,
we're going to go and get rid of those white lines, Let's go to format,
and then let's go to the lines and then
here, the axis rollers. Let's go and select none. As well, I'm going to go
to the next one x six, and let's have a none as well. Now on the right side over here, you can see we have a legend, we're going to go and
hide it since we want in the dashboard to
design our own legends. Let's go over here to this
small arrow and hide card. So that's it for
this requirement. Okay, let's go to the next
requirement, and it says, show the distribution of
employees by city and state. Now since we are talking about
the location informations like the states and the cities, here we are talking about
the special analyses. And of course, the maps are the best visual for this
type of analysis. All right. So now let's go and
create a map in Tableau. We're going to go and
duplicate the sheets in order to have the same design.
Let's give it a name. Map states. Let's go and remove everything in
order to start from zero. Now in order to plot
a map in Tableau, we have to go and get
those two informations, the longitude to the columns, and the latitude to the rose. With that, tab going to plot
the word map in the view. Now what do we need,
we need the locations. Let's go and get the state
first to the details. Let's drop it over here. And now depend on your location, you're going to get
different results. For me, since I'm
now in Germany, it's going to says
you have now eight nn informations. How we
are going to solve it? We're going to go to the
map in the menu over here, and then we're going to go to
this option edit locations. Let's go there. Now it's
currently to Germany, I'm going to go and
change it to USA. Let's search for
USA and that's it. Now as you can see, we have
everything mapped correctly between my locations and the
informations from Tableau. If you hit k over here, the unknown stuff
will be disappeared. Let's go and do that. Now as you can see
Tableu understood the informations
and zoom into USA. But here we have
very funny parts on the maps. It's not correct. Let's go to the marks over
here and switch it to a map. Now as you can see
Tableau is highlighting the states from our data
with a green color. So now I would like to go and change the design of this map. Let's go to the
menu and then map, and then we're going to go to this option, background layers. Since the style of our
dashboard is going to be dark, I'm going to go and change
the style from light to dark, and I would like to
go and get rid of all those informations
that I don't need. Let's go and deselect
everything from the layers. So we don't need anything. All that I'm happy, we got a very clean map with only states and
information that we need. Now let's go and add
the stuff that we want. The first thing that,
I would like to add again the name of the states. So hold control, drag and
drop the state to the labels. Now with that, we got
only the states from our data highlighted in the map. The next step of that, I'm
going to go and change as well the color based on
the hired employees. Let's close this
over here and get hire employees to the colors. Now tableau is using another
colors that we want, let's go to the
colors, edit colors. Now instead of having automatic, we're going to have our
custom coloring right. So let's go to the blue
over here, click on it, and we're going to have our
green again. That's it. That we got our coloring. Now it's really white,
what I'm going to do, I'm going to go to
the colors again, and let's go and
reduce the opacity. Let's just reduce
it and maybe more. Let's go and reduce more
to maybe 30. All right. What else we can do?
We can just highlight the borders of the cards.
It looks really nice. Let's go to border and
choose this color over here, and with that we have nice
borders between the states. That's it, we have now the total employees for each state, but now we have to have it
as well for the city, right. Let's go to the city
over here and add it as a new layer on top of our ma
So let's drow it over here. Now we don't have enough points. What we're going to
do, we can add as well the states to the details. Now with this Du is able to map all the cities
to the states, and as you can see, we
have those small circles. Now let's go and
add, for example, the total hired to the size. If the circle is bigger, that means we have
more employees, but I would like to increase it a little bit more like this, may As well, let's go
and add the coloring. Maybe we're going to go with
the location information. Let's go and get the
locations to the colors. That means the gray
dots are the branches, and only the green
one is the H Q. Now, let's go and
change a little bit, the design of those circles. Let's go to the colors. Now let's go and add
the border for it. Using our colors, it's
going to be green one. Then let's go and
reduce the opacity, maybe something like this way back to around maybe
30. All right. I'm happy with that.
On the right side, as you can see we
have those legends. Let's go and remove them. So hide and as well hide. So far, I'm happy
with this design. We got the total employees
by the states and as well by the cities and we
fulfill the requirements.
163. HR Project | Build Charts - Part2: So that we have covered
all the requirement of the overview section. Now let's move to the next one, we have the demographics. The first requirement in
the demographic section is present the gender
ratio in the company. We have to analyze the gender
proportions in our data and we call this type of analysis
part to whole analyzers. And the PI chart is a wonderful chart in order
to do this type of analysis. Let's create bi
chart in Tableau. We can go to the
locations over here and doublcate it in order
to use the same setup. Move it to the right
side, and let's give it the name, gender like this. Let's get rid of all
those informations to start from Of course, the question is, do
we have the data? Well, yes, we have the gender
information in our data, so we don't have to go and
create an e calculated field. Let's start with
the marks. I would change it from bar to Pi. Now in order to create
Pi chart in table, we have to go and
do some tricks. Let's go to the columns,
double click on it, and let's select the
average and zero. It is placeholder for a
visual or chart in table. Now for the Pi chart, I have a full detailed video on how
to create a step by step. Now we have to do it
a little bit quickly. For the Pi chart, we
need two circles, one for the inner circle and another one for
the outer circle. That's means we
need two visuals, and that's why I'm going to
have two placeholders for it. So hold control and
a duplicate it. With that, we have
two circles and now let's go and have a dual
axis for both of them and make sure to synchronize the axis and as well to hide
it and from below as well. Now we have two circles
on top of each others. Now let's go and configure
those informations. Let's go to all
first to the size. And make it a little
bit bigger like this. Here we have two
marks. The first one is for the outer circle, and the second is for
the inner circle. In order to see the coloring, we're going to go and
change the inner circle to something dark as well
what you're going to do, we're going to go to
the sides over here and reduce it in order to see, as you can see, we have
already a pi chart right. Now usually in the Pi chart, we show the total
aggregation in the middle, and that is the total hyd. Take the total hyad and put
it to the labels over here. Now as you can see, we have
e nice number in the middle. Now let's go and configure
the outer circle right. Let's go to the first
chart over here. Of course, we want to divide
the chart by the gender. Let's go and take the gender
and put it to the colors. Now let's go and edit the
colors, it the colors. Now of course, I
will not go with pink and green because
the pink means in our dashboard
terminated employees and we cannot use it over here. We're going to stay
with the green. Let's go to male over here. Let's go and get the green, but this time I'm
going to make it a little bit darker like this. And then hit k. Now
let's go to the female. We're going to take
it as well as green, but make it lighter. Maybe something like
this way lighter. As you can see the circle
is split it to two sides. Now we need as well few informations on top
of this circle. Let's go and get the gender
or let's comp it from here, hold control and put
it to the labels. As well, we need the
percentage of the employees. Let's go and get the total
hit to the label over here. But we don't need it
as an absolute number. We would like it
as a percentage. Write the click on the measure, and let's go and have a
quick table calculation. So we got a percentage
for male and female. I would like to
round those numbers. Again, let's go to our
measure and format it. Then let's go to the left side over here and instead
of automatic, let's go to percentage and
reduce the decimal places. With that, we are
rounding the percentage. So as you can see in
the chart we have for the male 54 and for
the female, 46. It looks really nice and
let's go and clothe it. Now this calculation,
I think we're going to need it later
in other charts. I would like to have
it in the data source, so that I don't have
to go each time and format and create this
table calculation. Let's go and drag and drop
it to our data source. Now as you can see
on the left side, we have a new measure. Cold calculation one.
Let's go and name it, so let's give the
percentage total hid. This is really nice in order to reuse the stuff that we
have already created, and it is a new
calculated field. In order to check the
formula for that, let's go and edit the
field, and you can see. It's very simple, the total hid divided by the total total yard. That's it for this
requirement. Now, we have a really nice pie chart in order to see the distribution of employees between genders. Wait, wait. Sorry, when
we think we have to remove the allegiance,
so we are not done yet. So let's go and hide it.
All right. That's it. Moving on to the next
requirement and it says, display the distribution
of employees across age groups and
education levels. Now we have to show
the relationship, the correlation between
two categories, two dimensions, the age groups
and the education levels. One of the best
chart for this type of analysis is the heat map in order to show the
relationship and correlations between
two dimensions. Okay, let's go and
build the heat map. As usual, we're going to
go and duplicate stuff. Let's give it a name. I'll
be age versus education. Now let's go and get rid
of everything like this. Now, the first question
is, do we have all informations in
the data source? Well, we have something
about the education level, so we are safe with this,
but we don't have ages. Of course, we can
go and calculate the age from the birthday. Here we have the
birthday informations, and we can use it in order
to generate the ages. We have to go to
our test again in order to see whether
everything is working fine. Let's go and add
again an employee ID in order to have the
level of employees. So Let's go and get the
birth date to the view. Now let's go and create
the logic of the age. We're going to go and create
a new calculated field, and let's call it an age. Now of course, how do
we calculate the age? It is the number of years between the birth day and today. Let's go and do that. We have to go and subtract
today from the birth dates, and we can go and use
the date dif function. So of course, the age is
based on the number of years. We have to specify
here the date part. So it's going to be year. What is the starting day? It is the birth date. And what is the end date? It's going to be
the function today. The two day function is
a table function that generate the current date
as we are speaking now. That's it. It's
very simple, right. Let's go and hand it okay. And with us we got a
measure continuous measure because of course, it's ages. So let's drup it to the output in order
to see the results. Now we're going to
have it as a measure. I would like it to
have it as dimension, let's convert it to
dimension and as well to discrete in order
to see the numbers. Let's put it beside
the birth dates. Now we have ages right. I think this is
the simplest one. If you check this
employee over here, you can see Bertha is 2000
and we have around 24 years. Of course, if you are doing
this project in the 2025, you will get the age of 25. As I'm recording this
video, we are at 20:24. It's really interesting when
you are doing this project, write it in the comment bellow. Of course, the task says
we need age groups, we don't need ages. In order to create age groups, we have to go and create again a new calculated field
on top of the age. Let's go and create a
new calculated field. Let's give it the
name age groups, and we're going to go and
use the FL statements in order to group up the
employees to a specific range. Let's start with the first
one, the youngest employees. All the employees that their
age is below or younger, 25 going to be in one range. We're going to say if the age, like this, younger than 25. Then they belong to the group, younger than 25 like this. Now let's go and define
the second group. It's all employees 25-35. So we have ten years in between. All employees where their
age is older or equal 25, and their age as well is
younger than 35 like this, and they all belong
to one group, which is 25-34 because here
we are not including the 35. That's it for this group.
Let's go to the next group. I'm just going to go and
cry bat it over here. We will just increase
the number of years 35-45 and the
same thing over here. 35 and 44. Let's go and add another group, it's going to be between
the 45 and the 55. Let's just increase everything with ten years as
well over here. Now let's move to the last group to the nicest group
where we have all employees where they are older or equal to the age of 55. LF age, it is older
or equal to 55, then we're going
to have 55 plus. That's it. Now we have covered all the groups that we
have inside our data. Let's go and date, of course, right. Everything is valid. Let's go and K. And with that we have
now a new dimension, and which is on the top
over here, age groups. Let's go and put it in the output in order
to check the results. What else I'm going to
do in order to test, Let's show it as a filter, and let's start with the
youngest generation, the employees where they
are younger than 25. Now as you can see,
all those ages is less than 25,
which is correct. Let's move to the
last one as well, to the oldest employees
over here, as you can see, they are all other
than 55 or equal. So, as you can see, it
is as well working. Let's check another
one over here. So employees 35-44, and
everything looks nice. Let's check this one 25-34. That you can see
everything looks perfect. Now let's go back to our
sheets, age versus educations. Let's get first the age
groups to the columns, and then let's get the
education levels to the rows. Now we have our matrix, but it is not sorted correctly, so let's go and sort
those dimensions. Right click on the age groups,
and let's go to sorts. Now the next in order
to have a heat map, let's go and change it
from Pi to circles, nothing at a change,
just to make sure we are not
talking about Pi. Now of course, what controls those circles is at the
number of employees. Let's go and get the
total hired to the size. Now we have our heat
map, but as you can see, those dimensions are not sorted correctly. Let's go and sort it. Let's go to the age group
radical on it and go to sort, and then we want to
sort it manually. The first is the youngest group, then 25, 35, so it looks
good, let's close it. The same thing for
the education level, let's go and sort it as well. As well, Manual. From education, we're going to start
with the high school, the Bachelor, master, and PhD. Now it looks better.
Let's go and close it. Now from designs, we don't
have any exits or anything. I will just go and
change the colors because I would like to decide
later on the dashboard. I would say, let's go with
the gray. Let's go and hit. Of course, don't forget
about this legend, let's remove it, so hide it. Check the data. It's
very interesting. You have the most
employees in the category 35-44 as an age group, and most of them have the pasar. With us, we can go and analyze the coloration and relationship between the age groups and the education levels
of the employees. Let's move to the
next one and it says, show the total number of
employees within each age group. Again, here we have the
comparison analysis in order to compare the
values within category, and as usual, the part
chart is the best one. Let's go and build it as usual, duplicate one of those charts, Let's rename it to age groups. This one is going
to be very simple, so we need the age groups, but we don't need
the education level. Let's go and remove
the sizes as well. We need the total hid as a rose, and instead of circle, we need pars. That's it. It's very simple and as well, it's already sorted because I've duplicated the previous one. The sorting of the
age group is correct. Let's go and hide.
This axis over here, and that sets for
this requirement. Let's jump to the next one. It's very similar. It says, show the total number of employees within each
education level. So we're going to go
with the same visual, the partot in order to compare the different values
within a category. All right, we're going
to do the same stuff. Let's go and duplicate
this one over here, and let's call it
education levels, and we have to go and
replace this dimension with the education level
so instead of age groups. We're going to have it
like this. But of course, we have lost the sorting
of this dimension. Let's go and sort it again. So let's go sort, and it's going to be Manual. And the high school is first, Bachelor Master PHD,
which is correct. So again, bar charts
are really easy. Okay, let's move to
the last requirement, and this section as it says, present the correlation between employees education levels
and their performance rating. So for this requirement, we're going to go again
with the heat map, since we have to show
the relationship between two dimensions,
two categories. Okay, so let's build
another heat map. So as usual, we're going
to go and duplicate stuff, and we're going to rename it two education
versus performance. So of course, the
first question, do we have all
those informations? Yes, we have the performance
and as well, the education. So we don't have to go and
create any calculated fields. We need the two dimensions. The education, we have
it already over here. Let's go and get the
performance rating, and let's check the marks from parts to maybe
squares like this. Let's go and get that
total hired to the size. All right. So now by
checking the data, we have to go and sort,
I think the performance. It's not correct. Let's go and
sort it again as a manual. It starts with excellent
good and then satisfactory. That means we're
going to have it a step above, needs improvement. That looks good. Let's
go and close it. Now, as you can see, we
have the highest group is between bachelor and good, which is okay because
we have a lot of employees having the Pahlor
compared to the PhD. Instead of having the
absolute numbers, let's go and get instead
of that the percentage, which is going to show
declaration more accurate. Instead of having the total
hired, I will just remove it. Let's go get this
total percentage. From higher to the size. Now the percentage doesn't
make really a lot of sense because here
we have 72%, 65%. I think this is cross table, so let's go to the measure
over here at click on it, compute using n table across. Instead of that,
let's go and change the calculation to
performance rating. Because we are focusing
on the performance, let's go and click on that. Now it looks more
accurate if you go, for example, to the employees
with PHD, as you can see, 48% of them having excellent rating, and
then the next one, we have good satisfy
and as well, the last one needs
improvement, only 5%. As you can see, the highest
group of employees with PHD, having the excellent rating. Let's go now and check
the high school. Here we can see this group is smaller compared to the PhD. We have here only 13% of employees with high
school education, having an excellent where
we see here a big puple, where we have 34% of employees with high school
that needs improvement. We can understand from this data that is generated from AI, that there's correlation between the education level and
the performance rating. The high education level might enhance and increase
the performance rating. But of course, this
is not a rule, it depends on a
lot of stuff like the field of for, the
skills, and so on. Not only the education level going to improve
the performance, but in this data, we can
see there is a clation. Of course, one more
thing before we close, we have to go and hide
the legend right. With that, we are done
with this requirement. All right, friends,
let's move to the third section and we
have the income analyzers. In this section, we're
going to focus on the salary based matrix and we have here
two requirements. First requirement says, compare the salaries across
different education levels for both genders to identify any discrepancies
or patterns. In this requirement,
we want to see the differences in salary
between the different genders. This is not only correlation, we are talking as
well about something called Gap analysis, and the Bs chart, the visual the gap analysis is
the parple charts. This is exactly why I go
with the parble chart instead of the heat map
because with the parple chart, I can very clearly and easily show the distance
between values. As well, we can
show the corration between two different
dimensions and categories. For this requirement, I will
not go with the Hat Map, since I cannot show the
distance between values, I will go with the
purple charts. Okay so let's build a
purple chart in Tableau. We're going to go and
duplicate stuff as usual, and let's give it a name. It's going to be gender
versus education level. So that set and let's go and
clean everything from here. But we're going to still
need the education level as a rose because we have it
already sorted correctly. What is a parable chart? It contains two points and the distance between
them as a line. So we need two charts, one for the line
and another one for the points. Let's
go and create it. We need the salary information. As you can see, we
have it over here. Let's go and drop
it to the columns, and we don't need
the sum of salaries. We need the average salary. Let's go and change
the calculation of the measure from sum to average. Since we need two charts,
we need two measures, and we are using
the same measure, so let's go hold control
and duplicate it. What does we have two charts. As we said before, one
going to be a line and another going to
be point data points. Let's start with the first one. Let's go over here and change
it from square to a line. Now since we want to show the distance between
the gender values, we need to go and get
the gender informations and put it to the path. What does we got like the lines, the distance, the
gap between points? Let's go and make it bigger in order to see those
informations to the max. Now let's move to the next
one where we're going to configure the points
of the genders. Let's go to the second
mark over here. Instead of square, let's
go and get the shapes. Now for the shapes,
we're going to have the gender informations. Let's go and drag and drop
the gender to the shapes. Now as you can see we
have our two genders, but I think we have
better shapes for that. Let's go to the shapes. Instead of default, let's
go over here and we have already from
tableau gender shapes. Let's go over here. That's it. Let's hit k. As you can see we have those signs,
but they are really dark. Let's go and get as well
the gender to the colors. So hold control and
put it to the colors. As you can see on
the right side, we have now those symbols,
but they are really small. Let's go and change
the size of that, something like maybe
to the middle. All right like this.
Now the next sit that, we're going to go and
put everything in one chart. Now
they are splitted. Let's go to one of those and use the dual axis and make sure that we synchronize
the axis as well. Now, we still have here a huge
space where it's not used. Let's go and configure the xs, edit xs and make sure to
remove include zeros. That's it. Now it
looks really nice. Now, of course,
we can go and add a label for the average sales. Let's go over here,
and let's get the average sales hold control
and put it to the labels. It's not really clear, so let's
go and change the phones. Let's go to label
and go inside it. Let's go and use
our second gray. Let's get the light gray. Now we can see the
numbers are really big. Let's go and change the
format of the salary. So right click on it
and go to format. Let's go to the numbers over here and as well to
the custom number. Let's go and remove
the decimals, and now the display
units can be thousands. I'm still not happy about
the symbols and the text. Let's go to the labels
and change the alignment. Currently, it's middle center. Let's go and change
it to automatic. It's way better. With that, we have the symbols and as
well the numbers beside it. Of course, don't forget
about the final ach. Let's go and remove
all those heaters from top and Patton. Let's not forget
about the legends. Let's go and remove it. And now we have very
clean charts. All right. So now let's understand the
result of this insights. As you can see the
average salary of male and female with
high school education, they are relative equal right. But now if you go and
check the bachelor, you can see the
average sales for male is way higher than female. As you can see, the pabl
chart is really amazing. You can see immediately the gap, the distance between
those two values. The males are getting
way more salaries than the female with
the education level of pas Let's go and check another huge distance between the genders if you check
the education level PD. As you can see, we have a huge distance
gap between the genders. But this time is the way round. On average, the female doctors are earning around like 25%, more than male doctors. As you can see the public chart is amazing in order
to understand the distance and the gap between data points and as well to
have coloration analyzes. This is amazing visual and that's all for
this requirement. Friends, now we're going to move to the second requirement of the income analysis and the last requirement
in the sum review, and it says, present how the age create with the salary for
employees in each department. This time we want
to show the cation, the relationship
between two measures, not two dimensions, like
the at Map, two measures. Of course, the best type of chart here is the scatter plot. The scatter plot is amazing in order to show the correlation
between measures. All right, now
let's go and build a scatter plot in tableau. As usual, we're going to go
and duplicate the sheets, and we're going to rename
it to age versus salary. So do we have those
informations in our data? Well, yes, we have
the ge ancillary. We don't have to create
any calculated fields. Let's go and clean up
those informations. Let's remove everything. We don't need all those stuff. So now let's start
from the scratch. Since it's corration
between two measures, we have to go and add
our two measures. The first one going
to be the celery. Let's go and drop
it to the rows, and we need the ages. So let's go and drop
it to the columns. Of course, we don't
need the summarization of salary and ages. We need the average.
Let's go and change that. Let's go and change it from
summary to average and the same for the age
from sum to average. Great. Now we got our two xs, our two measures and make sure that we are using
the marks of shapes. We got it from the
previous charts. Know what is missing, we
need the data points, and it's going to
be the job title. Let's go and get the job title
and put it on the details. Now as you can see, we
got our data points, but we have here
huge wasted space, and that's because we are
including the zero in the axis. Let's go and clean that up, edit xs and remove the zero and the same
thing for the average. D the axis and remove
zero like this. Now's say let's go
and change the shape. Instead of circle, let's get it a filled Damont like this. Now sometimes we have
overlapping between points. It would be nice if we reduce the opacity to
something like 75. Now let's go and add labels
for those data points, and it's going to
be the job title. Hold control job
title to the labels. Now let's go and reduce maybe the font size 9-8,
something like that. Now, of course, in order to get the effect of scatter blots, let's go and add reference
lines for both of the axis. Let's go to the
salary over here, right click and let's
add a reference line. So let's go and check
the informations. Average lines, let's
remove the label, and maybe we can have custom
tooltip like this average. And let's go and
insert the value. So now let's go and format it. It's going to be dashed
one, a thin one, and let's use our
gray color like this. So that's it. Let's okay. And with that we have a
very thin average line. Let's do the same for the ages. So add reference line. So no label, and let's add a
tool tip like this. Average. And the value and the
same format for the line, is going to be dashed one thin and as well our gray color. So, that's it. That's it, okay. So what we have created a
really nice scatter plot. So now if you check the jobs, like most of them are managers, right, we have the IT manager, finance manager, HR, and so on. So most of them are managers, but we have three types of jobs that are
getting high salary, but they are not managers
like software developer, and we have here
system administrator and finance analyst. As you can see below the line, we have different types of jobs, but none of them are managers. It makes sense, of course,
managers are getting higher salary than
the other jobs, but still there's some jobs that are getting high in salary. Now we are just checking the
salary, only one measure. Now, let's check the
coloration between the age and summary,
thinking about two things. Now if you take a look
back, we have a group of jobs that are centralized in
the middle, which is okay. But here we have extremes like the HR manager and
the finance manager. HR managers are
getting high salary, even though they are
young employees. And as well, it is the
only manager group that having young age. If you compared to the
other manager jobs, they are like around 40. So this is one
extreme in the data. So now let's go and check
the way on top to the right. We have the finance managers. So they are getting on average the highest salaries
inside our data, and as well, the average
age is relative old. So this is one extreme. And as you can see, we
have another position the IT manager is as well like moving toward
this direction right. So, my friends,
this is what we can understand from our data
from the scatter blots, and that's all for this
All right, friends. So with that we have
covered all the requirements for the
first dashboard, the summary dashboard, and
we built as well the charts. After that, we have to
go and put everything, all those charts in one single consolidated
tableau dashboard.
164. HR Project | Sketch Mockup of Summary Dashboard: All right, Sara, we're
going to go and build the summary dashboard and
here what we're going to do. First, we have to create a plan, where we're going to go and
sketch out the mockups for the dashboard and
the containers in order to have a plan
for the layout. And after that, we're
going to go and create the container
structure of the dashboard in order to put all those charts in
one single view. And after we have all
the charts in one place, we will start with the refining
and fine tuning process. So we're going to
go and tweak and twist a lot of stuff
like the text, colors, icons, legends, filters to get everything
looking just right. So are you ready, let's start with the first
step where we're going to go and plan the dashboard
for the summary view. A. For this project, I have decided to
have around 15 charts in one single dashboard. It is definitely a challenge,
but don't worry about it. We can do it step by step. Now, of course, we'll not
jump immediately by creating the dashboard because we will
struggle without a plan. Any professional in any
project knows that. Before building anything,
we have to have a plan. We have to have a blueprint. And of course, we want to
be professionals right. That's why we have to go
and plan the dashboard by sketching the of the container
end of the dashboards. So of course, the question is,
how are we going to do it? Of course, you can
go old style by just having a pin and paper, and you can go and draw the
sketch of the dashboard. Can go and use digital tools like, for example, PowerPoint, or like I'm doing here,
procreate using my tablets, or you can go and use
tools like Figma or DO. So any tools that helps you to design and to sketch the
mockup of your dashboard, that suits your fancy. So let's go and sketch the
mocap of our dashboard. The background is
going to be dark gray, and that's because we
are making a dark theme. So now we can have the
usual stuff where we have a title for the dashboard,
human resources dashboard. In their summary requirements,
we have three sections, and that's why we're going
to go now and divide our dashboard into
three main sections. We have overview,
demographics, and income. Now let's focus on
the overview and put everything that is required
in this one section. We're going to start with
the pig numbers, the bands. The first one is going to
be the active employees, and here we have a big number, and then we're going to
split it into two sections. The left side going to
be the hired employees, and to the right side,
we're going to have another big number for
the terminated employees. Now in order to have the effect of the KPI, what
we're going to do, we're going to put
the line charts exactly below those big numbers. Now below it, we're
going to have another section for
the department. We're going to have
our ranking of the departments using
the par charts. Then below it,
we're going to have the last section
in the overview. We have the location.
Here we have two charts. We have the one with the part chart where
we show the number of mploye in the HQ
and the branches, and the other charts
here, we have a map. We're going to put
the maps and the part charts side by side
in this subsection. As you can see, it's not really easy to fit everything
in one place. So that's all for the overview. Now, let's go to the
right section to the demographics and here
we have a big challenge. Have to fit in this section
five different charts. The first section is
about the gender, so we have our Pi charts. But now for the age
and educations, we have two separate par charts. What we can do here,
we can integrate all those three
charts in one block. In the center, we can
have the heat map, but on the top and
end to the right, we can have those par charts. With that, we have
all those three charts in one subsection. Now to the right side
to the last section, we're going to have
the performance and educations and here we
have another heat map. Let's move to the last section
to the income analysis. It's pretty easy. We have
here only two charts. The first one, the
gender and education, we can have it on the left side, and to the right
side, we're going to have here our scatter blot, the H versus salary. With us, as you can
see, in one dashboard, we are showing almost
15 different charts. Of course, in our dashboard, we have to have a section on
the left side for the logos, for the navigations,
between the two dashboard, the summary, and
the detailed views. Of course, we can go and add multiple
functionalities about exporting the dashboards or icons where we can
put our links. We will not forget
about the filters, so on the top right, we can have like
a switch in order to show the filters
or to hide it. All right, friends,
to the next step. Now we are not done
planning our dashboard. We have to go and
sketch the mockup of the container structure. Building a dashboard in
tableau requires a knowledge about how to control and
manage the containers. If you don't have
plan, I promise you things can get chaotic. That's why we have to bland
the container structure, and this time I'm
going to sketch the mocap using the DAO. DroO is amazing tool and as
well free in order to create professional charts and concepts that I usually do as
well in my projects. Okay, so now we are inside DO, and I just put our mocap
as a reference for us, and working with DroAO
is pretty simple. The first step that
I usually do that, I go to the style over here
and make it as a sketch. Now what this does is that
all the shapes that we have on the left side going to
look like hand drawing. So at the end of your
concept going to look really cool and n pouring. Now, for our
containers, we're going to have three different objects. The first one going to be
the horizontal container. So you are the horizontal. Container, and I usually
have the color of plue. Let's first year, remove the
fill and go to the colors. Choose plue and maybe
make it thicker. So this is the first type. The other one, we have a
vertical containers, right. So vertical container, and we're going to have
the color of orange. So maybe something
like this came. And the last box is
going to be our objects. It could be anything.
It could be an icon, it takes an image. So I would like it as Gray. Let's have
something like this. So we can see that
our whole dashboard is split it into two sections, the left sections where we
have the logos and the icons, and then the rest
to the right side. So that means we're
going to start with horizontal container for
the whole dashboards. So we're going to
make it like this. And we're going to have
it like this so big. All right, so let me
just remove the text over here and maybe
give it a text name. This is the whole dashboard. This is the first step.
Now let's start with the left one where we have
the icons and the logos. It's like a vertical, we have all objects below each others. What you're going to
take, we're going to take a vertical container
for the left side. We're going to call it Nav
for navigation like this, and let's make it a
little bit smaller. Inside, we're going to
have different objects like a logo. Let's
make it smaller. I will go and make
a feel for that, so let's click on fel
and gray, same here. Now we can zoom in and add more icons in order to
navigate between dashboard, to explore the dashboard, to put links, and so on. So we're going to
have multiple links and stuff on the navigation. This is everything
about the navigation. Now, on the right
side, what do we have? So we have first like
a title a filter, and then below it, we have
a whole section of charts. That's means we have two
objects below each other, and for that, we're
going to need again a vertical container. For the whole thing over here, we're going to have one big
vertical container like this, and we're going
to call it header and charts header and charts. Okay, something like this. Now let's start with the header. It looks like we have a header and beside it, we have filters. That's why we're going to go with horizontal container right. We're going to have
it like this and what do we have inside it? We have the header
and the filter right. So we have the title. And here on the right side, we're going to have a few icons or maybe one icon we will see. Now let's have a look to
our charts over here. Here we have three
sections right, but actually they are
splitted into two sides. The lift sides where we have the overview and the right side, where we have two sections. That means we have two
object side by side, and for that, we're
going to take another horizontal container. Let's do it like this.
It's going to be the main splitter between the lift side and
the right side. Let's start with the lift side. As you can see, they are
object beneath each others, and that means we're going to go and use a vertical container. For the lift side, we're going to have a vertical
container like this. Let me just remove
the name and let's go and call it the overview. Overview, and we have inside
overview, a lot of charts. We can have multiple charts like this and all of them are
beneath each other's. We will not now drill
down inside each detail. We will just have a rough
plan for the containers. Now let's check the right side. Now on the right
side, as you can see, we have two main sections, we have the demographics
and the income. That's means we're
going to go and have a vertical container. As well. The right side, we can have
vertical one like this, and we're going to
remove the name here. Now let's go and
check each side. As you can see, we have first
like a title and below it, we have different objects. Again, here we have a
horizontal container. We're going to have like this. It is very nested because it's
a little bit complicated. We're going to have
as well for the below section for the income. We're going to have a title and then charts. Let's
give it a name. This is the demographics, and below it, we
have the same thing. We have a section
for the income. What do we have
underneath that title, we have here like
charts side by side. That's means we can go and use horizontal container
for that right. We're going to have
horizontal container below it like this and inside it, we have our different charts. We have charts like this,
let's have three like this. For the income as well, we're going to have only two charts, we're going to need as well
a horizontal container since they are
object side by side, and we can have our two charts. All right, guys. I think
we have a plan, right, so we have a blueprint
for our dashboards, and we have a lot of layers
like around six layers. We will not find you now, the plan, is it
just a rough plan. But one thing that I
would like maybe to zoom in a little bit is
about each chart. So as you can see, for
example, this one, we have a title always
and below it a chart. The same thing goes
for the gender, we have a title and a chart. That's means we have a vertical
container for each chart. If we go and zoom in
inside those charts, we will not place
immediately the charts. We're going to have it always
as a vertical like this, where the first
object is going to be the title of the charts. So like this and below it, then we can have
that chart itself. All right, my friends. So
now we have a rough plan. So now let's go and implement those containers in Tableau. Alright, friends. So finally, we have now a rough
plan for our dashboard. But of course, it doesn't
contain all the details, so we will be like twisting and tweaking stuff as we are
building the dashboard. So let's go back to Tableau in order to build the dashboard.
165. HR Project | Build the Summary Dashboard: Okay, friends, let's go and
create a new dashboard and let's call it HR summary. Like this. Now, the
first step of that, we're going to go and define
the size of the dashboard. So let's go over here
on the left side. Instead of range, let's go
and select a fixed size, and this time we'll
go with that with 1,400 and the height
of 800. All right. So let's start with
the first container. It is the horizontal container
for the whole dashboard. What I usually do, I go over here and switch it to floating, because having everything
in one floating container, it adds more dynamic and we can go and change the
background as we want. Make sure to switch
it to floating, let's take the
horizontal container and drop it in the middle. As you can see, it's
a little bit small. What we can do, we
going to go and change the size of it in order
to fit our dashboard. Let's go to layout, and the widths going to be
exactly like the dashboard, 1,400, and the 800
for the height. For the position, it's
going to be zero, zero. Order to have it exactly
on top of our dashboard. Now in this phase
as we are adding the structure of our containers, I usually go and add borders
to each container in order to see whether
we are doing everything correctly. Now
let's go and do that. Let's go to the borders and add a line, thick one and plu. With that, we can see a
Plue horizontal container. Of course, let's go
and give it the name, so let's rename it
to hold dashward. Okay. Now in order
to avoid mistakes by converting the
horizontal container to a vertical container. I go and add planks inside it in order to make it as a fixed
horizontal container. Let's go and do
that, two dashward, and now let's switch
it back to tilt. Only the first main container going to be floating, the
risk going to be tilted. The first plank to the middle. Now make sure that the second blank exactly on the right side. Let's go back and check
in the lie outut. You can see we have planks
inside our whole dashward. Now let's go to the
next level and start adding the containers
inside the whole dashward, and here we have two
vertical containers. One for the Navy,
let's go and do that. We can have one vertical
container over here. As usual, I go and
add planks inside it. Let's go and add
the first plank. It's a little bit
small like this. Let's go and expand it. Let's go and add another
one plank below it. Make sure it's below
the first plank. Let's go and check the layout. Now as you can see, we
have a vertical container and two blanks inside
it, which is correct. And let's go name. Let's
give it a name of Nav, and we can go and remove
the first plank over here. We don't need it anymore,
so let's remove it. Of course, we can go and
add a border color for it. This time's going to be orange. This is the container
for the Nav. Now let's go and add another one for the right side for the rest. So, let's have a
vertical container and two planks inside it, one in the middle, and
one exactly below it. Now it's very small.
Let's go and chick the vertical container and
make it wider like this. Let's give it a name now. It's going to be header
and charts. So click. Of course, we're going to
go and give it a color like this and it's going
to be as well and orange. Now if you're looking
to the tree over here, we have a whole
dashboard and inside it, we have the nav and
to the right side, we have the header and charts. Let's go and remove this plank. We don't need it
anymore. From here. We will not now
focus on the Nav, since we don't have
a lot of containers, we have here only logos
and icons and so on. We will focus now on the
header en charts because here we have the
real content and we have a lot of containers. What do you have inside it?
We have two containers, one for the header, and another
one for the whole charts, and both of them are
horizontal containers. Let's start with the header, so we're going to go and
add horizontal container. In the middle. This time instead
of adding blanks, we're going to add one text for the title of the dashboard. It's going to be human
resources, dashboards. Let's add the word overview. Let's have it like this, and
let's have the size of 20. Now we're going to go and add
a blank to the right sides. Make sure you drop it exactly to the right side inside
this container. Let's go to the layout and
check what do we have. As you can see, we
have now a text and blank underneath the
horizontal container. Let's go and give
it the name now. This is the header,
and of course, we're going to go
and add a color for it, it's going to be the blue. Now we can go and remove
this upper plank. Like this. Now let's go and add another
container for the charts. So it can be as well
horizontal container, so drop its beneath it. As usual, we're going to go
and add our blanks. One here. Let's make it bigger and
one to the right side. And we go to the layout
and check stuff. We have two blanks inside
the horizontal container. Now let's go and
give it the name. Here we have everything, the
lift and right sections. Okay, and we're going to go
and add the borders as usual. So with that, we have
our two containers, and we can go and remove
this place holder from here. Now, let's keep drilling down and we're going to focus
on this container, the left and right sections, and here we have two
vertical containers. So let's start with the left
section, the lift container. We're going to have
it for the overview, so vertical container. And now let's drop
a text instead of blank and call it overview. And maybe let's make it like 12. Now below it another blank in order to make sure this
is a vertical container. Let's go to the
layout and check. Vertical to container,
we have title blank, and let's give it the name over view left section like this. Let's go and remove
this plank from our dashboard and don't forget about the
color of the porer. We can have it orange. That sets, let's make it a
little bit smaller like this. Now let's go to the right side, and we can have as well a
vertical container, like this, the same stuff, a plank and below it as well another plank, and we go to the
layout the same stuff. We have two planks and
let's give it a name, demo and income sections. As usual, the pder,
as we orange, and we're going to go now and remove the place
holder like this. Let's adjust the sides,
so the left section, the overview, should
be smaller like this, and then we have
the right section. With that, we have
everything on the left side. What is left is designing the containers of
those two sections. Here we have two
vertical containers. Let's go and do
that. The first one, We're going to drop it
here in the middle. Let's go and add it text for it. It's going to be
the demographics, and the size is going to be 12. Okay. Now let's make it bigger like this. Let's drop a blank. Make sure to drop
it exactly here, and let's go to the layout
and everything is fine, as you can see, I'm just
beak a little bit thicker. We have here the
text and the blank. Let's go now and give it a name. It's going to be
the demo section. Like this, and we're going
to give it as well a color. As well, a vertical container. Let's go and remove
this, placeholder, and we need to do
the exact same thing for the second section. Let's go and add a vertical
container, a text, going to be the income, 12, and we're going to make
it bigger like this. We're going to bring
as well a blank. Make sure to drop it
inside the container. Let's check the layout,
so everything is fine. Now we're going to
go and rename it as usual. Income section. Don't forget the
coloring like this. And with that, we are done. Let's go and remove
the last plank. Here we still have spacing. Let's go and adjust the size, so the demo going to be the middle and the income going to take as well
the whole space. Okay, guys, I promise
you the last drill down, where we're going
to add a horizontal container for the charts. For the demographics,
we're going to have one horizontal
container here inside. Let's go and add a
few planks inside it. The first plank small
and to the right side. So let's go and check that. We have horizontal container, give it a border color. Now we're going to
go and do the exact same thing for the income. We need as well
horizontal container inside it and two planks. On here. Let me just
make it bigger, and one exactly to
the right side. And we're going to
check the stuff. We have two planks inside the horizontal container,
give it a name. Income charts like
this, give it a color. And remove the placeholder. So let's go to remove it. Okay, friends, so we are done. Let's go and have a final
check on the structure. We have a whole
dashboard and inside it, we have the lift
section for the Nav, the right section for
everything header and charts, and inside it, we have two horizontal
containers, one for the header,
and another one for the lift and right sections. Let's drill down. We
can see here we have the lift section as a
vertical container, and then we have a right section for the demo and
income sections, and then we go and split it into demo section
and income section, and each one of them has a title and as well
horizontal container. The same thing as
well for the income So if you have it
like this exactly like me, we can proceed. If not, then go back
and do it step by step. Okay. Now the next step
that we're going to do the first iteration
in the dashboard, where we're going to
put all the charts inside our dashboard. We will not care a lot
about the designs. It's all about placing the
charts inside the containers. So let's start with the first
section in the overview, so make sure to select it. And I'm going to say, let's
make it a little bit bigger. So we're going to start
from top to down. We're going to go to dashboard, and let's go and add a title. For the first pan,
it's going to be the active employees,
so active employees. And let's centralize
it in the middle. Now below this title, we're going to have the
pan off active. Let's drop this chart below it. Of course, we're going to
go and hide the title. We don't need it.
Nice. Now below it, we can have two KBIs, the left and right,
and for that, we need horizontal container. But before that, we're
going to go and have a small separator between this pan and the
two bands below. We're going to have
a blank below it. Let's go and make it
smaller like this, and we're going to go and
design the following stuff. Let's go to the
background, or colors, Pick our gray and make the
opacity something around 60. All right. W we think, let's go and remove the outer budding 20. And we're going to go and
give it the name divider. All right. All
right. So below it, we're going to have a
horizontal container for the two KPIs. Drag and drop below
it like this. As usual, we're going to
go and add our two planks, one, and the second one, make sure it's going to be
exactly to the right side. So let's go to the
layout and check. So here we have the
horizontal containers. Let's go and call it. We're going to call it
QBI section like this. Of course, we're
going to go and add few borders for it
just to see it. All right. As you can see
now, things are smashed. Let's go reorganize it. We're going to make
this new container a little bit bigger like this. Now let's focus on
those two KPIs. Now what do we
need for each QBI? We need a title ban
and a line charts. So we have to have a
vertical container. So let's go and grab one
and put it inside it. Let's start immediately
adding stuff, so we need a text. It's going to be the hired
and make it to the center. Below it, we need the pan, drag and drop the pan, course, make sure to remove
and hide the title. Below that, we need
the line charts. It is hired by year and drop
it exactly below the pan. And we hide the title. Now this is the first container. Let's go and check the layout. We have here,
vertical container, we have the title, pan, and as well the line charts. Let's go and give it the
name and be hired BI. Like this, let's go and remove the first place holder from
the plank. So remove it. Now, don't worry about the
size and the coloring. We're going to do a
second iteration on the dashboard in order
to do fine tuning. Now we can just a
little bit adjust the side from the
line chart like this. Now we need in the
right side, again, the same KBI, the same steps. Let's go and grab a vertical
container to the right side, make sure to drop it
inside the container, and we need a text. It's going to be
terminated in the center. So what do we need else, we
need a pan so make sure it is exactly below the text and
as well, hide the title. Let's go and this small zone to this container,
go to the left side. And as well, the blank
should be smaller. Now what do we need, we
need the line chart. So let's go and drop the
line chart below the pan. Remove the title and make
it a little bit smaller. Now let's go and
check the layout. So we have a vertical container. We have a title, pan, and
as well, another chart. Let's go and rename it. This is the term KPI. Okay. Now one more thing, I would like to go
to the this blank, rename it to divider. Like this, Let's give
it the same coloring. It's going to be the dark gray and as well the
pity 260 like this. Let's go remove
the outer padding. Now what do we have
below that? We have the department and like
lines lift and right. For that, we need a
horizontal container. What do we need? We need
a text in the middle. I' going to be departments, and it should be in the
middle andft and right, we're going to go
and add a planks. Make sure to drop it
exactly to the lift. And exactly to the right. Let's go and check the layout. We have here, er container,
blank, department blank. So let's go and color those
stuff in order to see it. It's going to be the d gray and 60 without any outer bodying, the same thing for the next one. 60 and no ao padding. We can go and call
it department title. Now what do we have below it? We have the chart
of the department. Let's go and drop it
beneath it, and of course, go and remove the
title like this. Now below that, we can
have the location title, so it can be exactly
like the departments. What do we need? We need horizontal
container. We need a text. Let's call it location like this and centralize
it in the middle. We need two blanks
lift and rights, like this, and we
go to the layouts. We have plank location plank, and we can rename it
to location title. And we're going to
design those planks, so make it gray, 60, and remove the padding. The same thing for the next one, as well, 60, remove the padding. Now, below that, we
have two charts, one, a map, and another
one, a bar charts. What do we need? We need
horizontal container below it, and we need the two charts. Let's get the location to the right side,
remove the title. Let's go and get
the maps exactly to the left side, and
remove the titles. Now let's go and check
what we have done. We have horizontal container
and the two charts. Let's go rename it, can
be the location charts. And now we can go and
remove the last plank. It's just a placeholder,
so remove it. That's it, we have
now all the stuff inside the overview section. As you can see if
you don't do it slowly and step by step, planning, everything,
this can be cows. But with the planning,
everything going to be easy. Now let's move to another
section to that demographics. Here we have a lot of charts.
Let's do it step by step. We are this section over
here. What do we have? We have a title, and then we have multiple charts
side by side. As usual, each chart
is a vertical, we have a title, and as
well the chart itself. Let's go and add the first
vertical container over here, and then we need
inside it a text. So make sure to drop it here. This going to be the gender. And center. And below
it, we need the charts. Let's go and pick our Pi
chart for the gender, drag and drop it beneath it. Of course, we're going
to go and remove the title. A great. Now before we go
to the next chart, we're going to go and
have a divider like this. Let's go and give it the colors. Gray, 60 like this and The outer pudding. Now
to the next charts, we need as well a vertical
container to the right side, make sure to draw it
right to the divider, and here we need three charts. Let's do it step by step.
First, we need the title. It's going to be education
and H to the center as well. Below it we have the
first bar chart, which is the H groups. So drag and drow it beneath the title and remove
the title as well. Now beneath it, there is
two charts, the heat map, and as well, the bar
chart of the education. Since they are side by side, we're going to go and get
horizontal container beneath. So drop presenter container
exactly beneath it. So now things are
getting resized, left or right, and so on,
don't worry about it. The main thing does,
we are placing the charts in the
right container. So let's go and get first H
versus education and put it. In this new container,
remove that title, and now to the right side, we need the education levels, so make sure to place it to the right side and remove
as well the title. So now let's go and
resize this divider in order to have a little
bit space. Like this. Now we have to change
a few stuff with those part charts like
hiding the headers. For example, click
on the first one, right click on the
header and remove it. Now for the second chart, I would like to switch stuff. So let's go inside this chart
by clicking to this arrow. Now I'm going to go and
switch columns rows, and as well, we're going
to go and hide the header. Let's remove it and we have
to go back to our dashboard. So we're going to stay
with this, but we will configure it later on
the second iteration. Now let's have a look to the
layout in order to make sure that everything is
correct. So let's see. This is the vertical container
for the education and age. Let's go and rename it. Education and age
charts like this. It should has a title then the first chart where
we have the part chart, and then plod, we have
horizontal charts, where we have two
charts side by side, the at Mm and the part charts. If we get it like this,
then we can proceed. So now we need another
chart to the right side, where we have the last
chart in this section, but we need a divider
between them. So let's go and get a plank and drag and drop it exactly
to the right side. So make sure you
drop it correctly. So let's go and
check the layout. We have the color of
gray and as well 60, and the outer budding to zero. Now as you can see, our plank is after the education
and age charts. So let's go and rename it. If either, and as usual,
we need a container, so it's going to be a vertical container
to the right side, and we need a text. It's going to be education and performance like
this in the middle. And this is going
to be very simple. We're going to go
and get the chart just below it like
this, remove the title. Of course, you can
go and make the divider a little bit
smaller left and right. Okay, let's check again the layout, whether
everything is fine. So we have a vertical
container for the last chart, we have a title and beneath
it, we have the charts. Okay, we are done
with this section. Now, let's move to
the last section to the income. So what
do we have over here? Let me just close this and as well this,
we have the income. So we have a title and beneath
it, we have a container. We need here two
charts as usual. We have the vertical container for the first one,
and we need a title. So let's go and drop
a text inside it. It's going to be
education and gender. Make it in the middle.
Now we need our charts. Let's go and drop it beneath
the title. Remove the title. Now before we go
to the next chart, we need a separator or divider. Let's just design it as usual. To 60 and the padding to zero. Now we need to build
the last charts. As usual, we get a vertical
container to the right side. We need a title.
It's going to be age versus celery to the middle. Okay. And of course,
we need our chart. So let's go and
drop it beneath it. Remove the title and make the
divider smaller like this. Okay, so that's it
for this section, and now we have all
our charts inside our containers as we
planned. All right, friends. So with that we
have all the charts in one place in one dashboard, now we're going to start
with the process of refining and find unit
of the dashboard, where we're going to
go and tweak and twist many stuff in order to have
a professional dashboard.
166. HR Project | Fine Tuning The Summary Dashboard : Right, friends. So
with that we have all the charts in one
place in one dashboard. Now we're going to start
with the process of refining and find uni
of the dashboard, where we're going to
go and tweak and twist many stuff in order to have
a professional dashboard. Okay, so now, the
first step of that, we're going to go and
add background colors to the dashboard as containers, and we're going to go and remove all the background colors of the worksheets. Let's
go and do that. We're going to start
first with the whole dashboards over here. So let's go and
add the following. It's going to be
like a dark gray. So I will go with
this one over here. So we have the background, a dark gray, and then the
section is going to be black. So let's go to the next step. We're going to go to
the navy over here. So thenav going to
be its own section. That's why we're going to
have it as a black like this, and then to the right side, we will not have
everything as black, we'll have only the
three sections overview, demographics, and income. That's why I will not
change anything over here. Let's go to the sections, and we're going to start
with the overview over here. We're going to have
it as a black. Then we need those two sections. We need the demo section, it's going to be as well
plaque and as well, the income section
can be plaque. With that as you can
see, we are getting now the dark theme
of our dashboard. The next se of that,
we're going to remove all the background colors
inside our worksheets. We have added it at
the start in order to have a feeling
about the dark theme, but now we will not use the background colors
of the worksheets, we're going to use
only the dashboards. Now we have a boric task, where we're going to go
through all the sheets and we're going to start
removing the background. Let's start from the top left. We're going to
start with the pan, right click on it
and go to format, and then we go to shading
and we're going to go and remove the worksheet
color. T none. Now we're going to go through all worksheets that we have, and we're going to go remove
the background color. We can do it in the
dashbard here or you can go and visit each of those
sheets one by one. We have the last one.
Remove like this. We are done. Now we have fixed the background colors
of the dashboard and as well the worksheets. All right. Moving on
to the next step, were going to go and fix
the font size and color. Let's start with the
title of our dashboard. Let's select the whole thing, and we're going to go
and use our light gray, and we make sure it is 20, so we have it as 20, and
let's make the first section the title itself as a bolt and we leave
the overview as it is. So that sets it. Now we're going to go and edit the
title of each section. Here we have three
sections, overview, demographics and income, and we're going to
do the following, let's go to the overview. We make it light gray. Like this, and we're going to
make it as we 14 and bold. Let's go to the next one, we're going to do the same stuff. Bold, change the color to
light gray and make it 14, and to the last section. 14 bold and, we pick the color. The sections looks
exactly the same. Now we're going to go and edit
the titles of each charts. We're going to have
the following list start with the agenda over here. We're going to make it
as well light gray, and we're going to make it as 11 for the size of the font. Let's go and do the same
for each one of them. It's going to be 11 light gray. For the next one for the next. 11 for the age and gender. All right. And don't forget about the departments over here. 11 ands gray and the location. And 11. Now we are done
with the titles and stuff. Now, let's go and check the
phone size inside our charts, and I would say we
can make it smaller. We have to go
through that again. Let's start with the department. Go to formats, and instead of nine, let's
have it as eight. Let's go for the index as
well and move it to eight. I would say let's make
it bold all right. Now let's go to this Pi
charts, make it eight, and the same thing for the map, so click somewhere, go to
ft, and make it eight. Now for the Pi chart,
I would go inside its, and we're going to go
to the outer circle. And there we're going
to go and change the font size to eight. But the big number inside, we're going to
leave it as it is. Maybe we're going to make
it little bit even bigger. Let's make it ten. Let's go back to our dashboard, and now we continue
to the next charts. Make everything as eight. Same for the age. Now to the next one, same stuff. And as we eight for the income, and for the ages and stuff. Everything should be eight. I think it looks really nice. We are done now with the font
size and colors. All right. Now the next bit that we're
going to go and visit all the chart again in
order to enhance it, refine it, and maybe
add extra stuff. Now let's have a look to
the departments over here. What we can do,
we can go and add the status of the employee
for each department. We can show as well on this
par the total terminated. In order to do that, let's
go inside the chart again. Now we need like a
status dimension in order to control the
colors inside those bars. We don't have it yet, so that's why we're going to go
and create a new one. Let's call it a status. So it's going to
be the same logic. Let's go and have an F
statement. F is null. The terminated dates, term date, then it is employed. Then the employee is hired. Otherwise, terminated like this. Let's go and end it, and now we're going to
go and take the status and put it to the
color over here. Let's go and assign
the coloring, so the hired going
to be the green and the terminated going to be the pink. Now, what
else I'm going to do? I will just go and switch
between those two status. Let's go and do that.
And I would like as well to show the total
hired inside the label. Let's go and get it, and
we can go and change maybe the color of this
label to light grate, and maybe make it seven, something like this,
and we can make still the index smaller. Let's go back to our charts. Now we can see in
this parts as well, the number of
terminated employees. I would say let's make the
index, little bit smaller. This. That's all for this chart. Let's move to the next one. We're going to go
inside this chart. I would say let's
add the percentage informations to the columns. Let's go and get the total higher and put it
near the location, and then let's go and
switch it to discrete. So that we have the percentages here and the header
information on top. What we're going to do we're
going to go and change the format of those percentages. Let's remove the decimals. Let's go and make those
parts a little bit smaller. I'll go with
something like this. Let's go back and
check the dashboard. They look nice, maybe
we're going to make it smaller size for the font. Instead of nine, we
usually have eight. And we can go and
make it smaller. We have more places for the
map, something like this. Now for the map,
everything looks nice, so we don't have to
change anything. Let's go now to the
gender informations. Now, what we can do, we can make maybe two pie charts
for each gender, and then we can show
the percentage of terminated employees.
Let's go and try that. Maybe it can look nice,
so we can go inside. Now in order to do that,
we need the gender as row. Of course, now, our
bi chart did broke, so let's go to the outer
circle and repair it first. We don't need the
gender information. We have it here as a dimension. What do we need for the colors, we need the status of the
employee, and as well, we need the total hired as percentage and put it on the
Pi. Something like this. What you can do inside those
circles for the big numbers, we can change it to
the percentage right. Let's go and replace
it with a percentage, something like this, and
let's go and format it. So to the percentages and
remove all the decimals. It looks nice right now, we can see the percentage of
terminated for each gender. Let's go and have a
look to our dashboards. Now, it looks that
it needs more space, what we can do, we can go
and rotate the labels first. And with that we
have enough space, maybe you can make it
a little bit bigger. We're going to fix the
spacing between charts later. One more thing that
I just noticed that the inner circle of the bi,
they are naturally black. Let's go to the chart again. To the inner circle
to the colors, and change it to black. Let's go back. That we are done with the gender
chart, as you can see. We are really thinking
again the chart as we see all the informations in
one place in the dashboards. Now we're going to come
to the fun one where we have here three charts
on top of each others. First of all, let's
give it more space like this and maybe make
it a little bit bigger. Now what do we have we have
here four values and for the age we have here
like five values. What we're going
to do first, we're going to give it more space, and I'm thinking about
maybe we're going to go and switch those
two informations. Maybe it's going to
look more better. Let's go again inside the chart. Let's go and flip it like this. Let's go back to our charts. Now it looks more nice, Let me just make this
smaller, something like this. Now we can see that
the high school is taking a lot of space
inside our charts, so we can go and edit
the ES for that, so right click on
it and edit LS. We let's have it like this
as an abbreviation. Okay. So now we have more space. We have to fight with the
space inside this dashboard. So now the next sib
that, I would like to go and highlight
the highest value. So as you can see now we
have everything as gray, and if we highlight now the highest value, it's
going to be very clear. So let's go inside this chart. And now in order to
highlight the highest value, we have to go and create
a new calculated field. So let's give it a
name highlight Max. So we need the function
max but for the window. What is our measure? It is the total hard so the total hid. We are searching for
the highest value. And if the current value equal To the highest value.
We're going to get true. Otherwise, we're
going to get false. Let's go and hit k, and let's use this function
on top of the colors. Now let's go and change
the coloring first. If it is false, it
should be a dark gray. If it's true, we
want it as green. Now if you check the view,
we have multiple values as the highest value. We would like to
have only one value. Let's go and change the
aggregate function, right click on it, and let's go and edit the
table calculation. So now let's go to
specific dimensions and we're going to consider
both of the dimensions, and with that, we
have only one value, which is exactly what we want. Let's go and hide the legend. We don't want it in
the dashboard yet. I would say let's show as
well a label for the highest. Let's go and take that total
hight as a percentage. Put it on the label,
and of course, we're going to go and change
the table calculation. It should consider both
of the dimensions. So let's close it, and we're going to go and
change the format as usual. We don't want all
those decimals. Let's remove it, and let's
go and change the format. What we need, we need
it let's go with seven, and with a light gray. We don't need all the values. We need only the men and max. Switch it from all to men and max and remove the
minimum value, so that we have only
for the highest value this label. I think we are done. Let's go back and
check how it looks like in the dashboards.
It's fine right. Now let's go and fix all those part chart
lefts and rights. We have here switched
the dimensions. That's why we have to go
and switch this as well. Make sure to do it correctly, so we're going to bring it down and the other one should go up. What we're going to
do, we're going to go and switch as well the
dimensions like this. This is for the
first chart and as well for the next
charts like this. Now let's go and highlight
as well, the highest value. Let's go back to this charts. We're going to take the
highlighted value as a color. Of course, we're going to
go and hide the legend as well. Let's remove it. I would say let's go
and reduce the size of those pars in order to
fit inside our charts. I will go something around here. We will see. Let's go
back to our charts, and let's do the same
things for the ages. We're going to go and get the highlight value
to the colors, and we have to go and change
the colors over here, so it's going to be Gray and
true, going to be green. Let's as well remove the
legends and as well, we have to go and
reduce the size of those pars, maybe
something like this. All right. Let's
go back and check. So now as you can see with
the highlight effects, it looks really nice. Now as you can see
the parts are not fitting exactly on
top of those values. We will fix the spacing and the positions later
as the next step. So we can leave it
as it is for now and let's move to
the next charts. So let's go inside it, and I would say let's go and highlight as well those values. Now, we cannot go and use the same highlighter because
here we have percentage, and our highlight is based
on the absolute numbers. So what you can do going
to go and duplicate it. And let's re name
it two percentage. I'll remove the b
as well from it. Let's go and edit it. Now instead of having the
total yard we can have, we can have the percentage
of total hyrod ride. We're going to
take this measure. I remove the
percentage from here. Let's go and copy it and put
it as well for the equation. Hit and let's move
it to the colors. Now, of course, we
have to go and add as well the coloring as usual. False is gray and true, can I be green, and we're going to hide
as well, the lesions. Now let's go and check
the table calculation, whether it is
configured correctly, so dit table calculation. This one should be based on the performance
rating like this. Now I'd say let's go and add
the label for those charts. We're going to take
the same measure, hold control, and put
it on top of the label, and let's go and
adjust the style, so it's going to be light gray. And we're going to
have it as an eight and we don't need
all those values. Let's have only the min and max. Now we have the mean
value and the max value, but I don't want the min value, so we can have only the
max value like this. That sets, let's go
back to our charts, and I think everything
looks nice. Now let's go to the
education versus gender. I think here in the charts, I would not add anything.
It looks really nice. But I would go and change
the size of the labels. We forgot about
that. Let's make it eight instead of nine. So Doch. Now for the last
chart over here, I think we have to go and
add some coloring tots. So I will just go and
add our green color and maybe reduce the opacity to
something like 50, very nice. And maybe go and reduce again, the size of those labels
to something like seven. Now I would like to go and
add for the axis a line. Let's go to format. So let's go to the lines
over here and on the sheets, we're going to go to the axes. And we can add a line for it, and we make sure that we are selecting our dark
gray for that. Maybe as well reduce the opacity to somewhere like
around maybe 60. Let's go back to our charts and maybe let's go and
rename those axis. Instead of average age, we're going to have only the age and the same thing
for the salary. So we're going to
have only the salary like this. That's
it for this chart. As you can see,
we just revisited all the charts and we
added extra stuff, some refinement and fine
tuning. All right, everyone. Now in the next step, we're
going to start working with the pixels in order to add more spacing between all
those sections and containers using the
inner and outer padding. Now the distance between
all those main sections can be always as a 20.
Let's start doing that. To for the left side
from the navigation. Make sure to select the
navigation over here. Now, the first thing
that we're going to go and get rid of all
those porters. We don't need it. Now
we have to add 20 as a space between this section
and the outer dashboard. We're going to go to the
outer bedding over here and just Add 20 everywhere, top left, bottom right. The next step of that,
I'm going to go and do a fixed width for
this container. Let's go to this
small arrow over here and edit the width, and we're going to
have the value of 100. So let's do it like this.
Now, as you can see, we have spacing between the container and the
border of the dashboard. Now let's go to the
right side completely. So let's go and select
headers and charts, remove the border,
we don't need it. So as you can see we have a lot of spaces on the right side, so we're going to go
and edit the width. Instead of this
value, we can have, let's go with 1,300.
Let's go like this. Now if you take the
whole container, we need spacing
from the right side and exactly going to be 20. Let's go to the outer
bedding over here. The select all sides
equally because we have already space between
those two sections. We need only from
the right side 20. Now let's go inside
all those containers and start adjusting stuff. The next s is that's the header. We're going to go and
remove the border, and I would say let's go and have a fixed
height for that, so change it to fixed. And as well, let's
say the fixed two, 65, something like that. We have a little bit spacing between the charts
and the title. I'm happy with that. Now let's go to the next section
to the left and right. We can see here, we have enough spacing around the dashboard
for the whole container. Let's go and remove
the border for that. I would say let's
jump to the next one. Let's go to the overview on the left side.
What do we need here? On the left side, we have a 20, so we are safe on top, on bottom, but on
the right side, we don't have enough space
between the sections. That's why we're going
to go and adjust it. But first, let's go
remove the border, and then we're going to
go to the outer padding and we're going to
remove all sides equal, and on the right
side, I need 20. Now we can see we have enough spacing between the
lift and right. That's look really good for now. I would go as well change the container color of
those informations. So we don't have anything. Now let's go to the right sides and select the whole container. We are at the demo and income
section, remove the border. I think we are done with this. Let's go inside those sections. Let's go to the demo
section, remove the border. Now of course, we
need now spacing between the demographics
and the income. On the bottom, we need 20. Let's go to the outer patting, D select and only a
bottom, we need 20. Looks really nice so far. Of course, let's go and
remove all those borders, so we don't need it anymore. O this as well, we don't need borders and here. I think we have to
go above like this. If ID selects, we
still have one border, which is the whole dashboard. So is just remove it. As
you can see adding spacing, it's like giving air
to your dashboard, so it can breathe. Now we're going to go
and add an inner adding inside those sections. We will ignore for now
deidentifications, because we're going
to have another story about the icons. Now if you check those sections, you can see that the wording is very near to the border
of the section right. We have to give
here some spacing. We will do that only for
the main three sections. We're going to go
first to the overview. Like here, and now this
time we're going to go to the inner budding and we can add a seven,
something like that. You can see as we are
moving the values away from the border,
it's easier to read. We can do the same thing
for the section over here. We are at the demo
section and go and give it seven as well. The same thing for the income. The income section over
here, let's go and give it. Seven. Sometime we
can see those values, male and female, they are not
on top of the border right. Now let's have another look.
I think we can go and add spacing between those titles and the title of
the section right. What we're going to
do, let's go and select the whole container. Demo charts, and we can
add on the top adding, only the top, something
like five right. We have here a nice space. Now as you can see
in the demo charts, we still have some
spacing below right. What we can do, we can
go and e it the height. Instead of this value, we can go and increase it. To 300. So that we are
using the whole space. Now, let's go to the other
section to the income, and let's go and select the whole container
income charts, and we're going to
do the same thing, so we're going to go
and add on top five. So we have some spacing between the title of the main
section and those charts. Now if we sit back and check the whole sections and
the spaces between, then we can see that
everything is perfect. We have 20 everywhere, but only here we have
a problem right. As you can see here, tables
show it as hash line. It means there is an
issue with the spacing. So we have to go and fill it. So what we can do, just click on One of those charts and
just move it like below. So we are just pushing until
we reach the limit right. The spacing between those
sections are perfect. That's all about the spacing
between all those sections. Now we have to go
and focus about the spacing inside each of those sections and
between the charts. Of course, we're
going to go and fix all those dividers
between the charts. I would say let's start with this section, the demographics. Now my rule is side one section, we can to have ten between the charts. Let's
go and do that. We're going to start from
the left to the right, so we're going to select
the gender over here, and we're going to
have the outer padding to the right side as five. Let's go and selected like this, and then to the next one, we have our divider. Our dividers has
always on the top, we have ten outer padding and
on the bottom as well ten, and we have to go now and
make it really thinner, so we're going to go
and at it therewith, and we're going to have
only one With that, we can have a really fine
line between the charts. Now let's move to the
next chart over here. We're going to have from the left five and from
the right five. With that, we have a total
of ten between the charts. That's it, let's go
to the next one. Here we have a divider. As usual, we're going
to have ten on the top. Tin in the bottom, and
we have to make it thin. So we're going to go and
addit the width to one. Now let's go to the
last chart over here. So the whole container. From the left side, we're going to have a
five, and that's it. On the right side, we don't
have to deal with that. As you can see now, we have
really nice separation between all those charts and we have enough
spacing between them. Now finally, we
can go and adjust this middle chart since we
have now the spacing perfect. We're going to do it
like this. We can select the top charts, and we can just reduce the size of it a
little bit like this. Now what we're going
to do, we're going to go and squeeze this chart from lift and right until
it matches the values. Let's go to the outer
padding over here, the elects, and let's start
with something like 4070. We are almost there.
We have to keep pushing between those values. Maybe like this, Yeah, we are almost there, but we are shifted a little
bit to the right. Let's increase the right and
maybe the left and come on. So now we have it perfect. To know if I deselect, it looks like we have the part charts on top exactly
of those values. Now we're going to do the same
thing for the right side. I think we have to push
more from the top. Let's go over here to the outer budding and then deselect. Let's go and start with 20. So I think we are almost there. Let's go with 25,
maybe one more. T six. Perfect.
So now we have it exactly on the rows of the ages. So now the chart
looks really amazing. Okay, so we are done
with that demographics. Let's go to the income. So we're going to
do the same thing. We're going to go and select the whole container of the charts, and to the right side, we're going to have
five like this. Then we're going to go and
edit the separator from top. We're going to have ten
from pattern as well, ten, and of course, the width going to be one, let's
do it like this. Now let's go to the
right container, and we're going to have
from the left side five. That's we have a total of ten. I would say we can push on those spacing to the left
side a little bit. To the ptular right now
with that, I'm happy. Final look to the income. I would say we can
go and increase the whole height
of those charts. Select the whole container and let's push more
on the height. Let's go with the 300 again. We are done with
the income section. Now let's go to the left side. Let's start with the
first pan over here, and we're going to have L
five between the charts, but this time we have
it as a vertical. We have it four over here, but we can go and make it five in order to
stick with the rule, and let's go and
make it a little bit bigger to see the pan. Then we have our divider. This time, we're
going to have from the left and the right.
We're going to have ten. And we're going to have as
a height one like this. Now we're going to go and make everything like in the middle. So make sure to have it
something like this, and we have to go and
change this divider. We have to have on the top
ten below as well ten, and the width is going
to be as usual one. Then we have to make sure again that the containers
having the same side, something like this and
the middle perfect. Now let's go to this
title over here. Select the whole container
and add on the top five. I would say since it's a line, we're going to have
ten from left and ten from right as any other divider. We're going to have here
ten and as well ten. Then now since here we cannot
go and edit the heights. We can only edit the width,
what we're going to do. We're going to go
and squeeze it from top and bottom. How
we're going to do that? Let's go and select
those separators and we're going to go
to the outer padding. Let's have on the top 15, and on the bottom
14 and with that, we got the line effects. The same thing for
the other separator. On the top 15, On the bottom 14. With that, we have a line. Here, there is no other spacing. Let's go to the other title to the locations. We can
do the same thing. On the top, we're
going to get a five, not a ten, from left and right, we're going to have a
ten since it's supera now we're going to do the same
things for the separators. On the top 15, bottom 14, the same
thing over here. So 15 and 14. Nice. Okay, great. So now let's have a look
to the whole dashboard. Let's go to the
presentation models. And now sit back and
check whether you can find any problem
with the spacing, from my point of view, we
have a perfect dashboard. So we are done with the spacings
between the containers, charts sections and everything. It looks really
professional right. Okay, now the next step, we're going to go and add
tooltips to all our charts, and I think you would
agree with me if I say, adding tooltips is a
little bit boring. But it's provide really nice
informations for the users. Let's go and do it. We're
going to start with our bands, so we're going to start
with the active employees. Let's go to the
charts. Now let's go over here to the tooltip, and we're going to
do the following. We're going to say
the total number of active employees and then we're going to go and
insert our measure. Now, it's very important
that we always follow the same standards when
we are using the tooltip. I would say that always the normal text
should be not bold. Only the words that you want to highlight could be go
bold, for example, here. What is important is
the active employees. Of course, the measure
itself, it's already bold. Now, about the colorings, we're going to use two
different gray colors. If we go to the normal
text over here, let's go to the coloring, we're going to go and
choose this gray over here. Let's go and select it.
Then for the highlights, we're going to go and
use our dark gray. Like this and the
same for the measure. For now we are done.
Let's go and copy it because we're
going to go and use it in the next chart. Click and then let's go back to our dashboard and just
mouse hover on it. You can see very nicely the total number of
active employees, and we have then the number. Now let's go to the next
pan to the hired employees. Let's go to the toll tube and replace the whole
thing with this one. Instead of active, we're
going to have the hid. Let's go and give it
the color that we use usually for the
hid the green one. Of course, we don't
use the total active, we're going to go and
insert the total hid. And of course, remove
the active one. That's all, let's go and
copy it for the next one, and of course, we
have to go and test. So D's co. As you can see, the total number of
hired employees, and we have the number,
let's go to the next one. Here we have the terminated. So we're going to use
terminated and for that, we need to use the pink color. And here, of course, we
don't have the hired, we're going to have the
terminated Like this, it's it okay and check the
result as a dashboard. Everything is perfect. Now let's go to the line charts, and we're going to
go to the tool tip, but make sure that you are not selecting the tool tip
of any of those marks. Make sure to select the all. That we have the same tool
tip for both of the charts. Stay at all and go to Toll tip. Now let's go and add
it as a new line. We go and remove this one,
but we need the year. Of course, now we
have a chart and depend where is our mouse. We can have the year displayed. Let's go and make it
bigger like maybe 11, and as well, let's
make it green. Okay Let's go and hit.
Let's go and test it. As you can see, we
have here 2017, 2020. You know what? I would
like to go and add the percentage side by
side to the number. Let's go and get the total hired and drop it
on the tool tip, and then let's go to the
tool tip and have a pipe. Then we're going to go and
insert the percentage. Let's go and test it. Now, as you can see,
we are getting both of the percentage and as
well the absolute number. But I would like to go and
get rid of the decimals. Let's do it from
the data source. Right click on the field. Let's go to the
default properties and then to the number format and then remove
from the percentage the two decimals,
and then it's okay. With that as you can
see, we don't have any decimals with
the percentage. Perfect. Now let's go and copy the whole thing
for the next charts. Of course, we're going to go and test it on the dashboard. As you can see, it
looks really nice. Let's go to the next one. And same, make sure to
select the all and then go to the tooltip and
insert the whole thing. Now instead of higher dates, we need the year of
termination dates. Like this, I remove the old one. Now we're going to
have that terminated. Of course, we go and change the color to the pink like this. Here we have the wrong major, so let's get the total
terminated like this, but make sure to select
the same color right, so it is our dark color, and we have to create a new percentage
for the terminated. Click for now and we
can go and test it. As you can see, the total hid is not working. Let's
go and fix it. We're going to go over here to the total id with the
percentage and duplicate it, and we're going to go and
edit it to total terminated. Here instead of hyod, is going to be total terminated, divided by total total
terminated. Like this. Let's go and it and let's go and grab the total terminated
to the tooltip, and let's go and edit it. We have to go and insert
it and remove the hid. Like this. Now we have a nice percentage as
well in our tooltip. Let's go and test it as
well in the dashboard. It looks nice. Now let's
go to the departments. This is going to be interesting. Let's go to the sheets. Now what you're going
to do we're going to go to the tool tube and
insert our template. Now what is the main
dimension over here? It is the department. Let's go and insert it and
remove the higher date. Now here it depends
where our mouse is, we're going to get either the hired or the
terminated employees. We cannot have it like
this as a static. We're going to go and insert
the status over here. Now it's going to be dynamic. Let's go and make
it bold and make sure that we having
the right color, so it's going to
be the dark gray, and I think we can leave it
like this. Let's go and test. So Let's go to
operation over here. As you can see,
we have operation the total number of
hired employees, but the percentage
is not working. Now let's go to the
terminated employees, and as you can see it is dynamic and change to
terminated employees. So far it is working, but we have to go and
fix the percentage. That's because we don't
have it in the charts, so drop it on the tooltip.
Let's go and check. It's still not working. I think we have to go and
insert it again. Let's go and insert it and
remove the old one. All right. So let's go and hit and test. Now it is working. All right. Now here are the best
practices as well. If your dimension in your
chart having hierarchy. As you can see here, we have
departments and job title. We can go and add
the dimension that is next in the hierarchy
as a tool tip. We can go and build
a special chart for the job title and include
it in the tooltip. This is really
amazing technique in order to quickly drill down to the next dimension without
changing the whole dashboard. Let's go and do that. It's very simple, what
we're going to do. We're going to go and duplicate the departments.
Let's go and do that. Now let's go and give it
the name of the job titles. Now what we're going to do,
we're going to go and replace the departments with the job
title. Let's go and do that. Now I would say we're going to go and reduce a little bit, so we don't need the status at all as a color, so
let's go remove it. But we still have to
go and sort the data, which is now not correct. Let's go and sort Then we're going to go with the
field, descending, and, of course, go and select
the correct field, which is the total highd, since we are using
it in the charts. Let's say okay. Now
about the coloring, I would like to go
and highlight only the maybe let's say two jobs. In order to do that, let's go and create a new
calculated field. Let's call it top two, and the function is very simple, so we're going to have
the rank function. Then we are ranking, we are
ranking the total highed. So the total hirod. If this is smaller or equal to two, then
it's going to be true. Otherwise it's
going to be false. Let's go and call
it rank top two. Now with that we have
a new dimension. Let's go and grab
it to the colors. Now as you can see, we are
now highlighting the top two, and of course, we have to go and change the coloring for that. If it is false, it's
going to be the gray, and if it's true, it's
going to be the green. That's it. Let's
it and of course, go and remove the legend. I would like to see the
labels at the end of the par. Instead of center, let's
have it to the right side, and let's go and change the
color to the gray color. We're going to have our gray
color. Like this. All right. Now the next s of that,
we're going to go and add the whole chart inside the
tool tip of the departments. Let's go back to our departments and tooltip. Now what
you're going to do. Let's have a new line. Let's call it total
by job titles. Now we have to make sure
that the coloring is okay, so we're going to use this
gray and the chop titles, it's going to be our dark gray and only the job title
is pulled like this. Now the next epi
that, we're going to go and add our charts. So let's go and do that. Go to insert, to sheets, and then we're
going to go and add the job titles from here. So let's a ok and
check the results.
167. HR Project | Build the Table: Now let's check
the second section of the user story
and the requirement. So here we have the
employee records view. It says that we have
to provide a list of all employees with necessary
information such as name, department, position, gender,
age, education, and salary. Another point in
the requirements about the interactivities, that the users should
be able to filter the list based on
the available cons. Here we don't have to
build any visualizations or charts or anything. We have to provide
only a list of all employees with
important formations, and on top of it,
we need filters. It sounds very
simple. Let's check how we can build
lists in Tableau. Let's start immediately
building the charts. Here we have two methods. Either we're going to go
and build a symbol list, where we have a symbol
table in Tableau, where we're going to go
and add, for example, let's say the employee
ID, go add locations. Like as we see, we are adding just dimensions
side by side. So of course, we can say this is the detailed list
of the employees, and the job is done. So I cannot go and
put in each cell like two informations
underneath each others, or I cannot go and
add icons and so on. So it is nice, quick way, but it is very limited. And now the other
method is that, we're going to go and use some tricks in order
to customize the list. It is time consuming, but the end result is
really nice in tableau. So since it's advanced projects, I'm going to go with
advanced techniques. So now, what are we
going to do? We're gonna leave the employee ID. As a starter, and
make sure we are selecting standard
and not entire view. Otherwise, we going
to have all the employees in one view. This will not work.
So make it standard. Let's go and remove the header. And of course, I'm
going to go and change the design of our worksheet. So let's go somewhere
here and say format, and we're going to
go to the shading and let's make it plack. Of course, we're
going to change that later once we have
everything in the dashboard. So what do we see here first? We have the Ds of the employees. Let's go and hide
the header as well. And we're going to have the
coloring of this dimension. Going to be our light gray.
So let's change that. Now, this is the only dimension that we're going
to use as a row, and the rest, everything
going to be a columns, and we're going to do
the following trick. So we're going to go over
here and say average and -1.0 like this. Now as we learned, this
format is going to add a placeholder for a
shape for a visual. Now for the chart
type, we're going to go with the shapes. So now we have here
as the shapes. Now here we have like
circles everywhere. This is our placeholder. I'm going to go and change as well the format of our grid. So what do we need
with the lines? I make sure everything is none, just to make sure that
we don't have anything. Then we're going to go to the
columns, remove the grid, and we're going to go and
add a fine line as raw, but I'm going to go and make it really dark. Now it looks nice. Let's go and hide as well,
the header informations. So the first column
going to hold all the informations
about that demographics. What we need, we need the
first name and the last name, since it is the most basics
about each employee. Now we have the first name
and the last name separated. What I'm going to do,
I'm going to go and create a new calculated field. I'm going to call it full name. But now I'm going to go and merge both of them like concat, both of those informations. We have the first name, and then we're going to have
the plus and then space between the first name
and the last name, and we're going to
get the last name inside our calculation. Wh that we have the full name. We have it as a new field.
Let's go and drop it. On the labels over here. So as you can see, we have the full names of the employees. Now, for the shape, let's
go and add the gender. So we're going to go and have
the gender shape over here. We cannot see it yet
because of the colors, so let's add it as
well to the coloring. So now we have the
same shapes that we have used in the
income analysis. Now, what else we want
to add is, for example, the age, let's go and drop
the age as well to the label. And the last information
about the demography, we're going to have
the education level. So let's drop it as
well to the labels. Now as you can see,
we have a lot of information that
is naturally nice, and there's a lot
of overlapping. So we have to go and format it. Let's go first to the labels. And we're going to go
inside it in order to customize those informations. Everything going to be to
the left side as alignment, and then we're going to
have the HL education side by side and split it by a pipe. About the style, the first draw, it's going to be bold and
using the light dark or gray, and the second draw
it will not be bold, but we're going to go
and use our dark gray. This is going to be our
style for all columns. Let's go and hit okay. Now as
you can see it looks nice. We have the full
name and below it, we have a few more informations
about the employee. But still, as you can see
the alignment between the informations and
the ID is not correct. What you're going to
do is going to go to one of those rows and just slightly increase the
size until it fits the screen. I'm going to go and
make it as well. I'm going to go with
one more increase. With that, as you
can see, one row holds all the informations, there's no overlapping,
and you keep doing that until you don't have any overlapping between
the employees. As you can see, it
looks already very nice compared to having a list. Now on the right side,
we have those legends. Let's go ahead remove
them. We don't need it. Now we're going to go to
the second column as well, it's going to be a
bunch of informations. What we're going to do,
we just to copy it. Hold control and just
drub it side by side. Now as you can see, we
have like two columns now. I'm going to go and as
well format the grid, where we're going
to go to the grid over here to the columns. And we're going to remove
the column divider. As well, I'm going
to go and remove the rows. Let's go to the rows. I remove it. It
looks more clean. What we're going to do
with the second column? Let's go and add
the whole dimension of the department
and the job titles. Make sure to select
the correct one. The first one is for
the demographics and the second one going to be for the departments and jobs. Let's go and remove
everything. From it. Now we're going to go and
drop those a formations? Let's get the job title
first to the label. It's more important
than department. Then the second one going
to be the department, as usual, we're going
to go and design it. Everything to the lift, the first row going to
be bold and light gray. The second row going to be a dark gray and not bold.
That's it. Let's it. As you can see, it
looks really nice. Now the question is, do we have an icon for the
departments and jobs? Well, I don't have any one, so that's why I'm going
to go and hide it. If you have one,
you can go and dit. What I'm going to do,
we're going to go to the size and reduce
it completely. But we still have a fine dot. We have to hide it
by the opacity. Now if I remove it like this, you will not find it anymore. This is the trick, and
it looks really nice. Now, let's go and
add another column. It's going to be about this
time, the dimension location. Same things. Let's
go and switch to it. I'm going to go and
add the location as a color this time and then
the city in the lapel. We're going to get both
of them as a lapel. Now let's go immediately
and start formatting. Both goes to the left side. I wish to have first the
city, then the states. As usual, the first one
going to be the lights. Bold and the second one
going to be the dark one. All right. Now
let's have a look. Everything looks nice. I'm going to go and change
the design of the shapes. It's going to be filled circle and it's a little bit beak, so I'm going to go and
reduce the size of this one. If it is HQ, it's
going to be green, if it's gray, it's
going to be branch. You can see it's not that
complicated right, it's easy. Let's add another information. I think now we can go
and add the celery, but sadly we cannot go and add anything else to the salery. So we have to go
and use it alone. Let's go and add the
salary to the labels. Here we have those numbers. I would like to format it, Let's go and format the numbers. Let's go to numbers, and then we're going to go
to the number custom, reduce the decimals,
and as a prefix, let's add the dollar sign.
The number looks nice. Let's go to the
label and design it. Here we have the
informations from the previous one.
We don't need it. We have only the celery, and since it's the first row, we're going to make
it light gray. Since it's in the first row, it's going to be the light
gray, and as well bold. Let's it okay. For now, I don't have any
shapes for that. That's why we're going
to go and reduce the size and make
the opacity to zero. Now to the next column,
what we're going to have, we going to have the
status of the employee, the higher date and
the termination date. The status of the employee, we're going to make
it as a color. That's we have the
gray and the green, and we're going to make the
circle as a filled circle, reduce the size.
Something like this. Now I would like to add
it as well to the label. Now what we need, we need the higher date
as well to the label, and as well the terminate date. But here we have it as a year, I would like to have
the exact date. We're going to go
and switch it to exact date and then to discrete, the same thing for the
terminate date to exact date, and then to discrete. Now we have all informations. Let's go inside and
start configuring it. Now we have here the status
higher date and term date. Let's go everything
to the left side, and we're going to put
the terminate date and then minus between them, then that term dates, we're going to go and
design it as usual. So the billow one going
to be the dark one. Okay. Let's get ok and check. Now we can see in the output, we have the higher date, and let's see a
terminated employee. As you can see we have
here a terminated date side by side. All right. Now the last column is
going to be interesting. We're going to have a bar chart indicating the
length of the hire. We're going to go
and calculate in years the duration
of the employment. Let's go and create a
new calculated field. We're going to call it
the length of higher. Here we have two calculations. If the employee is hired
and not terminated, we're going to go and calculate the years between today
and the higher date. Let's go and do that. We're
going to need an F statement, and then we're going to check whether the employee is hired or not using the
following logic as usual. Is null. So we are checking
the terminate dates. If it is null, then the
employee is not yet terminated. So what can happen?
We're going to calculate the differences between
today and the higher date. Date dif, and we're
going to have a year. I'm going to go and
add it as a new row. What we are calculating between the higher date and today. This is the formula for the employees that
are not terminated, and now we're going
to have otherwise se. We're going to have
the date diff, and now not between today
and the higher date, it's going to be
between the higher date and the terminated date. Going to be the same thing year, higher date, and terminated
dates. It's very simple. Let's go and end it. Let's.
So now we have a new major, and I would like to
go and test it first. Remember the first sheets
where we test stuff here. I'm going to remove a few stuff. We need the higher dates, the terminate dates, and
our new nice column. I'm going to show
it as discrete. Now, of course, depend on the year that you
are doing the tio, you might get different results. Now as you can see here,
we have six years, two years, two years, and so on. Since here we have
a termination date, we have here a zero. Everything is working, let's go back to our detailed list. Now we need a new column, but this time we will not use the placeholder because we
have already a measure. We have already the
lingth of higher, let's rag and drow
it side by side. Now we have to go and
configure the chart type. It will not be a shape. Let's go and use the par. Now we have a par in our charts. I'm going to go and
reduce the size of it. Maybe more. Now let's go and
add content to those pars. Let's start with the status. I'm going to put
it on the colors, and we need as well the label, we're going to take
as well the length of higher to the label. Now let's go and edit
it, so let's coincide. We don't need all
those informations. We have here the
number of years, so let's go and make
it bold and as well change the color
type to light gray. After that, we're
going to have years like this and maybe not as bold. That's it. Let's go and hit ok. Now we have light years
at the end of the bars. But what we can do, we can
go and change the alignment completely left and in
the center. All right. Now let's go and
check the results. As you can see in the list, we have the two colors. Here, for example,
we have one year of termination as well here. The legend is working. Now, as you can see, things
might be very tight. What I'm going to do,
I'm going to go and change the size of
all those sticks. Let's go to all and
then let's go to label, and then to the font, and let's make it
eight instead of nine. That we're going to have bitter spacing between
those columns. Now the next sib of that,
I'm going to go and remove all those
informations here the axis. Let's go and remove
Shohader, and we are done. Now we have a really nice
list for the employees. Again, this is the one that is time consuming,
but as you can see, we have nice bars, we
have a lot of icons, and we have multiple
informations in one column. It is a little bit confusing at the start on how to build it. But once you understand it, you can go and make
amazing lists. And of course, having a
simple list as well is fine.
168. HR Project | Sketch Mockup of Detailed Dashboard: So now we can plan the mockup
for the second dashboard, and this one can be really easy. And we have the same title, but at the end, we're going
to swab it with the details. Now in the middle,
we're going to have only one section called
the employee list, and here we have only
one type of charts. We have a list, so we're
going to have multiple rows and multiple columns and
informations in each cell. Now, of course, if you
have a detail list, it would be nice if we
can filter the list. That's why we're going
to put on top of each column an option for the users in order to filter the informations that we
can see inside the cells. At the end, as you can
see, it's very simple. We have only one list and on
top of it, we have filters. That's it for the dashboard
Map. As you can see. It's really easy. Let's move to the second mocap
where were going to plan the containers
back to Toyo. Now I have a screenshot
of our new mockup, and I cap it a lot of stuff
from the previous design. Now let's dive in and
see how we can do it. We're going to focus on the
black box in the middle. What we have here,
we have a title, then filters and a list. We need a vertical
container for that. Let's go and do it. This is the main vertical
container like this. Now what do we need?
We need a title. First, it's start
with one title. It's going to be as
well to the left side. I'm going to make it like this. Now what do we have
below it? We have now different filters
side by side. We need horizontal containers. Below it, we're going to have a horizontal
container like this, and let's remove
it and inside it, we're going to have
multiple filters. It's going to be filters. Well, they all going
to be side by side. Of course, they are
way more details as what I'm showing you now. And we can talk
about it later here, we are talking about the rough design about the containers. Now what do we have
below the filters? We have our chart, the list. It's going to be only one
object without any container, so below it, we will have
a pi list like this. That's it. Now let's go and focus what we can have
inside the filter. Now, I just took a copy of a filter and let's design
the container for this. As you can see, it's like
something below each others, so we need a vertical container for the whole filter like this. Now inside it, we're
going to have a title and side by side with an icon. For that, we're
going to go and get a horizontal container. Inside it is going to be like a horizontal
container like this. We're going to have a
title for the filter. And side by side with a
very small green icon. Now to the next one,
what do we have? We have like filters
underneath each others, and that's why we're
going to go with a vertical container
for the filters. It's going to be like
this. And inside it, we're going to have
multiple small filters. Filter one and
another one below it. This is the design of each of those filters that we have on top of the list. All right guys. W us we have a rough plan for the container structure and as well for the
dashboard itself. Now let's go back to Tableau in order to build our dashboard.
169. HR Project | Build The Detailed Dashboard : Now, we're going to
go and create the dashboard for the detail list. But this time we will not
do it from the scratch. We're going to go and duplicate the whole
work that we have done and only do a few adjustments
for the new dashboard. It's going to be time consuming only for the first dashboard, but once you have it,
then you can go and duplicate it for the rest.
Let's go and do that. We're going to go and
duplicate this dashboard, and we're going to go and
rename it to H R details. So now the first step of that, we're going to go and prepare
the containers as usual. Let's go and make this bigger, and let's go to the layout. Now of course, we are not going to change the navy container. We're going to go work with
the container in the middle. Let's go to the whole dashboard
over here and drill down, so it's going to be the Nav. And here we have the
header and charts. It's fine. Let's go inside it. Now we have here the header,
it's going to stay as it is, but this container going
to be dropped completely, right click on it and remove. Well, yes. What is left
over here is this legend. I'm just going to take it
and put it here on top. Maybe later we're
going to use it. Now let's focus on creating
the content in the middle. What do we need? We need
first a vertical container. Let's strike and drop it
exactly below the title. Then as usual, we're going
to go and drop some planks. This is the first plank
and then the second plank. We can go of course and
mark it if we want. The whole thing going to be with the border, the orange one. Now we can go and as well
rename it, filters and list. Now, for the filter, we need
one horizontal container. Let's go and drop
it here on top. Of course, we're
going to go and add some blanks inside it. This is the first plank.
We have it somewhere here. Then the right plank in
order to have it as fixed. Select the whole
thing, and we're going to mark it with a plu container. Now what is below the filters, it's going to be our list. Let's go to the dashboards, and we're going to go
and grab the details. Let's drop it
beneath the filters. Let's go back to the
layout and check it. As you can see, we have the
filters and the details, how we can go and
remove the planks. We don't need it anymore. So
by looking to the charts, we can go and remove the title. This is the main containers
for the dashboards. Now what we're going to
do, we're going to go inside the filters container, and we're going to
build one container for each group of columns in order to have
the filters for it. Now for the first two
groups of the columns, I'm going to do it
step by step slowly, but for the rest, I'm going
to speed up the video. Now let's start with
the first container for the employee ID.
What do we need? We need a container, of course. It's going to be vertical
container, and then inside it, we have two plocks, And make sure to have
it below it exactly. This is our container. Let's make it a
little bit bigger, and we can go of course and market in order to
see the borders, going to be this one and orange, and we're going to go
and rename it like this. Employee, ID. Filter. Now, what do we need inside this is two
horizontal containers. The first one going to be
for the title of the filter. We're going to have
immediately a text inside it. Let's call it employee ID. Let's take it to the middle, change the color to light gray and maybe make it as a
ten for now, so it okay. Now the next we need
a second container, but this one is going to be a vertical one exactly below it. Let's go as well and add
a few planks inside it just to make sure
that we have it as a vertical container. Let's go and rename stuff. This is going to be the title. And below it. We're going
to have it as the filters. Of course, we can go
and add the borders in order to see everything. Let's go remove
those place solders. So remove the plank
and as well the plank. Now the next sib of
that we're going to go and add a button for the second container to be used or to be added on
the first container. Let me show you tan. Make
sure to select the filters, right click on it and
add show Hide button. Now we have here a
small button over here. We have to go and remove
the floating from it, so it lands somewhere here. Now, drag it and put it side
by side with the title. Let's go and make the whole
thing a little bit smaller. Now in order to understand
what I mean with this button, we're going to go
and add a filter inside the second container. What we're going to do
we're going to go to our list and to the small arrow, and then let's go to filters, and let's grab employee ID. Now as you can see
our filter now inside the container filters. It's very important
to make sure that everything is correct in
the correct container. Let's go and test out. Now why do we have this patom? Check this out.
If I click on it, we don't see any filters, so we are hiding the filters, and if we click on it again,
we can see the filters. That's why we have
to have this icon outside of the container in order to control the
visibility of this container. This ptom is controlling whether we are showing the
filters or not. Now, let's make the design
a little bit better, so let's go inside it, and this time we're going to go to the pattom, so
let's go and edit it. So if it is shown, I have an image for that. It's going to be this
arrow, the green arrow, so let's go and select it, and if it is hidden, then we have the
gray one like this. So let's go and hit. Now we have to make sure
that the whole container of the title is fixed. As you can see it's fixed
height, which is correct. Now let's go and test it. As you can see now,
the arrow is inactive, but once I click on it, it's going to be inactive and
it has really nice effect. Now we need to fix something. If you see here, I'm
hiding the filter, but there's a lot
of wasted space. What you're going to
do is going to make things more dynamic
and flexible. If I'm not showing any filters, this space should be
used for the list. So currently, we are
wasting a lot of space. Let's see, we can fix that. So let's go back
to our dashboards. Now the first step of
that we have to make sure that our list is flexible. Let's go to this small
arrow over here, and we have to make sure there
is nothing selected here, so fixed height is not
selected, which is correct. Now the next step,
we're going to go to the container
filter over here, select the whole thing and make sure this as well
without a fixed height. Go over here. You can
see it is fixed height, so let's go and remove it. Now as you can see, Tableau
did use the whole space, so now it's more
variable and dynamic. Now one more thing that I
would like to do is to go to the filters and remove
all those planks, remove this one and
this one as well. Let's go and test again. Now we are using the whole space because we are not
showing any filters, but once I click on the
button, what can happen? I'm going to use the space
in order to show the filter. This is very dynamic
and looks really nice. That's all for the first filter. Let's go and make
everything smaller. And I'm going to go
and do the same stuff for the second filter. So here we have a
bunch of informations, we have a round like
four informations, so we need four
filters for dots. Now we're going to go
and do the same stuff. So we need a vertical
container side by side. Let's go and add a
few planks inside it. It is this very small one. I'm going to go and select
it and maybe as well, change the color of thats. So like this, it's still
small, so make it bigger. All right. So the
first container in side is going to be the
horizontal container. I'm going to go and add
for that, the text. This one is going to
be the demographics, going to be the middle
and light gray, as well, let's make
it ten for now. Ho. Then the next tap, we're
going to go and add another container
and this time it's going to be the vertical
container below it, and here we're going to
have a lot of filters. Let's go again to our list. The first thing we
need that full name. It's dropped over here, let's go and drop it where we want, and we're going to change
it to a drop down list. Now the next spa we need to
go and get the gender filter. Let's go and get it. Now we have it over
here, so drag and drop it exactly
below the full name. I'm going to go and
remove this plank. Otherwise, it's going
to go and confuse us, so remove it from dashboard, and as well the second
one. Now it's fine. Let's go and edit the gender. It's going to be
a drop down list. Now the next one
we need the age. I'm going to say,
let's go and get the age group. Let's
go to filters. We don't have it yet because we don't
have it in the list. We have to go inside
the worksheet. Let's go to all and drop the age group somewhere
in the details here. Then we should be
able to find it. Let's check again to filters. I now we have the age group. Of course, we can have
it on the first filter. Let's go and drop it
exactly below the others. Make sure always that
you are dropping everything inside this
vertical container. It's going to rename
them as well. It's going to be the filters, and the above one, it is the title, and the main one, is the demo graphic filters. Let's go back to our filter, make it a drop down list, and we need the last one. It's going to be the
education level. We're going to have
it as well here, drop it exactly below the others and a drop
down list. Great. Now the next step that
we're going to go to the filters and add
a button for that. Let's go and do
it, add a button. We have it over here, change
it from floating to tilt. We have it over here. Let's drop it side by side to the title. It's not working, so we'll
drop it somewhere here, maybe first and then
take it near the title. Great. Now, let's select
the whole container, make it smooer, and we're going to go and
work with the icon. Let's use the green as shown. And the hidden
should be the gray. And we can go of
course and test it. So now close it, and show it. We have to go and
fix the height in order to not have
this strange effect. So fix the height, and now we will not have it. Hide it and show it. All right. Now what we're going to do,
we're going to go and fix the design of those two filters, and we're going to
follow the same design for all other filters. Let's see how we can
do that. First of all, I'm going to go and
give a background color for the whole section. Let's go and check
the whole section, it is filter and list. So let's go to the
background over here and pick the place one. Now, the next step,
I'm going to go and remove the background
color of the worksheet. Let's go to the
format and then to the shading and remove
the worksheet color. Now let's go step by step
for those two filters. First, I'm going to go and
switch the title and the icon. I would like to have
the icon to the left, the same thing of our here. Now the next step, those
icons are really big. Let's go and give
it a fixed width, and then let's have
a value like 25, the same thing of our here, so fix and 25, the next sib, I'm going to go
and work with those titles. Let's move it to the lift and make it smaller to the nine. The same thing here instead of employee ID, let's have only ID. We don't have a lot of space, make it nine and
to the left side. Now the next sibth
that, we're going to go and work with the coloring. Let's put one of those filters then to format filter
and set control. Now for the title, we're going to make
it smaller to eight, and with the color, it's
going to be the dark color. Now for the body, it's
going to be as well eight. At this time, the color
going to be the light gray. It seems the title the change
again, that's strange, let's go and change it back
to the dark gray and taste. So the color of the
values are okay and the titles are
darker. Nice, great. Now the next time we're
going to go and place the filter exactly on the
top of the column itself. Let's go and do that,
select the whole container, and let's press it to be
exactly on top of the IDs, something like this, and
the same thing here. L et's move it and
maybe around here. But we still have a
divider between them. It's going to check the layout. So we're going to have
it always like this, a filter and then a
divider between it. Let's call it divider. How we're going to
start the divider? It's going to be as
usual, a dark gray. Now let's go to
the outer budding, make everything as zero. Change the width to one. So we have it very thin,
and then we're going to go and add an outer padding
to the left and right. Let's have something
around like 36 to the lift and
six to the right. We have a small
separation between them. Of course, the last step,
we're going to go and remove all those borders. We are done with that. We have here as well a border and the same thing for
the next filter. We have here a border.
Now we can see we have still space between the
filters and the list, so we can go and select
the whole thing. Just to make sure that
we are selecting it. Let's just shift it to the
education level. All right. Now by checking that
divider doesn't look good. So let's go back to divider
and have as well on the top ten and below
that as well ten. So let's check again the design. All right, so we are done
with the first two filters. We have to go and
repeat the same stuff for all other columns. So what can happen, I'm
going to go and speed up the video as I'm creating
all those filters. Oh Oh. Oh. H. Oh Was a lot of filters
inside our dashboard. Now let's go and test it, so we have all those filters. We can go and hide all
those filters as well, but we still have an issue. It is not any more flexible. I think we have still
a fixed height. Let's go and fix that. Let's go and select
the whole container. It was the filter containers and it should not be fixed yeah. Here is the issue,
let's go and remove it, and let's go and test again. We open the first filter,
the second third. And we are almost there. We still have here a
lot of wasted space, so let's go and check
the containers. And it should not be fixed, so we have it as fixed,
so let's remove it. The first one, it's not
fixed, so it's fine. Second one, remove a fixed, and here as well,
it's not fixed, fine. So and the last one. Great. Let's go and
do the final tests. If we close everything, the list should be bigger. Now let's go and add spacing
inside our dashboard. Let's go and do that,
and we're going to go and remove all those borders. Let's go and select the whole
container filters and list. And we're going to go
and remove the border. Now as you can see
at the bottom, we don't have any spacing, so we have to go and add an outer adding.
Let's remove the two. We need only 20 at the bottom. Great, now we have space. On the right side, it looks good as well on the top,
now it looks good. Now let's go and add an inner
spacing and it's going to be the number seven
for all sides treat. Let's go and remove the
blue container here. We don't need the order. Let's go and expand
everything again to see whether we
have any borders. We don't have any
border colors, great. Let's go and close it.
Now we'd like to go and add a title for this list. Let's go and grab a text and carefully put it on top
of the current container. We're going to say employee
list and then a Pie, and then we're going
to tell the users to click on the arrows, so click arrows for
filter options. No know we have to go
and change the coloring. This is going to
be a light gray, a bold, and it should
be 14 for the size. For the rest, it's going
to be a dark gray. Let's go with an eight. All right. Looks fine. Now, let's go and add a spacing between those three sections. We have a title, we have
the filters and the list. Let's start with the employee. I'm going to go and add a
badding at the button around like maybe ten. Looks nice. Now let's go for the
group of filters, select the whole container, and let's go with the padding
to the bottom around ten. With that, we have
like spacing between all those objects and
it looks way better. Now the next time we're going
to talk about the legions, I'm not going to use any
legions in this charts, and let's go remove it as well, we didn't need any filters
since we have enough filters, let's remove it as well. And as well this icon. With that, we're done with the main part of our dashboard. Now we're going to go and check our navigation and the title. Of course, we have
forgot about the title. Instead of overview,
it is details. Let's go and change
the size of this word to 16 and maybe
something darker. I'm going to go and change
it to something like this. Yeah It looks way
nicer than before. I'm going to go and take
the number of the color, and we have, of course, to change that for the
first dashboard. Let's go over here, make it 16, and as well, change the
color with the same color. It's a little bit darker
and it looks way nicer. Now on the left side,
we have an easy job. What we're going to do,
we're going to go to the first icon and
make it deactivated. Let's go and edit the button, and now instead of active, we have to have it as a
deactive or inactive. Now as you can see
it is inactive, and for the first button, we're going to go
and make it active. This is going to be
the green table. Of course, now we
can go and map it. We have this dashboard. Let's go and map it to the details. All right. It looks really nice. Let's go back to the
first dashboard, and of course, we have
to do the same mapping. Let's go and edit the button, and we're going to mab it to
our new dashboard details. Now I would like to go and
add one more nice thing in order to indicate that
this icon is active. I'm going to go to the
dashboard to the floating, and let's grab a plank. L click on the plank
and let's go and pick the background color
of the green color. Now we're going to go
and decrease the size of this to be a small
indicator like this, maybe. And we're going to
move it over here. I'm going to say let's
make it like the height 40 and place it
exactly near the icon. Maybe something like this. Now let's go and
chick the dashboard. I'm going to go and
reduce the width of that, so let's make it thinner,
maybe like this. With that, we have
like a small indicator that this icon is active. Let's go and do the same thing
for the second dashboard. We're going to grab as well. Again, a plank and we're going to make the
color of that green. The width is going to be six and the height going to be 40, and now we're going
to go and place it exactly near the active icon. Something like this. All right. Let's go and check the design. It looks really nice. Let's have a final
look to our dashboard. Here we have a nice filter
and the main dashboard. Here we have this
nice information. We can go and download stuff, we can go and follow, and the whole dashboard
is interactive. Now if the users wants to go and click on the
second dashboard, all what they have to do is
to go and click on this icon. And we are now on the detail
list about the employees, and everything here
is very interactive. Let's go and hide all
those informations, and it looks wonderful.
170. HR Project | Bonus - Build Background Layers using FIGMA : O. All right, friends, now we have a bonus section, where we're going
to go and customize a background image for the
layout of our new dashboard, and that's going to make
the overall design of our dashboard look really
cool and profesional. At this time, we're going to use another tool in order
to create the layouts. We're going to go and use
Figma. What is Figma? Figma is a design tool
that is used by many UI and UX designers in order
to create concepts, mops for the user interfaces. And it is amazing tool in
order to share your work with the others in order to work
and collaborate at the team. You can find the
link to my work with the other links in the
project materials. Of course, don't
worry about the cost. There is a free plan for stars. Now we will not do a deep
dive into how to use Figma. I will just show
you how I usually use it for Tableau. Let's go. Now we're going to
start with empty file, and we're going to put a
screenshot from our dashboard. Now the next step with
that we need a frame. So let's go and get a frame exactly on top of our dashboard. Now we can go and
hide the image. Now we need a color
for our dashboard, so it's going to be
something maybe like this. Or let's increase
it a little bit. Now what we're going to
do, we're going to go and add lightning from the corners. In order to do that,
we're going to take the shape of circle or ellipse and going to make it like this and maybe a little bit
bigger and to the pack. Let's go and change the color of this and something here
like in the middle. Then we're going to
go and add an effect in order to have like a glue. We're going to have a blue, and we're going to go
and change the value to something around 1,500. Some of you check,
we have a glue or like light that
comes from this corner. Now let's go and add the same in the other corner,
can do it like here. Now let's go and
increase the size of this one. Something like this. We need more lightning
comes from the right side, and still we have
to have it like bigger and one more darker. All right. With that,
we have a background. Next, we're going to go and add the background colors
of each section. We need again our image, and now we have to
go and zoom in. Now, what we need,
we need a rectangle, and we have to be very
careful that we meet the exact edges of
our dashboards. So let's get it like this. I'm going to go and reduce
the opacity to something around 50 just to
see the borders. So Yeah. Nice. Now we're going to
go and increase it to 100, and we need now the
color of complete black. Now what we're going to do,
we're going to go and use the gradient instead of the solid. So let's
go to do this. Now we're going to go and
work with the lower value. We have to decrease
it like this, maybe a little bit
more, like this. Now the next step, we're
going to go and add a corner for our container,
maybe 20, great. Now let's go and
repeat the same things for the other containers. We're going to have
it for the overview. Maybe reduce again the
opacity to see the borders. So like this and here as well. It's going to meet
the same borders. So now let's go and copy
this to the second section. So increase it like this, and we have to meet
the itches perfect. Let's go and do the same for the last section.
Something like this. Now we are done. We
have to go and increase the two, 100 everywhere. Of course, we're going to go
and remove the background. We are almost there. What we're going to do
were going to go and change the coloring of
each of those containers. Let's go to the linear and maybe we're going to go and take the lower level like
outside and this here. It's going to go a
little bit darker, to the next one as
well to the linear. We're going to have
it somewhere here, and the low value
going to be outside. Now what I'm going
to do, I'm going to take those eclipse and put it somewhere like here and let's keep working
on those coloring. Let's move to the next
one to the linear. Et's move this somewhere
here and check the colors. We can put it like this
and to the last one. It like this here. I'm going to have it here like rotated. Great. Now let's have a look. It looks very nice. Now I'm going to go and add
our second dashboard over here and make sure to place it exactly on top
of our dashboard. Let's move it here
and let's close some of those informations.
I'm going to have only the. Now we need one
more for the list. Let's go into this. Le bit. Decrease the opacity
to see through. Decrease the opacity
to see through 40. Let's go and meet the Borders. Yes. Okay. That's it. We're going to go
and increase again, the opacity to 100. Now for the filling, we're going to do
something like this. And the low value going to
be a little bit outside. That's it. Now we
have to go and export those background images. We're
going to do it like this. For the first dashboard,
what do we need? We need the Navy and
we need those two, and we have to go and hide
all the images. That's it. Click on the container, and we have here the
option of exporting. Let's go and export it.
Now we have to go and export again for the
second dashboard. So we're going to go and
hide those informations. We need this and that sets, let's go and export again. All right back to Tableau. We're going to first remove all the background colors of each containers before
adding the background image. Let's go into that. Let's start
with the whole dashboard. We're going to remove it,
and then we're going to go and select the nav,
remove it as well. None, and to that overview. None to the next one.
To the last one. It's none. With
that, we don't have any background color
for the containers, but you still see here
gray and that comes from the default color
of the dashboard. If you go to the
format dashboard, you can see, we have
it as a default. This is nice, if you go to
the presentation models, you're going to have
everything as gray. We're going to
leave it as it is, and now we're going to go and
add the background image. We're going to have it as a
floating image to the middle, make sure it is fit and
center and then choose. We're going to go with
the background summary. Now next, we're going
to go and change the size to our dashboard size. And then the
position to be zero. Of course, now we are not seeing anything from the content and that's because the order
of the floating objects. Now as you can see it is on top, so let's go and move it to
the background and with that, we see the background
image of our dashboard. I think it's really nice. Now let's go and
do the same things for the next dashboard. We're going to do
the same things. The whole dashard,
going to be removed, the V be removed, and the list can be removed. With that, we don't have
any background colors. Let's go and add our floating
image for the background. Center fit, and we're
going to have our image. Same things, the size, the height, and the
position to be zero. Now, of course, we are
not seeing anything. We have to go and sort
the floating objects. It's going to be
as a background. All right, so that says, I'm really happy
about the results. Let's go and go to the
presentation models. So, guys, what do you think
we have an amazing dashboard, and this is the power of using the background image
for your dashboards. So we have more way
options to add shadows, rounded edges like here
and some lighting. So let's go and switch it. As you can see,
it looks amazing. All right, my friends. If
you still hear congrats, you have just completed
the table projects from the scratch from
the requirements until having this
amazing dashboard. And with that, you have
experienced all the phases of the table projects that I usually do in my
real word projects. So, friends, I
cannot really stress enough how it's
important to take time planning the
projects before rushing into building the
charts and the dashboards. Without having a clear
plan for the projects, things can lead to chaos. So take your time
planning it step by step. Course, feel free to share your project in any
platform that you prefer. L use it as portfolio for your table public profile
or as well in LinkedIn. And it would be nice
of you if you share and mention my channel
to spread the knowledge. So if you like this project and you want me to make
more content like this, please support the channel by subscribing, liking
and commenting. This really helps with
the YouTube algorithm, and as well, it helps
me to reach the others. And of course,
don't be stranger. You can connect and
follow me in Linked in. So, my friends, nothing
left to say beside. Thank you so much for
watching the tutorial, and I will see you in
the next video. Bye.
171. Congratulations & Thank You: Hi, I'm very proud of you that
you made it until the end. I hope you enjoyed the journey. And I know it wasn't easy going through all those
complex tutorials, but you made it until the ends. And now I can say that you have learned everything that you need to start doing amazing
projects in Tableau. And as well, you have learned everything that I
know about Tableau and how I usually implement
real life projects in Tau. So now, I'm going to ask
you for one more thing if you found this video helpful, and it helps you to start
working with Tableau. I really appreciate
it if you like it and share the content
with the others. And of course, if you
have any questions or suggestions for the next topic that you want me to
cover in the future, or you want to give
me a feedback, Make sure to use
the comment below. Well, nothing left to say. Thank you so much for
watching this course, and I will see you in
the next course. Bye.