7 Replies Latest reply on Oct 25, 2018 11:26 AM by Devin Lavelle

    Select from two groups by parameter value

    Devin Lavelle

      Hi all,


      Appreciate any help y'all can offer.


      I am creating a dashboard looking at data by legislative district. I have a parameter to select Assembly/Senate and based on that want the user to then be able to select from only Assembly or Senate districts.


      This would be simple enough to do with a filter, but I don't believe it will work for the filter to apply at this point because I also need functions to select non-district comparisons. If parameters were dynamic, that would work perfectly, any workarounds?



        • 1. Re: Select from two groups by parameter value
          Joe Oppelt

          I'm having a hard time following your description.


          Today at the Tableau Conference 2018 they demonstrated new functionality in 2018.3. It's called "set actions."


          If you can't upgrade before you need to implement what you need, you might be able to limit the filter values using "relevant values".  Or you could actually create two separate sheets and swap the based on the parameter value.


          An actual sample workbook would help me understand better what you need to do.

          • 2. Re: Select from two groups by parameter value
            Adrian Slade

            I might be mis-understanding your question (and american politics) but if I do understand the question you have an Assembly field & a Senate field for each given row and you want the user to first choose between the Assembly or Senate then be able to filter based on the values from either of those fields.


            Create a Paremeter called something appropriate, i will use "Level" here. As a string with list of values for Assembly & Senate


            Create a calculated field like:

            iff([Level] = 'Assembly',[Assembly], iif([Level] = 'Senate',[Senate], {here handle the non-district comparisons you mentioned}))


            Show the Paremeter Control

            & Add the calculated field as a filter.

            • 3. Re: Select from two groups by parameter value
              Peter Fakan

              Hi Devin,


              Just throwing this out there, you can also do a combination of the two - ie have the Assembly as a Parameter, and then have Senate as a filter.


              They both look the same when you put them on a dashboard, however the senate filter you can then select 'show only relevant values' and keep the Assembly as a switch.





              • 4. Re: Select from two groups by parameter value
                Devin Lavelle

                To add some detail:

                The way this is supposed to function is:


                Field 1: User selects Assembly or Senate


                Field 2: Based on Field 1, user is offered either Assembly Districts 1-X or Senate Districts 1-Y and selects one of those districts.

                (The function needs to limit the field to the relevant districts without filtering out non-district level data -- county, state, etc)


                In Background: Based on the selection in Field 2 and pre-defined comparisons elsewhere, the system filters to the district selected, several nearby districts, the county the district is in & the state.


                Field 2 is the part I'm having trouble with.

                • 5. Re: Select from two groups by parameter value
                  Devin Lavelle

                  Thanks Joe, swapping sheets might work, I'll play with that.

                  • 6. Re: Select from two groups by parameter value
                    Joe Oppelt

                    The "set action" stuff coming in 2018.3 would take care of this for you.


                    For now, though:  When you select Senate or Assembly (that would be a parameter), then you can display one of two other parameter lists:  one for Senate districts, or one for Assembly districts.


                    Parameters limit you (for now) though, in that parameters are only single-select creatures.  If you want your user to select ONLY ONE (or ALL) districts, then a parameter solution can work.  You might not need separate sheets.  You could probably handle it all through calcs.


                    2018.3 set actions would also allow multi-select lists.  And yes, they would work like parameters, so we can have the functionality of multi-select parameters once we get access to that new feature!

                    • 7. Re: Select from two groups by parameter value
                      Devin Lavelle


                      Did they say when 2018.3 is coming?

                      Never mind, it's out! Let me bug IT ...