5 Replies Latest reply on Feb 19, 2013 10:33 AM by Jonathan Drummey

    Passing a selected list to a secondary query - how to?

    Dan Gerena

      I have a dashboard with 2 tables on it. Table I comes from connection A, and returns a list of job codes and respective hours worked based upon the date range and departments the user specified.

       

      Table II uses a different connection, but the goal is for it to return a summary of the jobcodes that Table I returns, but for a forward looking forecast that I pull from a totally different underlying data source than Table I.

       

      So my present way to make this happen is to setup an Action where I lasso the jobcodes from Table I and then run the Action (from the menu). Is there a way to accomplish this without having to make the user run this 2 step process?

        • 1. Re: Passing a selected list to a secondary query - how to?
          Jonathan Drummey

          There are at least a couple of ways to do this:

           

          - One is to change your Filter Action to run on Select or even Hover, that would make it a one step process.

          - Another is to set up a scaffold data source (a data source that has the necessary level of detail to act as a master to both tables) and use that to blend the data from the two tables at the proper level of detail, then you could use criteria from Table I to filter Table II. Sometimes you can also do this by building a query that turns either Table I or II into the scaffold source. This could let you have one worksheet that covers both tables.

          - Wait another month or two for Tableau v8 and use a data blend there, it mostly removes the need for scaffold data sources for situations like this. Not knowing the exact details of your situation I can't promise whether you'd need to do any scaffolding or not.

           

          Jonathan

          • 2. Re: Passing a selected list to a secondary query - how to?
            Shawn Wallwork

            Morning Jonathan. Could you expand on this comment:

             

            - Wait another month or two for Tableau v8 and use a data blend there, it mostly removes the need for scaffold data sources for situations like this. Not knowing the exact details of your situation I can't promise whether you'd need to do any scaffolding or not.

             

            I spent a good bit of time last night experimenting with Joe's scaffolding technique. I'm curious what changes you're seeing in V8 that will replace the need for scaffolding. Just to be clear, I am genuinely interested, this is not a challenge (or 'loaded' question).

             

            --Shawn

            • 3. Re: Passing a selected list to a secondary query - how to?
              Jonathan Drummey

              That's the subject of a blog post for next week. Here's the quick version:

               

              In v7, you can only filter on aggregations of the data in the secondary like ATTR(), COUNT(), SUM(), etc. This means that for a filter to work on individual dimension values from the secondary then the view needs to be built with those secondary dimensions in the overall level of detail, which probably means all sorts of fun with table calculations to get the desired results since the blend is happening at a finer level of granularity and the calculations need to aggregate to a coarser level of granularity.

               

              In v8 Tableau does some behind-the-scense densification magic and you can now filter on individual non-aggregated dimensions from the secondary. This gives you full access to discrete dimension values, date ranges, etc. Combined with the other new blending feature of not needing linking fields in the view, this can make blending much simpler to accomplish and views more maintainable because they don't require so much table calculation gymnastics. It's pretty spectacular and I've been working on a post about it for awhile now, more than any other feature in v8 it's going to make my day job easier.

               

              Jonathan

              • 4. Re: Passing a selected list to a secondary query - how to?
                Shawn Wallwork

                Cool, can't wait! So this means no more of the dreaded  *  from secondary data sources? That will be great. I'll have to play with this a bit more. Thanks,

                 

                --Shawn

                • 5. Re: Passing a selected list to a secondary query - how to?
                  Jonathan Drummey

                  It's still possible, but takes a bit more work to get to.