The most important superpower in Tableau is the ability to create custom variables.
The ability to create a custom calculated field adds a lot of flexibility to Tableau. In the superstore data, even though you could create a dual axis chart to compare the profitability of various subcategories, would it not be simpler if you could just calculate the profitability?
In the video given below, you will first learn about renaming variables and converting discrete variables to continuous ones, and vice versa. This is the first step towards creating calculated feilds.
In the video, you saw a simple conversion of variables that you could do to suit your needs.
Next, you will learn how to create custom variables. To that end, let’s take a look at a demonstration.
As you saw in the video, creating custom variables in Tableau is simple.
All you need to do is click on the ‘Create Calculated Field’ in the data tab on the left side of the screen. A dialog box will appear where you can define the rules to create a custom variable.
The rules that Tableau uses to create variable fields are a bit strict. You always need to define aggregate functions around variables. The Tableau article linked here will cover the basics of creating custom fields.
While creating calculated fields, sometimes you may want to use various functions such as the ones that you use in Excel. Tableau has a lot of inbuilt functions. You can visit the Tableau web page linked earlier, to understand the extent of functionalities offered. It will be out of the scope of this module to explore all the functionalities, but we recommend you look at the various options available.
A special case of creating custom plots that appears in a lot of interview tasks is the plot of “Top N parameters” in a given category.
The top N parameters refer to the first or the last N categories. In simpler words, you would use these types of plots to find the top three, top five, bottom three or bottom five entries in a plot.
You can find a Tableau article explaining how these plots are created here and a video demonstrating the creation process here. This is a more advanced topic but it is frequent in interviews. Try to create a plot like this on your own. With all the concepts you have learned so far and the resources linked you should be able to do it.
In the next segment, let's discuss another type of chart: heat maps.