{"id":711,"date":"2017-02-10T23:00:31","date_gmt":"2017-02-10T23:00:31","guid":{"rendered":"https:\/\/blogs.scu.edu\/dataviz\/?p=711"},"modified":"2017-02-10T23:00:31","modified_gmt":"2017-02-10T23:00:31","slug":"dive-into-tableau-calculated-fields","status":"publish","type":"post","link":"https:\/\/blogs.scu.edu\/dataviz\/2017\/02\/10\/dive-into-tableau-calculated-fields\/","title":{"rendered":"Dive into Tableau Calculated Fields"},"content":{"rendered":"<p>Last week, we discussed in the class of how to simplify complex visualizations in Tableau by creating new data from existing data through calculated fields.<\/p>\n<p>Though it is best to prepare our data as much as possible before it gets to Tableau, there are many reasons to leverage the calculated fields functionality in Tableau.\u00a0Few of them are:<\/p>\n<ul>\n<li>To segment your data in new ways on the fly<\/li>\n<li>To prove a concept such as a new dimension or measure before making it a permanent field in the underlying data<\/li>\n<li>To filter out unwanted results for better analyses<\/li>\n<li>To take advantage of the power of parameters, putting choice in the hands of your end users<\/li>\n<li>To calculate ratios across many different variables in Tableau, saving valuable database processing and storage resources<\/li>\n<\/ul>\n<p>As we know it is important to understand the data before making any visualizations. Understanding the data also includes knowing the nature of the data based on which\u00a0we can decide in which family of calculation our data belong. There are three major families of calculated fields in Tableau:<\/p>\n<p><strong>Non-aggregate calculations\u00a0<\/strong><\/p>\n<p>These are the simplest type of calculation. Non-aggregate calculations are performed for each row in the underlying data, rather than being performed on aggregated data (such as you would find in a pivot table or Tableau view).<\/p>\n<p>It is a\u00a0calculated field which does not use any functions from the \u2018Aggregation\u2019 function group. For example: [Sales] \u2013 [Cost] would be a non-aggregated calculation.<\/p>\n<p><strong>Aggregate calculations<\/strong><\/p>\n<p>Aggregate calculations are those that use aggregate functions.\u00a0 Examples of aggregate functions are SUM, AVG, MAX &amp; MIN (there are a few others). Therefore an example of an aggregate calculation would be: Profit Ratio =\u00a0<strong>SUM(Profit) \/ SUM(Sales).<\/strong><\/p>\n<p>When we drag and drop a measure in Tableau, it is automatically aggregated. The default is sum. The primary difference between aggregate and non-aggregate calculations is that aggregate calculations often can\u2019t be sensibly calculated for each row in the underlying data set \u2013 it normally only makes sense to calculate them when the data is aggregated.<\/p>\n<p><strong>Table calculations:<\/strong><\/p>\n<p>Table calculations\u00a0allows us to compare two or more separate measures in our data set,\u00a0it\u00a0allows us to compare a singular measure to itself (the only way to compare a measure against itself). \u00a0These are the calculations which are applied to the values in the entire table. For example, for calculating a running total or running average we need to apply a single method of calculation to an entire column. Such calculations cannot be performed on some selected rows.<\/p>\n<p>When writing any calculation, make sure to know exactly what you want to do. There are many functions and table calculations within the powerhouse of Tableau which can be utilized to create the calculated fields for\u00a0presentation of data in a pictorial or graphical format. Keep exploring. Keep learning.<\/p>\n<p>Sources:<\/p>\n<p>http:\/\/www.clearlyandsimply.com\/clearly_and_simply\/2010\/10\/calculated-fields-in-tableau.html<\/p>\n<p>https:\/\/www.tableau.com\/about\/blog\/2017\/2\/top-10-tableau-table-calculations-65417<\/p>\n<blockquote class=\"wp-embedded-content\" data-secret=\"cSaJedfb6I\"><p><a href=\"https:\/\/evolytics.com\/blog\/tableau-fundamentals-introduction-calculated-fields\/\">Tableau Fundamentals: An Introduction to Calculated Fields<\/a><\/p><\/blockquote>\n<p><iframe loading=\"lazy\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; clip: rect(1px, 1px, 1px, 1px);\" title=\"&#8220;Tableau Fundamentals: An Introduction to Calculated Fields&#8221; &#8212; Evolytics\" src=\"https:\/\/evolytics.com\/blog\/tableau-fundamentals-introduction-calculated-fields\/embed\/#?secret=6bXhq74n58#?secret=cSaJedfb6I\" data-secret=\"cSaJedfb6I\" width=\"600\" height=\"338\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe><\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Last week, we discussed in the class of how to simplify complex visualizations in Tableau by creating new data from existing data through calculated fields. Though it is best to prepare our data as much as possible before it gets to Tableau, there are many reasons to leverage the calculated fields functionality in Tableau.\u00a0Few of &hellip; <a href=\"https:\/\/blogs.scu.edu\/dataviz\/2017\/02\/10\/dive-into-tableau-calculated-fields\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Dive into Tableau Calculated Fields<\/span><\/a><\/p>\n","protected":false},"author":1883,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"qubely_global_settings":"","qubely_interactions":"","kk_blocks_editor_width":"","_kiokenblocks_attr":"","_kiokenblocks_dimensions":"","footnotes":""},"categories":[1],"tags":[],"class_list":["post-711","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"gutentor_comment":0,"qubely_featured_image_url":null,"qubely_author":{"display_name":"roopadaga","author_link":"https:\/\/blogs.scu.edu\/dataviz\/author\/roopadaga\/"},"qubely_comment":0,"qubely_category":"<a href=\"https:\/\/blogs.scu.edu\/dataviz\/category\/uncategorized\/\" rel=\"category tag\">Uncategorized<\/a>","qubely_excerpt":"Last week, we discussed in the class of how to simplify complex visualizations in Tableau by creating new data from existing data through calculated fields. Though it is best to prepare our data as much as possible before it gets to Tableau, there are many reasons to leverage the calculated fields functionality in Tableau.\u00a0Few of&hellip;","post_mailing_queue_ids":[],"_links":{"self":[{"href":"https:\/\/blogs.scu.edu\/dataviz\/wp-json\/wp\/v2\/posts\/711","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.scu.edu\/dataviz\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.scu.edu\/dataviz\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.scu.edu\/dataviz\/wp-json\/wp\/v2\/users\/1883"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.scu.edu\/dataviz\/wp-json\/wp\/v2\/comments?post=711"}],"version-history":[{"count":1,"href":"https:\/\/blogs.scu.edu\/dataviz\/wp-json\/wp\/v2\/posts\/711\/revisions"}],"predecessor-version":[{"id":712,"href":"https:\/\/blogs.scu.edu\/dataviz\/wp-json\/wp\/v2\/posts\/711\/revisions\/712"}],"wp:attachment":[{"href":"https:\/\/blogs.scu.edu\/dataviz\/wp-json\/wp\/v2\/media?parent=711"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.scu.edu\/dataviz\/wp-json\/wp\/v2\/categories?post=711"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.scu.edu\/dataviz\/wp-json\/wp\/v2\/tags?post=711"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}