2 Replies Latest reply on Aug 28, 2018 7:59 AM by Grégory Dupuy

    Define a filter base on a set of dimensions from 2 database

    Grégory Dupuy

      Hello,

       

      I am facing an issue. I must admit i am a bit new on Tableau and i couldn't find the answer on the forum. I thought about creating a "set" but still not success in my tests.

       

      I have 2 databases with a joint on one dimension.

       

      The main database is where i want to build by report.

      On the first database i have the "Status" dimension with for example 3 status (A, B and C)

      On the second database i have another dimension "Situation" with for example (4 values : W, X, Y and Z)

       

      I want to create a dimension on my first database being able to filter on Status A and only B and C with values Y and Z.

       

      Thank you very much for your support !!

       

      Greg

        • 1. Re: Define a filter base on a set of dimensions from 2 database
          Ben Neville

          So if you think about this, the ONLY way I can see to get a unique sub-selection whereby you could get ALL values for A, and only the Y and Z values for B and C: join the 2 fields to keep a unique combination. Either use Tableau's native Combine Fields option, or create a calculation that is:
          [Status] + ' - ' + [Situation]

           

          This should give you a list of fields that are something like:
          A - W
          A - X

          A - Y

          A - Z

          B - W

          B - X

          ...

           

          Certainly more tedious, but if you want to allow truly dynamic selection from each of these lists, and you don't know what your user is likely to want, that's the approach I'd go with. If you can predict the few selections I'll make (let's say limited only to the combinations in your example), this would be something like:
          IF [Status] = 'A' THEN 'A'ELSEIF [Status] = 'B' OR [Status] = 'C' THEN [Status] + ' - ' + [Situation]

          END

          • 2. Re: Define a filter base on a set of dimensions from 2 database
            Grégory Dupuy

            Hello, thank you for your feedback, i tried to create a new dimension with the suggested calculation.

             

            I received the following error message:

            "impossible to combine agregation arguments with non agregation arguments within the function"

             

            When i tried to create a new dimension to concatenate the 2 fields i got the same:

            [Statut]+ ' - ' + ATTR([Database2(ExportFile)].[Situation])

             

            Is it linked to the ATTR function ?

            Thank you for your support