I think LoD is the most popular calculation method if you are using tableau. Thus, you can find a lot of good blogs, whitepappers etc., to this topic.
There are three keywords in LoD: INCLUDE, EXCLUDE and FIXED.
However, why LoD is so popular? Why everybody discussed about this keywords? Where is the magic?
As you know, Tableau shows you data if you put this data to the row or to the column. However, what if you would like to count into some numbers, but you don't want to vizualize them?... The answer is LoD :)
Let's have a look to the first magic function: INCLUDE
With this function you can find an answer to such questions like:
- Which region has the highest average of order size?
- Which country in the sales database has sales reps who close the “biggest deals,” on average?
Here is the structure of this function:
If we modify the formula to :
AVG({INCLUDE [Order ID]:SUM([Sales])})
we would find an answer to the question: Which region has the highest average of order size?
With other words: with this formula we said to Tableau:
"Hey, Tableau, please INCLUDE the sale (SUM([Sales])) as an average to each orders ([Order ID]) always in account, even then when I don't show orders!"
Let's have a look to the practice:
Using the data from superstore, I created two calculation's fields:
1) AVG_LOD: avg({INCLUDE [Order ID]:SUM([Sales])})
2) AVG Sales: AVG([Sales])
and I created follow bar chart:
What did we calculate?
By the calculation AVG_LOD, Tableau calculated as a first step the average of all orders, and as a second step it calculated the average of this average for every region. So this is the answer to our question: Which region has the highest average of order size?
Note!
By this visualization we don't show the order ID but Tableau included this number by this calculation in the background.
By the calculation "AVG Sales" we just calculate the average of the sales per region. Here, Tableau didn't calculate an average per order, it calculated the average of sales.
You can find also the wihtpaper here.
This links could be also helpful:
- LoD: EXCLUDE
- LoD: FIXED
- Top 15 LOD Expressions (english)
- Top 15 LoD Expresions (german)
- Video: Introduction to LoD (english)
I hope this blog was helpful either... ;-)
Dieser Kommentar wurde vom Autor entfernt.
AntwortenLöschen