8 Replies Latest reply on Jun 7, 2017 6:54 AM by Elena Panaitescu

    Change Display As values in a Parameter

    Matt Lee

      Is there a way to change the "Display As" values in a Parameter to reference a different field than the Value?

       

      For example, in the "Value" field I'm using a field called manager_id, but in the "Display As" field I want to use a field called manager.  Is that possible?

       

      Seems Tableau only lets me manually change the "Display As" field or use the manager field for both the value and the display as fields.

       

      Screenshot attached just shows the "Edit Parameter" screen.

       

      Parameter Value.bmp

        • 1. Re: Change Display As values in a Parameter
          Mark Holtz

          Are you saying you're trying to allow the user to select the aggregation method (with this parameter) of a measure in your view?

          Is there just 1 measure you want to do this for?

           

          Let's say your measure is "Sales."

          You could just set the parameter (let's say it's called "Select Aggregation") to allow these values:

          "Average Sales", "Median Sales", and "Std Dev Sales"

           

          Then, create a calculated field called "Measure" as follows:

          IF [Select Aggregation] = 'Average Sales' THEN AVG([Sales])

          ELSEIF [Select Aggregation] = 'Median Sales' THEN  MEDIAN([Sales])

          ELSEIF [Select Aggregation] = 'Std Dev Sales' THEN  STDEV([Sales])

          ELSE 0

          END

           

          Then you just replace the "Sales" measure on your view with this new "Measure" field and expose the "Select Aggregation" parameter on the view.

           

          Even if there are more than 1 measure that you want to display one-at-a-time, you can explicitly label them in your parameter, and just change the aggregation to correctly reflect in each THEN clause of the "Measure" calculation.

           

          If you want to display more than 1 measure at a time, you'd just rinse and repeat, creating a new Parameter & Calculated Field for each different measure you want to show simultaneously...

          • 2. Re: Change Display As values in a Parameter
            Matt Lee

            Hi Mark,

             

            Appreciate the help.  The only reason I don't want to use a calculated field is that it requires me to add a new if else statement each time a new value is needed.

             

            In this case, I just want to display the value differently (manager name instead of the manager id) in my parameter.  For example, I have the following manager id's - managerid1, managerid2, managerid3 ... , but the display as value is set to the same field so it just shows the manager id.  I want it show a different field name - manager name but still key off the manager id (due to a calculated field).

             

            Is that possible?  Can I set the list value to manager id but have it display as using the manager name field?  I couldn't figure out a way to do it.

             

            sample.bmp

            • 3. Re: Change Display As values in a Parameter
              Mark Holtz

              Well, I'm a little confused now. I know you're asking if you can dynamically populate the "Display As" field of a parameter.  But as far as I know, you actually cannot even populate the Value field of a parameter dynamically.

               

              So if you ever had a new Manager ID, say managerid11, appear in your data, your parameter would not automatically update.

               

              Is there a reason you cannot accomplish this by using a QuickFilter on Manager Name?

               

              Does choosing the managerid impact which aggregation method needs to be used, or were you just using AVG, MEDIAN, STDEV as an example?

              • 4. Re: Change Display As values in a Parameter
                Matt Lee

                Sorry for the confusion. Yes, that's the problem I'm running into - if a new manager ID is added, I wouldn't be able to pick it up automatically.

                 

                The reason I'm using a parameter instead of a quick filter is that I'm keying off the manager id for a calculation otherwise it'd be much easier.  I'm using the manager id to lookup other values.

                 

                And I was just using AVG, Median, and StdDev as an example screenshot for the Edit Parameter screen.

                 

                It would be a nice feature if you could populate the "Display As" field of a parameter dynamically and set it to something different than the "Value" field.

                • 5. Re: Change Display As values in a Parameter
                  Andrew Watson

                  It would actually be very nice if any part of a parameter was dynamic. Hopefully one day...

                   

                  For now you're stuck using manual techniques unfortunately.

                   

                  Andrew

                  • 6. Re: Change Display As values in a Parameter
                    Phillip Marsh

                    If you go to the ideas section there is an Item about this dynamic parameter, you should add your vote to it.

                     

                    I am having trouble understanding exactly what you are trying to do and why do you need to do it.

                     

                    Can you send an example set of data with just dummy names and IDs to work off?

                     

                    I am assuming there is a calc that says if managerid is X then do Y else if Manager ID is etc...

                     

                    Have you tried using actions where the filter relates to a specific field?

                    • 7. Re: Change Display As values in a Parameter
                      Shay Hayo

                      you can copy the list to Excel sheet, change there the display, and paste it back to Tableau parameter

                      • 8. Re: Change Display As values in a Parameter
                        Elena Panaitescu

                        Yes, it is a way to change the "Display As" values in a parameter to reference a different value than the default one :

                        using the Paste from Clipboard feature. You could create a table in Excel, copy it (in  Clipboard), and Paste it back to Tableau Parameter .

                         

                        1No Annotations
                        2How it relates to application deadline