One of other keyword of LoD is the function EXCLUDE. If you have already read my article about INCLUDE than you will easier understand the function EXCLUDE.
Remember!
By the function INCLUDE we included some numbers into the calculation even though we didn't visualize this number.
By the function EXCLUDE we exclude some numbers from the calculation even through we visualize them.
However, let's us go step by step...
With the function EXCLUDE you can find answers to such questions like:
- What is the total slaes, as well as the total sales by region. Its means:
[(1) We need to exclude Region from our calculation of the monthly Total Sales
(2) And then include Region when calculating the regional Sales breakdowns.]
Here is the structure of this function:
On this chart you don't see any differences. You can ask: What sense does it make to create an LoD calculation field with "EXCLUDE" if I don't see any differences? Please remember the number of Sales in the month November.
Than put region to the column and you will see differences:
Let's have a look to the month November.
You see in both regions in the first column (the left bar chart) the sum of sales (SUM[Sales]) and you see the differences between two regions. If you look to the blue bar chart, then you see, there are no differences between the regions. Compare this number with the number on the first chart. There are no differences. Tableau just ignored regions. This is the main idea of the function EXCLUDE. And this is the answer to our question.
Note!
By this visualization we do show the Regions but Tableau excluded this dimension by the calculation in the background.
You can find also the wihtpaper here.
This links could be also helpful:
- LoD: INCLUDE
- LoD: FIXED
- Top 15 LOD Expressions (english)
- Top 15 LoD Expresions (german)
- Video: Introduction to LoD (english)
I hope this blog was helpful either... ;-)
Remember!
By the function INCLUDE we included some numbers into the calculation even though we didn't visualize this number.
By the function EXCLUDE we exclude some numbers from the calculation even through we visualize them.
However, let's us go step by step...
With the function EXCLUDE you can find answers to such questions like:
- What is the total slaes, as well as the total sales by region. Its means:
[(1) We need to exclude Region from our calculation of the monthly Total Sales
(2) And then include Region when calculating the regional Sales breakdowns.]
Here is the structure of this function:
With other words: with this formula we said to Tableau:
"Hey, Tableau, please ignore (EXCLUDE) "Region" if you calculate sales (SUM[Sales])"
Let's have a look to the practice:
Using the data from superstore, I created a calculation's fields:
- Eexclude_sale: { EXCLUDE [Region]:SUM([Sales])}
In order to have a comparison to the SUM(Sales) I created follow graph:
Than put region to the column and you will see differences:
Let's have a look to the month November.
You see in both regions in the first column (the left bar chart) the sum of sales (SUM[Sales]) and you see the differences between two regions. If you look to the blue bar chart, then you see, there are no differences between the regions. Compare this number with the number on the first chart. There are no differences. Tableau just ignored regions. This is the main idea of the function EXCLUDE. And this is the answer to our question.
Note!
By this visualization we do show the Regions but Tableau excluded this dimension by the calculation in the background.
You can find also the wihtpaper here.
This links could be also helpful:
- LoD: INCLUDE
- LoD: FIXED
- Top 15 LOD Expressions (english)
- Top 15 LoD Expresions (german)
- Video: Introduction to LoD (english)
I hope this blog was helpful either... ;-)
Kommentare
Kommentar veröffentlichen