8 Replies Latest reply on Nov 18, 2018 9:27 PM by amar savale

    Filter by multiple columns in dimension table

    Taylor Grayson

      I have a dropdown filter on a dashboard that displays, for instance, "category", which is a text field. However, the dimension table it draws from also has an additional column called "Year" that I want to filter on when the associated category is selected. This additional column value will be applied to a different field in the underlying data source. What approach do I take to make this happen? (or, what can I Google on to figure this out?)

       

      Thanks

        • 1. Re: Filter by multiple columns in dimension table
          Jennifer VonHagel

          Hi Taylor, could you post a Tableau Packaged workbook with sample data that demonstrates what you're trying to do?

           

          If you want only the years associated with the selected Category to show in the Year filter, then in the Year filter choose "Only Relevant Values".  I get the sense you're looking for more than that but am not quite catching what you mean to happen.

           

          Best,

          Jennifer

          • 2. Re: Filter by multiple columns in dimension table
            ShivaRam Chennapragada

            Without actually looking at data it is difficult answer. Here's what I understood, you have two dimensions - Category and Year. When you select a particular category only relevant years should populate in the Year filter, correct? If so, set Year filter to show "Only Relevant Values". If this doesn't work, please mock up some data and attach a packaged workbook or at least screenshots.

            • 3. Re: Filter by multiple columns in dimension table
              Taylor Grayson

              Jennifer, thank you. There is no "year' filter, there is only a category filter, but the category dimension table contains many columns that could be used to filter data. For instance:

               

              Category_key      Description          Year_key

              1                          Period 1                  2017

              2                          Period 2                  2017

              3                          Period 3                  2018

              4                          Period 4                  2018

               

              I want a drop down on a dashboard to display "Period 1", but I wanted the data to be filtered by "2017".

              • 4. Re: Filter by multiple columns in dimension table
                Taylor Grayson

                ShivaRam, thank you. Please see my reply to Jennifer because she was asking for more info too. I come from a software development background, so what I want to do seems obvious to me, but I can't see a way to do it in Tableau. I wish I could just write the code and skip this UI stuff. :-)

                • 5. Re: Filter by multiple columns in dimension table
                  Jennifer VonHagel

                  Hmm, ok, I'm still not quite following.

                   

                  Do you have two data sources? one that is a fact or aggregate table maybe that has Category Key or Description, and another dimension table as listed above? Are you asking how to join so you have access to the dimension columns to use them to filter?

                   

                  Or do you already have access to the dimension columns in Tableau, and you want this to happen, for example:

                   

                  Category_key or Description is showing in the view, a dropdown box has the Description values which the user can select. If a user selects "Period 1", the view will be filtered by the corresponding Year, which is 2017, meaning the view will actually show Period 1 and Period 2 since they are both associated with Year 2017?

                   

                  Best,

                  Jennifer

                   

                  P.S. I hear you about just writing code. Ages ago I learned SQL because I couldn't handle the restrictions our then GUI-based reporting tool created (before Tableau's time). Not that I write software code, but just flipping data around exactly the way I needed in SQL was extremely liberating.

                  • 6. Re: Filter by multiple columns in dimension table
                    Taylor Grayson

                    "Category_key or Description is showing in the view, a dropdown box has the Description values which the user can select. If a user selects "Period 1", the view will be filtered by the corresponding Year, which is 2017, meaning the view will actually show Period 1 and Period 2 since they are both associated with Year 2017?"

                     

                    This is close. I want to filter by "Period 1" and use the "2017" as a filter for another column. I know I could have two filters, but I don't want the user to have to select from two dropdowns to supply information that could logically be derived from one. I basically want two filters for the price of one. :-)

                     

                    I apologize for being unclear.

                     

                    (Since I posted the question, it occurred to me that I might be able to handle the Year in the join, but I'm not sure whether this would hurt the flexibility of the data source to serve other purposes. I'll have to experiment)

                    • 7. Re: Filter by multiple columns in dimension table
                      Jennifer VonHagel

                      Hi Taylor,

                       

                      I think I get what you're saying, but need a more concrete idea of the end view you wish to create.

                       

                      Can you attach some sample data in a packaged tableau workbook that gets close to what you want?

                       

                      So in the same table or chart, you'll have one column which is filtered on category, and a second column implicitly filtered on the selected category's associated year. What is the second column? A measure, or a dimension? I think we need the bigger picture of what you're trying to create to give specific help in the way of calculations or view set up.

                       

                      Best,

                      Jennifer

                      • 8. Re: Filter by multiple columns in dimension table
                        amar savale

                        Hi,

                        Please find the below attachment marked as Correct or Helpful to close the thread.

                         

                         

                         

                         

                         

                        Thanks,

                        Amar D. Savale