5 Replies Latest reply on Sep 8, 2016 9:47 AM by Andrew Boxley

    Create a string parameter like variable

    Andrew Boxley

      Hello,

       

      I've been struggling with a seemingly simple issue. I'm trying to create a list of names that can be thrown into the rows of table. Ideally, I'd be identical to a string parameter, but allow me to throw it into the table so I can see the entire list at once. The reason I need this is to create calculated fields that give me different values depending on which row (Name) it is on.

       

      Example:

       

      Created List Variable                       Calculated Field (Case [Created List Variable] When "Jon" then "Apple", when "Jack" then "Banana" etc.)

                                                   

      Created List VariableCalculated Field
      Jon Apple
      JackBanana
      JimmyOrange
      JacobPear

       

      Thank you for the help!

       

      Best,

      Andrew

        • 1. Re: Create a string parameter like variable
          Tom W

          Parameters in Tableau are single value only, you cannot display them 'in a report' in a listed fashion.

           

          The reason I need this is to create calculated fields that give me different values depending on which row (Name) it is on.

          I don't understand what you're trying to achieve here - it sounds to me like you need to create your data / list outside of Tableau, connect to it then create your fruit calculated field. Why aren't these values (Jon, Jack etc) in your datasource in the first place? That might help me to understand your need

          • 2. Re: Create a string parameter like variable
            Andrew Boxley

            The reason these fields aren't already in the data is because these are corporate goals that are being set. I'd like to be able to list all of the goals in a created string field and create calculated fields off of the goal names so they can all be displayed in one table.

             

            Ideally, I'll have a column for Goal Titles, the QTD (from live data source), the Goal and the percentage of Goal completed.

             

            The Goal Titles are where I'm having the trouble. Once I have a variable for the Goal Titles, I can use If statements to populate the right data into the QTD, Goal and % of Goal columns.

            • 3. Re: Create a string parameter like variable
              Tom W

              Listing all goals in a string field doesn't really help me visualize what you need. As per my first post, I'd say again that parameters are single value. So based on that, can you just create a parameter of type string with the text "goal goal goal goal goal"? I suspect now, so I need to know more about how you want to use this.

               

              Please upload a Tableau Packaged Workbook including sample data so I can see what you're working with. Make sure it aligns to the scenario you're trying to produce in your first post. Otherwise, I'll need a new 'expected' outcome.

              • 4. Re: Create a string parameter like variable
                Stephen Rizzo

                I agree with Tom - I don't really see what role parameters would play here. Also, I would avoid coding all of your goals into a string if possible. Although I think you could get that approach to work, it seems awfully complicated for what you seem to be trying to do.

                 

                How I would approach this problem depends on how your data is structured. Assuming you have your measure names / keys available in their own fields, I would probably suggest creating a lookup table that matches each measure name with the appropriate goal value, then blend (or join if the aggregation happens in the source data) the lookup table to your data set. See the attached example.

                • 5. Re: Create a string parameter like variable
                  Andrew Boxley

                  I found a work around using text boxes, multiple sheets and a lot of formatting. Thank you all for the help.