In a previous article we discussed the importance of reference lines in Tableau and how they help users relate to situations in a particular dataset. As we said here, the reference lines are seen as horizontal or vertical lines located at a specific point in a graph. With their help, users can analyze how the results obtained in a certain period are in relation to a certain plan or target.
Dynamic reference lines in Tableau Software offer users a more interaction with the analyzes performed. They have the possibility to set the reference line according to other parameters that are not found in the analyzed data set. Thus, the movement of the dynamic reference lines in the graph will always depend on the value of the parameter entered by the user.
On the other hand, dynamic reference lines are often used to interpret how the results obtained might have been in relation to certain values. Dynamic reference lines offer a way to compare with other figures or values that are not found in our data. For example, we can compare the values of sales obtained in a certain period with the amount of sales we would have liked to have in our target. Dynamic reference lines help users to be guided in the process of analyzing the data and values obtained. These, unlike the classic reference lines whose value cannot be modified, offer the users the possibility to modify at any time the value of the parameter that underlies the line.
Dynamic reference lines give users the opportunity to interact more with their charts. Thus, they can analyze situations in which the plan or values from the established targets would have been different.
Next, we will show you how to create a dynamic reference line:
→ In Tableau Desktop, we have connected to a dataset that contains Stock Market Prices.
→ Create a parameter named Reference Date Stock. From the Data type area choose Date, for Current Value type in a date, for example 16/06/2008 and from the Display format choose the format that you want to display the data.
→ Create a calculated field named Adjusted closing price on Reference Date with the formula:
WINDOW_MAX(
IF (MAX([Date]) = [Reference Date Stock]) THEN SUM([Adj Close]) ELSE NULL END,
FIRST(),
LAST())
→ Create another calculated field named % Difference with the formula:
1+((SUM([Adj Close]) – [Adj Close on Reference Date]) / [Adj Close on Reference Date])
→ Drag the field % Difference on Rows. Drag the Date on Columns and view it as Continuous Day.
→ Drag the Company Name on Color.
→ Go to Analytics and add a Reference Line to the view. Select Per Pane. For Value select Reference Date Stock. For Label select Value and for Tooltip select Custom with the Value field.
→ Create a Dashboard and drag the Reference Change sheet on it.
→ Go to Dashboard -> Add Action -> Change Parameter. For the Source Sheet area select the Reference Change sheet. For the Run action on click on Select. For Target Parameter select the Reference Date Stock parameter and for the Field area select DAY(Date).
→ Now when you select a date the reference line will move according to what you have selected. This makes the view more dynamic and attractive.
By Adelina Popescu
What is a Context? Contexts are used to configure a Job for standard environments within the Software Development Life Cycle, such as Development, Testing, and Production. A Job always runs within a specific context. When a context is selected in […]
In Talend Cloud Management Console (TMC), you can create executable tasks and execution plans, which can be run directly in the Cloud or with a Remote Engine. You need to create an execution plan to allow automated runs in TMC, […]
In this Skillpill, you will learn how to use Tableau Prep to organize, clean, and transform your data to be further used in analysis and visualizations. Data comes in all shapes and sizes, especially of different quality, which sometimes proves […]