Skip to main content

Creating Dynamic Reference lines in Tableau

Did you know that you can allow reference lines on your graphs to be dynamic based on your user's entry?

In this article we will discuss how to create a dynamic reference line.  This way your user will be able to place dates on a graphic without even being a report developer.

In the example below, a user was able to plug in the dates where they started a new workout routine, and also place the dates they went on vacation.




First, we will need to create a parameter for user entry.

1. Create a new parameter.

2. Name your parameter.  The below parameter is named "Met Fitness Goals"



3. The parameter is also set to "Date", so the user can select the date.

4. The parameter is set to a date that is not on the graph so that it won't show until the user edits it.

5. Select "Ok".

6. To add your reference line, right click on the x axis at the bottom of your graph and select "Add Reference Line"


7. For Value, select the parameter name you just created. 

For Label, select Custom and choose field name.

8. Format your reference line as desired.

9. Next, select your parameter, and choose show parameter control on the graph in which you would like it to appear.

10. Test out changing the dates on the parameter.  Notice how it changes with user entry.

11. Format the reference line as desired, by right clicking on the text and choosing "Format".

This is how the text was changed to vertical.




Comments

Popular posts from this blog

Transfer Apple Watch or Apple Health data to Excel or Sheets

Have you ever attempted to get the data from your Apple Watch or Apple Health app into a format you can share with others?  Maybe you'd like to share this information with a doctor, or maybe you'd simply like to analyze the data yourself in Excel.  There are XML converters out there, but once you get the data from these converters into excel using this technique, the data can look quite ambiguous. Luckily, "There is an app for that."  It's called QS Access.  This solution is very quick and easy for exporting your data into a format you can use quickly. Unfortunately with this app, you won't be able to export every field from your apple watch, however you will be able to export fields such as: Active Calories Resting Calories Steps Distance Flights Climbed Heart Rate Blood Pressure Calories Weight BMI and more... So how do you get this app?  Simply go to the app store from your Apple iPhone and search for "QS Access".  Once you...

Creating a Dynamic one click PDF button in Tableau

Can I get that in a PDF view?  If you are a report developer, you have most likely heard this question before. In Tableau, you can choose to print any dashboard as a PDF from the toolbar in Tableau Server, but if your dashboard contains a lot of heavy color, you may want to create a separate layout for your printable PDF.  You could send your users to another dashboard with a separate view design, but what if you could do this, and then generate your PDF in one step?  This would allow your users to generate a PDF and separate view in one click. In this exercise, we are going to create a Tableau button that automatically generates a PDF with an updated look specifically for PDF views only on click. First, we need to create a customized Tableau button. This process is very similar to the first article in this series, " Creating a custom Tableau button " except instead of using a Tableau Shape for our button, we will use an image. 1. Navigate to your “My Tableau ...

Creating an Action for a Tableau Button

In the previous exercise we created a customized Tableau button using Marks and Shapes . In this article, we will set up a Dashboard action that will allow you to click through to another Dashboard within your workbook.   1. Click on your first Dashboard and ensure that the item you want to create an action for is on your dashboard. 2. Go to Dashboard > Actions 3. Click on "Add Action" 4. For this example, we will choose "Filter" 5. For Source Sheets, make sure your first dashboard is selected.     (Use the image below to help you with Steps 5 - 12) 6. Under Source Sheets place a check mark on your button to have the action run when the button is selected. 7. Choose how you would like to initiate the action.  For this example, we will choose "Select". 8. For Target Sheets, make sure your destination dashboard is selected.  9. De-select all sheets under "Target Sheets". 10. Click on "Selected Fields...