{"id":16093,"date":"2015-04-16T15:00:00","date_gmt":"2015-04-16T22:00:00","guid":{"rendered":"https:\/\/devwww.3cloudsolutions.com\/post\/level-of-detail-expressionstableau-modeling-is-now-better-than-ever-2\/"},"modified":"2023-11-29T15:55:57","modified_gmt":"2023-11-29T23:55:57","slug":"level-of-detail-expressionstableau-modeling-is-now-better-than-ever","status":"publish","type":"post","link":"https:\/\/3cloudsolutions.com\/resources\/level-of-detail-expressionstableau-modeling-is-now-better-than-ever\/","title":{"rendered":"Level of Detail Expressions: Tableau Modeling is Now Better Than Ever"},"content":{"rendered":"<div class=\"hs-migrated-cms-post\">\n<p>Tableau 9.0 is <a title=\"finally here\" href=\"http:\/\/www.blue-granite.com\/blog\/bid\/404778\/Tableau-9-What-You-Need-to-Know\" target=\"_blank\" rel=\"noopener\">finally here<\/a> and with it &#8211; a lot of community excitement. Among all the new great features, there is one in particular that makes this product very compelling. <em><strong>Level of Detail expressions<\/strong><\/em> are an enhancement to Tableau\u2019s calculation language that provide finer control over the context of business calculations.<\/p>\n<p><!--more--><\/p>\n<p>You might be wondering: Why is this important? Didn\u2019t Tableau already have robust functions for creating business metrics?<\/p>\n<p>Yes, but allow me to explain. Since its inception, Tableau has been highly regarded as <strong>a sophisticated visualization tool<\/strong>. At the same time, Tableau\u2019s heavy reliance on visual elements when computing business metrics has been criticized. It is not uncommon to hear IT folks argue that <strong>data modeling should be an abstraction<\/strong> not directly tied to any visual representation of the data.<\/p>\n<p>They carry this perspective for a simple reason: dynamic, portable calculations that can work under different reporting contexts \u2014 not just a single report view \u2014 are easier to maintain and hence represent a \u201cbetter practice.\u201d This is why Level of Detail expressions are so important \u2014 they push Tableau a bit more into the world of abstract modeling, allowing users to create calculations that are less dependent on visual elements.<\/p>\n<p>For example, let\u2019s say we want understand the relative contribution of a product subcategory to the overall sales for any given year:<\/p>\n<p style=\"padding-left: 210px; text-align: left;\"><span style=\"text-decoration: underline;\">Product Subcategory Sales<\/span><br \/>\nTotal Year Sales<\/p>\n<p>Prior to Tableau 9.0, we would use a <em>table calculation<\/em> to compute the denominator. The screenshot below shows how this would work, calculating a total from the top to the bottom of our visualization:<\/p>\n<p><img decoding=\"async\" class=\"alignCenter\" style=\"display: block; margin-left: auto; margin-right: auto;\" src=\"https:\/\/3cloudsolutions.com\/wp-content\/uploads\/2022\/11\/table_calculations.jpg\" alt=\"table calculations\" border=\"0\" \/><\/p>\n<p>That looks simple enough. By using this context for the denominator, we can now see which product sub-category was the top contributor:<\/p>\n<p><img decoding=\"async\" class=\"alignCenter\" style=\"display: block; margin-left: auto; margin-right: auto;\" src=\"\/\/cdn2.hubspot.net\/hub\/257922\/file-2770908803-jpg\/images\/contributor.jpg\" alt=\"contributor\" border=\"0\" \/><\/p>\n<p><img decoding=\"async\" class=\"alignCenter\" style=\"display: block; margin-left: auto; margin-right: auto;\" src=\"\/\/cdn2.hubspot.net\/hub\/257922\/file-2770908813-png\/images\/top_contributor.png\" alt=\"top contributor\" border=\"0\" \/><\/p>\n<p>Assume I share the visualization with power users who want to explore data further. A logical approach may be to narrow their analysis (select office machines as the top contributor) and then drill into details (to see products that belong to this sub-category).<\/p>\n<p>Tableau allows users to narrow the analysis by using the \u201cKeep Only\u201d menu option shown below, and filter on a specific value:<\/p>\n<p><img decoding=\"async\" class=\"alignCenter\" style=\"display: block; margin-left: auto; margin-right: auto;\" src=\"\/\/cdn2.hubspot.net\/hub\/257922\/file-2770908823-jpg\/images\/keep_only_menu_option.jpg\" alt=\"keep only menu option\" border=\"0\" \/><\/p>\n<p>This intuitive report interaction has an unfortunate consequence: Our denominator has lost its \u201ccontext\u201d and now the contribution metric incorrectly shows a 100 percent contribution to the year total. (Remember: office machines only contributed 16.53 percent to the year total)<\/p>\n<p><img decoding=\"async\" class=\"alignCenter\" style=\"display: block; margin-left: auto; margin-right: auto;\" src=\"\/\/cdn2.hubspot.net\/hub\/257922\/file-2770908833-png\/images\/intuitive_report.png\" alt=\"intuitive report\" border=\"0\" \/><\/p>\n<p>If we drilled into office machine products, we would see a chart that makes little sense, showing that all products contributed 100 percent to the year total!<\/p>\n<p><img decoding=\"async\" class=\"alignCenter\" style=\"display: block; margin-left: auto; margin-right: auto;\" src=\"\/\/cdn2.hubspot.net\/hub\/257922\/file-2770908843-jpg\/images\/office_machine_products_chart.jpg\" alt=\"Office Machine Products Chart\" border=\"0\" \/><\/p>\n<p>To a regular business user this behavior may seem totally wacky. <em>Why would our filtering behavior affect the calculation output?<\/em><\/p>\n<p>Table calculations, in Tableau, have been traditionally tied to what is being represented or defined as the level of detail in the visualization canvas. A \u201cYear Total\u201d calculation may or may not represent the actual total for the year, depending on what you are plotting in your visualization. There are tricks to get this to work, but sometimes too complex for regular business users.<\/p>\n<p>Fortunately, in Tableau 9.0 we can now provide a much more intuitive behavior using elegant Level of Detail expressions. These provide increased calculation re-usability under broader reporting contexts, which is a great modeling improvement.<\/p>\n<p>By re-defining the denominator with the following expression, Tableau will \u201cretain\u201d the context of the calculation even after filtering product sub-categories:<\/p>\n<p><img decoding=\"async\" class=\"alignCenter\" style=\"display: block; margin-left: auto; margin-right: auto;\" src=\"\/\/cdn2.hubspot.net\/hub\/257922\/file-2770908853-jpg\/images\/retain_the_context.jpg\" alt=\"Retain the Context\" border=\"0\" \/><\/p>\n<p><img decoding=\"async\" class=\"alignCenter\" style=\"display: block; margin-left: auto; margin-right: auto;\" src=\"\/\/cdn2.hubspot.net\/hub\/257922\/file-2770908863-jpg\/images\/calculation.jpg\" alt=\"calculation\" border=\"0\" \/><\/p>\n<p>This Level of Detail expression does not require any additional settings as we would use with traditional table calculations.<\/p>\n<p>Now, when drilling into product details, the chart will maintain the correct year total as the denominator, no matter what is being represented in the chart. This allows us to see the top contributor at the product level:<\/p>\n<p><img decoding=\"async\" class=\"alignCenter\" style=\"display: block; margin-left: auto; margin-right: auto;\" src=\"\/\/cdn2.hubspot.net\/hub\/257922\/file-2770908873-jpg\/images\/top_contributor_product_level.jpg\" alt=\"top contributor product level\" border=\"0\" \/><\/p>\n<p>By using Level of Detail expressions you can create more \u201cabstract\u201d calculation logic with reusable metadata users can benefit from. Self-service data explorations will improve given users will have to rely less on having specific visual elements already configured before the calculation can offer analytical value.<\/p>\n<p>Are you getting the most out of your Tableau investment? 3Cloud can help. We plan, design and build solutions using Tableau technology, and can help you scale self-reliant BI in your organization. Let us know how we can help you get the maximum ROI from your analytics technology. <a href=\"\/get-started\/\">Contact us today<\/a> to learn more. \u00a0Or, if you are interested in trying Tableau for yourself, click here for a free 14-day trial of <a href=\"http:\/\/get.tableau.com\/partner-trial.html?partner=38868\" target=\"_blank\" rel=\"noopener\">Tableau Desktop<\/a>.<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Tableau 9.0 is  finally here  and with it  a compelling new feature, Level of Detail expressions. See why Tableau modeling is now better than ever.<\/p>\n","protected":false},"author":21,"featured_media":15006,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"content-type":"","footnotes":""},"categories":[260],"tags":[326],"class_list":["post-16093","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-data-ai","tag-data-visualization","topics-blog"],"acf":[],"_links":{"self":[{"href":"https:\/\/3cloudsolutions.com\/wp-json\/wp\/v2\/posts\/16093","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/3cloudsolutions.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/3cloudsolutions.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/3cloudsolutions.com\/wp-json\/wp\/v2\/users\/21"}],"replies":[{"embeddable":true,"href":"https:\/\/3cloudsolutions.com\/wp-json\/wp\/v2\/comments?post=16093"}],"version-history":[{"count":0,"href":"https:\/\/3cloudsolutions.com\/wp-json\/wp\/v2\/posts\/16093\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/3cloudsolutions.com\/wp-json\/wp\/v2\/media\/15006"}],"wp:attachment":[{"href":"https:\/\/3cloudsolutions.com\/wp-json\/wp\/v2\/media?parent=16093"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/3cloudsolutions.com\/wp-json\/wp\/v2\/categories?post=16093"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/3cloudsolutions.com\/wp-json\/wp\/v2\/tags?post=16093"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}