![]() ![]() You will only need to change the level at which you want to aggregate in two places. This is a simple example but it is very easy to adjust it to your use cases. There are lot’s of applications, some interesting other ones can be found here How do I customise this? You could also use it to calculate how long somebody has been your customer, how many orders they do on average per month since they first became your customer or prepare some churn analysis. With the example you will be able to calculate the percentage of one sale of the total sales of a country. You could as well use it as a base for other calculations. You might just leave it as it is and expose it in a Tableau extract for people to use, at this point there is nothing more for you to do than to output the data and publish it on Tableau Server for example. (It doesn’t add up correctly because there is a lot more data which doesn’t appear in the screen shot). The sum of sales is the same for each record for a given country. Every country has their record level sales in one column and the sum of all sales in a second column. If we scroll to the right, we can now see something similar to the initial table on the top of this post. If these numbers are different, something went wrong! You will also notice that the total number of records equals the join result we didn’t filter anything or changed the level of detail for our main data set, so this is what we want to see. Prep should have picked up that you want to join on country (after all it’s the only dimension in your second data set). If you have a look in the configuration, you will see something similar to the screen shot below. In this case, drag your aggregate tool down to your first step until you see the orange markers and release it on top of “New Join” ( NOT New Union). It is tempting to click on the little “+” next to either of the steps and add a join but Prep has a nice little feature where you can drag and drop elements to connect them. Now we need to bring the two together again. At this point we already want to rename our aggregated field to “LOD Sum per Country” to make it easier to identify later on. The result of this is a data set which has one record per country with the total sales for this country. We tell Tableau to calculate the sum of sales (right pane – Aggregated Fields) per country (left pane – Grouped Fields). In the configuration pane for the Aggregate step, we set the fields up as below. Our intention is to create two separate copies of the data which we can manipulate independently for now. Make sure you do it from the input and NOT after the additional step which we have inserted. Next, we need to split out a stream from our input tool in order to do the aggregation on a different level. This step does not server any purpose for now, it is just the representation of our first requirement (keep our existing data set). combine the two resulting data sets into one with one additional columnįirst we connect to a data set, I use the Sample Superstore which Tableau provides and add a step behind.calculate the aggregate values (sum per country in this case) outside of our existing data set.don’t change the level of detail or filter out things) keep our existing data set as it is (ie.Since there isn’t a formula we can rely on in Tableau Prep, we need to build it from the granular tools which we have access to. Country | Sales | LOD (Sales per Country) A great breakdown of how to set it up and work with it in Tableau was written by Andy Kriebel here. To see what it does, have a look at the below table there are several records for each country and the LOD contains the sum of all records for a given country – for each record of this country. If you look at Sales per Month for each State, your Level of Detail is “Month and State”), with this technique you are able to do a lot of calculations and visualisations which wouldn’t be possible otherwise. ![]() While usually the Level of Detail is determined by your visualisation (ie. In it’s simplest form it tells Tableau to aggregate data on a defined level. In Tableau Prep there is (currently) no possibility to write a LOD but their is an easy trick to build one yourself. One feature which people initially might struggle to wrap their head around but is used all the time once they do is Tableau’s Level of Detail calculation (LODs). Tableau Prep has quite a bit of overlap with Tableau and implements many of the features in a more visual way (joins, unions, etc). ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |