👉🏻 Download Our Free Data Science Career Guide: https://bit.ly/2POLaN8
👉🏻 Sign up for Our Complete Data Science Training with 57% OFF: https://bit.ly/3iKD0lv
In this tutorial, we will show you how you can add calculations to tables through custom fields in Tableau.
Right now, the table we’ve created shows us the number of units sold by the firm in each month of 2016 and 2017. Let’s change this measure. What I would like it to show us is the revenue the company generated during each of these periods.
How can I do that?
Well, it’s fairly easy. Our source data contains information about price and Tableau counted the number of units sold (each row shows us a single car sale, right?). Therefore, if we multiply the “Price” field and the auto-generated “Number of records” field, we would obtain Revenues.
We already know how to create a calculated field.
I’ll name it “Revenue”, and will take advantage of Tableau’s auto-complete suggestions multiplying “Price” and “Number of records”.
We can use the “star” operator to carry out a multiplication. One very useful feature you have probably noticed, is that at the bottom of the screen Tableau tells us whether the calculation we’ve entered is a valid one or not. Right now, my calculation is valid. If I remove a few symbols, Tableau would indicate that the calculation contains errors. This is a good guiding light when we create a calculation.
Right, so this is our “Revenue” field. We can easily substitute the “number of records” data in the table with it. All I have to do is drag the “Revenue field” and position it over the “number of records data”. Tableau replaces the two fields.
An important metric contained in our source data is ‘Gross Profit’.
By definition, ‘Revenue’ minus ‘Cogs’ equals ‘Gross Profit’. Currently, we have ‘revenue’ and ‘gross profit’. Let’s calculate ‘Cogs’ as the difference between the two.
Nice. Let’s order our table in the following way. First, we’ll have Revenue, then Cogs, and finally Gross Profit.
► Consider hitting the SUBSCRIBE button if you LIKE the content: https://www.youtube.com/c/365DataScie...
► VISIT our website: https://bit.ly/365ds
🤝 Connect with us LinkedIn: / 365datascience
365 Data Science is an online educational career website that offers the incredible opportunity to find your way into the data science world no matter your previous knowledge and experience. We have prepared numerous courses that suit the needs of aspiring BI analysts, Data analysts and Data scientists.
We at 365 Data Science are committed educators who believe that curiosity should not be hindered by inability to access good learning resources. This is why we focus all our efforts on creating high-quality educational content which anyone can access online.
Check out our Data Science Career guides: • How to Become a... (Data and AI Caree...
#tableau #datascience #statistics