5 Replies Latest reply on Mar 7, 2017 6:13 PM by Walt Reed

    dynamic reference line

    gene shackman

      I have a dynamic dashboard. On the dashboard page, I have a set of tables and charts for an indicator, each referring back to worksheets, one each for a table or chart. I have three indicators of interest, so on the dashboard, I can click on the indicator box, and the workbooks will change to my indicator of choice, and then the dashboard changes to my indicator of choice. All good so far. However, I added a reference line to one of the charts. The reference line was specific to one indicator. Now, when I change indicators, the reference line (objective) stays the same, so I have the wrong reference line after I change indicators. Any way to make the reference line dynamic too?

       

      I'm attaching the twbx file, and below is how I created the reference line.

      In a chart, click on the y axis and click on add reference line. Click on the y axis. A pop up box should appear, and one option is “add reference line”. Then in the next pop up box, in “value”, create a new parameter, and you can type in “Objective” and the value.

       

      Thanks

       

        • 1. Re: dynamic reference line
          Walt Reed

          Hi Gene,

          Can you explain what the desired outcome is for the reference line? What is it based on? Right now the Parameter value for Objective is 6.4--where does this derive from? This can help us figure out how to get your desired result.

           

          Walt

          • 2. Re: dynamic reference line
            gene shackman

            Walt, yes, I should have included that information. The objective in the file now (6.4) is for indicator PA57 (percent adolescents who attempted suicide). The objective for PA56 (feeling sad or hopeless) is 22.4. The objective for PA52 (use alcohol) is 34.6. The other two objectives are not currently in the file. If I create each dashboard manually, I'd have to manually enter them.

             

            Thanks

            • 3. Re: dynamic reference line
              Walt Reed

              Hi Gene,

              Thanks for the additional information. This is going to be a multi-step process using Parameters.

              1. Create a new Parameter called Indicator (Add from Field-->Indicator)

              2. Create a calculated field at assign values to each Parameter value.

              3. Create a logical calculated field to compare the Indicator to the Parameter Indicator, then add to the Filter shelf and filter for only True (at the same time, remove the "Indicator" filter).

              4. Add the "Ref Line" calculated field to Detail, aggregate at the AVG level, then add a reference line to the table.

              5. Repeat this process for each table in the viz.

              By the end of this, you now have a Parameter value driving the filtering of your dashboard rather than the "Indicator" field.

               

              Let us know how this works out for you.

               

              Walt

              • 4. Re: dynamic reference line
                gene shackman

                Walt

                 

                Thanks for the detailed instructions. I'm having trouble at step 4. I don't seem to see an "AVG(Ref Line)". I only see SUM(Ref Line). However, I will review your file to see if that helps. Also, I'm generating the raw data file in SAS, so I think I can use SAS to generate a "Ref Line" variable, save a little calculations in Tableau, but not sure about that.

                 

                Thanks .... still working on it.

                • 5. Re: dynamic reference line
                  Walt Reed

                  Hi Gene,I'm not at my computer right now, but basically when you add the Ref Line to the Detail, it will aggregate by SUM by default, so you'll want to right-click on Ref Line in the Detail shelf to change to AVG. 

                  Walt