4 Replies Latest reply on Sep 26, 2016 7:49 AM by Guillermo Mendez-Kestler

    Some form of dynamic parameter?

    Dan Harrison

      I have a set of survey data that contains the following fields of interest:

      • Year
      • Sector: a sector representative of the questions being asked (e.g. sport)
      • A More/Less field: This contains the value More, or Less
      • Response: This is a reason why someone does more of the thing (in this case sport); or less of the thing. (e.g. to improve my health). It was selected by the respondent from a list, so it is discrete and not a freeform
      • A set of demographics (e.g. gender, age).

       

      I need the dashboard to allow you to select a year, a sector and either "More" or "Less". The user then selects one response from those that have been completed for the category chosen.

       

      A "Gender" chart will show two bars:

      • The percentage of females' responses within the sector, year and more/less category that were the one selected
      • The percentage of males' responses within the sector, year and more/less category that were the one selected.

       

      For example, someone will choose 2014/15, sport, and "more", and then will select "to improve my health". The chart will show that 12% of females that answered the "more" sport question in 2014/15 said "to improve my health"; while only 8% of males said the same.

       

      I'm struggling in two ways:

      • If I use a parameter, I have no way of getting its options to be dynamic depending on the sector, more/less and year chosen;
      • If I instead use a filter, I can't work out a way of the data set knowing which value has been chosen to allow it to calculate a percentage based on *other* responses.

       

      I'd appreciate any help you might be able to offer. Thank you,

       

      Dan.

        • 1. Re: Some form of dynamic parameter?
          Kathryn Bridges

          Hi Dan,

           

          This sounds like a complex workbook. Could you post it here so we can better understand your fields and filters/parameters?

           

          In the meantime, I'm wondering if you can use the filters you have (Year/Sector), have a sheet that shows responses, and then use an action filter on that sheet to show the chart breakdown by gender.

           

          An example with Superstore data is attached.

           

          Thanks

          • 2. Re: Some form of dynamic parameter?
            Guillermo Mendez-Kestler

            I agree a workbook with an example would be helpful to see what you're doing. Here's my guess at what you're attempting, let me know if I got it right.

            You're basically looking for a way to get a dynamic filter option based on the sector selected. Using a simple example

             

            We've got two sectors: sports and books

            • Sports have improve health and socialize as responses
            • Books have de-stress and learning as responses

            If you select sports as the option you want to have the options of either improve health or socialize. Likewise books will have the book responses instead of the sport responses.

             

            If that is what you're looking for then here's an option of what you can do.

            1. Create a string parameter with the sectors as the option values. [Sector Selector]
            2. Create an IF formula inside a case statement that inputs the [Sector Selector] and outputs a filtered response option. [Response Options]

            IF [Sector] = [Sector Selector] THEN [Responses] END

               3. Use [Response Options] as the filter with [Sector Selector] visible.

             

            Hopefully this will help get you started.

            • 3. Re: Some form of dynamic parameter?
              Dan Harrison

              Below is a sample workbook.

              Tableau Public

               

              But I've now solved the problem using LODs. I didn't realise that LODs operate at a lower level than context filters.

               

              There's an amazing video by Bethany Lyons that can be accessed from here:

              Virtual Tableau Conference Registration

               

              And a summary article here:

              LODs of Fun with Jedi Filters | Tableau Software

               

              Thanks, all.

               

              Dan.

              • 4. Re: Some form of dynamic parameter?
                Guillermo Mendez-Kestler

                Nice job getting it solved yourself. *virtual high five*

                 

                Based on your Tableau Public workbook I’m guessing you ended up
                with something like this:

                LOD Solution.png