3 Replies Latest reply on Nov 29, 2018 5:30 AM by Zhouyi Zhang

    Filtering bubble graph

    João Completo

      Hi all,

       

      I wonder if it is possible to have a filter that when applied to the displayed information shows only the bubbles that have the selected category? For example, if I select category c1, I want to show all the category bubbles that in one idEp have categoryCod = c1 (but exclude the bubble for c1). Plus, if I also select to filter c5 the graph needs to show the bubbles that in one idEp have categoryCod = c1 but also have categoryCod = c5 (but exclude the bubble for c1 and c5), with these two filters selected the graph should now show one bubble with category c4 (with count = 1) and one bubble with category c2 (with count = 2).

       

      I know how to create this effect using MySQL with the following query:

       

      SELECT

        *

      FROM

        table_test_bubbles_tableau_category AS tc

          INNER JOIN

        (SELECT

          tc1.idEp

        FROM

          table_test_bubbles_tableau_person AS tp

        INNER JOIN table_test_bubbles_tableau_category AS tc1 ON tp.idEp = tc1.idEp

        INNER JOIN (SELECT

          *

      FROM

          table_test_bubbles_tableau_category

        WHERE

          categoryCod = 'c1') AS result ON tc1.idEp = result.idEp

        WHERE

          tc1.categoryCod = 'c5') AS result ON tc.idEp = result.idEp;

       

      But I am having difficulty replicating this effect on tableau.

       

      Thanks in advance,

      João

       

       

        • 1. Re: Filtering bubble graph
          Zhouyi Zhang

          Hi, Joao

           

          To achieve your requirement, you need two parameters with value of category.

           

          below is the calculation and parameter, and sample output for your reference. workbook attached as well.

           

           

          Hope this helps

           

          ZZ

          • 2. Re: Filtering bubble graph
            João Completo

            Hi Zhouyi Zhang,

             

            Yes, this helps a lot! Thank you very much.

            I have two more other questions related to this problem that I like to know if Tableau is capable of doing.

            First, can the filter be added dynamically? For example, now I have two parameters but at some point, I want to filter with three parameters. In that case, do I need to create three filters for doing that, or can I have Tableau creating a new filter field every time I use the last available filter. I’m thinking about something like choosing the first category to filter, the view changes and a new filter field appears with the new values that can be filtered, and so on.

            Secondly, is it possible the filter action be applied when I select one of the bubbles, instead of using filters traditionally?

             

            Thanks in advance,

            João

            • 3. Re: Filtering bubble graph
              Zhouyi Zhang

              Hi, Joao

               

              To your questions, if these are somethings that from user requirements, I will suggest to reshape your data from query/etl rather than using tableau as this solution is purely trying to interpret your query to tableau, and I understand it is not a nice way, but this is the only way.In terms of better interactive user experience, I recommand restructuring your data in a better way (it may bring some redudency and dulplication, but easier)

               

              ZZ