Include Level of Detail Calculation: Tableau Functions
Вставка
- Опубліковано 22 лип 2024
- #tableau #salesforce #analytics
In this video, I take on one of the most requested videos and that is level of detail calculations specifically the Include LOD:
Top 15 LODs j.mp/3lCvqvG
How the level of detail expressions work: j.mp/3rbAhoM
How to create level of detail expressions: j.mp/3caOuOF
0:00 Intro
0:53 Setting up an example for the Include function
5:20 Writing an Include LOD calculation
7:00 Breaking down the calculation
9:51 Include vs Fixed LODs, how are they different?
14:08 Recap of the Include LOD
15:38 Another Example for Include
23:42 More resources for LODs
25:06 Outro Share feedback and Suggestions: tableautim.canny.io/suggestions -
-
Join this channel to get access to perks:
/ @tableautim ----------
(C) 2023 TN-Media LTD. No re-use, unauthorized use, or redistribution, of this video without prior permission.
Hi, great tutorials! Although I think there is an mistake in the second example. You've counted AVG but in fact for two cities - Lafayete is in two states. To have a correct answer I think you need also bring state to the viz.
Brilliant spot! Ah my geography let me down, I should have also brought in a calculation to count the distinct states underneath but for all intensive purposes, my calculations are correct but it doesn't account for the edge case so fo that city is indeed wrong. If I were to do this properly I would use an ID for each city and then that way this would be correct but the superstore doesn't have that. There's also the issue that Superstore itself changes between each release so for some people they might not see this issue. Thanks for taking the time to look into this. Great example of needing to understand your granularity of the data set.
I’ve watched 2 videos of yours so far. I love how you explain things in plain language, and takes time in doing so. Extremely helpful. ☺️
Very detail and amazing tutorial!
Great example and explanation!
Wonderful explanation ! You are my hero
It is the LOD mechanics that start to put me off Tableau. 1) they are confusing and 2) it seems to result in numerous special LOD calcs that can become unruly even for the workbook author let alone for others within an organization.
Not sure that I understand then what FIxed (orderid): sum(sales) shows when you add subcategory. If the order has multiple subcategories then where will this order appear, under which subcategory in the table? if we are calculating first of all sum of order then if we add it to the table it doesn't split by subcategories because it fixed then why do we have different numbers for each subcategory? THanks!
Where do you continue job
10:10 when you replace Region by Sub-Category Fixed LOD changed to 644 for Accessories. Could you please explain in more detail how this number came up?
I go on to explain it. Its to do with granularity of the data and the way the average is interacting with that. Are you familiar with granularity at least in the context of this data set? If not I can try and do an explainer in Imgur in the comments here.
Thanks for the great video. Would anyone be able to explain what is the difference between Sum(Sales) vs Sum([Sales])?
Good question! In this case theyre the same. strictly speaking Tableau liked fields in [brackets] but you can write them without.
what is that annotation app you have there
Presentify app: check the description in this video for a link: ua-cam.com/video/s_vC78SMQkk/v-deo.html
Great video as always!
I only have one question. In 9:15 you explained when FIXED LOD doesn't work properly. However, I suppose you noticed the calculation was not right, first because you are a Tableau Pro, but maybe also because you know this database pretty well.
My doubt is: how can someone notice this kind of problem with LODs when one is not familiar with a specific database?
So the thing to do is to do a check. You might have noticed in this video and the Fixed video, I always build another table of what I’m expecting to see and validate the value with a table. So in this example of the include function adds a dimension to the Viz level of detail then you could build a Viz with a combined field of subcat and order and then used fixed in that example to see that you would get the same answer as the include function when you do the average of that value. On reflection I should have maybe shown this on screen. But in summary just get comfortable validating the calculation with a table which allows you to check the values quickly using the summary pane to cross reference the aggregations. It definitely gets tricky on some table calculations though and in those situations I like to build up the calculation in steps.
The other thing is to check out my video on granularity because the only reason I knew the figure was wrong was because I knew the context of the database is about products and also saw that the region always has a 1 to 1 relationship with the customer.
Will maybe do a video at the end of the week on troubleshooting
@@TableauTim Thanks again for your complete reply! I watched the video about granularity, but I guess I may need to watch it one more time.
@@svetlana_kapranova no it’s not you. I need to maybe add another video to the series. I found it really tough to explain so I’ll probably add one more video on trouble shooting and checking your calculations. I missed that I this video where as for the fixed video I made a better example.
Hi Tim, can i contact you for Tableau training?
I'm a full time consultant at the information lab, full time dad and I make videos here. Welcome to suggest topics but I don't do training on the side, not enough time in the day. If this ever changes, You'll know about it if you stay subscribed.
Hello Tim,
Good Afternoon.
i just wanted to clarify a doubt with include lod video explanation -
You have created an lod as {fixed order_id : sum(sales)}. In the view it was showing
---
For Accessories = 644
---
so the behind calculation, is it like this...
considering order_id = CA-2020-121755 and CA-2020-118255 (taken two sample of Order Id's)
fixed of order id means for each order_id it will calculate the total sales.
for CA-2020-121755 total sales is 103
for CA-2020-118255 total sales is 63
if i consider CA-2020-121755, which is in accessories as well. Normally it should have been
for accessories - CA-2020-121755 - the total sales is 91
due to the fixed lod expression, rather than taking 91, it will be recalculated as 103 (because this order_id is with few other subcategories)
if i consider CA-2020-118255, which is in accessories as well. Normally it should have been
for accessories - CA-2020-118255 - the total sales is 42 (approximately)
due to the fixed lod expression, rather than taking 42 (approx) , it will be recalculated as 66 (because this order_id is with few other subcategories)
Similarly for other order ids. if i calculate for all orders then it will end up with Accessories - 644 (Fixed Lod order size)
Is this how the calculation is running at the back of tableau ??
Thank You
Regards,
Rajarshi