7 Replies Latest reply on Jan 18, 2016 5:49 AM by evelin.fann

    Dynamic header names

    John Liska

      I've created a relatively basic worksheet that graphs 2 measures against each other over time (by region). But because there are dozens of measures I built the worksheet to allow the user to select which 2 measures they want to compare. So while the X axis is fixed (time, in this case week) the Y axis has a Primary and a Secondary selection.

       

      Everything works fine, and obviously when I throw it in a dashboard I can control more of the look and feel. However, it would be nice to include the Primary and Secondary axis field names in the "Header" portion of the graph itself. As you can see from the attached image the default behavior in Tableau is to show the name of the measure itself, which is either "Primary Axis" or "Secondary Axis". But I would rather have it list the field that the user actually selected. In this example (see attached image) this would be "print_trps" instead of "Primary Axis" and "Page Views" instead of "Secondary Axis". This would save me some real estate on the dashboard and make things much clearer for the user.

       

      Curious if there's a good way to solve this issue, or if this is just a feature request for Tableau. Thanks in advance.

        • 1. Re: Dynamic header names
          Tracy Rodgers

          Hi John,

           

          This is a good one for the Ideas section, as I know you are the first person to request it!

           

          -Tracy

          1 of 1 people found this helpful
          • 2. Re: Dynamic header names
            Jonathan Drummey

            Hi John,

             

            If you posted this in the Ideas section, I'd be all for it! However, like most issues in Tableau, with a little creativity, some patience, and a certain amount of stubborness, the desired results can be achieved, as in the attached workbook.

             

            I'd known the basic method for how to have a dynamic primary axis title from earlier forum posts, such as this one: http://community.tableau.com/thread/110424. Basically, you either use the parameter that picks the measure to display or a discrete calculated field based on the parameter and have that as the right-most pill on the Rows shelf, adjust the formatting, and delete the default axis title. So that gets us a single axis. Getting a dynamic secondary axis is trickier, and here I borrowed the "duplicate worksheet on a dashboard to show custom grand total rows" technique, only this time we're using the duplicate worksheet for the secondary axis.

             

            For a dual axis, we use a dashboard with two (or three) worksheets. One worksheet has the left-hand headers, the left-hand (primary) axis with a dynamic axis title, the chart, and the right-hand (secondary) axis tick marks. The second worksheet has the dynamic secondary axis title only and is formatted to size and resize the same as the first worksheet. In the dashboard below, I added a third worksheet to have a color legend that would show all the possible measures at once.

             

            Dynamic Axis Titles.png

             

            Cheers,

             

            Jonathan

            1 of 1 people found this helpful
            • 3. Re: Dynamic header names
              John Liska

              Thanks Tracy! I'll add it in today.

              • 4. Re: Dynamic header names
                John Liska

                Thanks Jonathan! The detailed instructions were extremely helpful, I was able to put this together fairly quickly and it works great. Much appreciated!

                • 5. Re: Dynamic header names
                  Derek Noble

                  Hi Jonathan,

                   

                  How would I use your solution to a side-by-side bar chart?

                  I have a side-by-side bar chart that the use selects the two metrics to show side by side by using parameters and calculated fields but when doing this the chart shows the names of the calculated fields rather than their values. I cant work our how to use your solution to show the values of the calculated fields. Any ideas?

                  • 6. Re: Dynamic header names
                    Jonathan Drummey

                    Hi Derek,

                     

                    I can't give you an exact answer because I don't know how you are building your bar chart - is it using measure names/values, a dual axis, etc. A packaged workbook with some sample data would be helpful to be more specific.

                     

                    I put together a couple of examples in the attached for a side-by-side bar chart based on Measure Names/Values. In t the first, there are two worksheets on a dashboard, one returns the values to go at the bottom of the chart, the other shows the bars. The second example uses a dual-axis chart where the 2ndary axis is on 0 and Measure Values is on the label shelf. In v8, there's a third option where you can make the mark label on the inside bottom of the bars.

                     

                    Cheers,

                     

                    Jonathan

                    • 7. Re: Dynamic header names

                      Thank you for perhaps the most level headed thing I have read today. Thanks for the sharing, I also found a useful service for docs merging. If you ever need to merge some documents, here is How to combine PDF files? Merge PDFs online for free | AltoMerge  a really useful tool. Very easy to navigate and use.