7 Replies Latest reply on Aug 11, 2016 2:16 PM by Joe Oppelt

    Top n + empty columns

    Sven Halvorson

      Hi there, thanks for reading this.

       

      I have a viz that I want to show data from the most recent 4 years (top n filter) but would also like to show empty columns so my table looks consistent and uses the space appropriately. If 'show empty columns' is on, tableau wants to show the columns that were cut by the top n filter.

       

      Anyone have a workaround to this?

       

      Unfortunately I can't share a workbook because it's protected information.

        • 1. Re: Top n + empty columns
          Joe Oppelt

          Check out this post:

           

          Anonymize your Tableau Package Data for Sharing

           

          Hack up an example that lets us work with something concrete.  You'll get a working example back that you can replicate in your actual workbook.

          • 2. Re: Top n + empty columns
            Sven Halvorson

            I can't replicate it sadly. My simple example (attached) is functioning as I had hoped. Here are deidentified screen caps of the problem. As you can see, I'm filtering by top 2 and it's showing me 4 years. It does show only 2 years when I deselect the 'show empty columns' function under analysis. Doesn't make any sense to me ><

            cap1.PNG

            cap2PNG.PNG

            • 3. Re: Top n + empty columns
              Joe Oppelt

              I guess I just don't understand what you DO want it to show.  You've selected "Show empty columns" yet you're saying you don't want to see empty columns...

              • 4. Re: Top n + empty columns
                Sven Halvorson

                I only want it to show the most recent two years regardless of whether or not there is data from those years.

                 

                The reason that I'm asking about this is because the data will be filtered according to a username so it will be highly variable in terms of what is present or not. The problem is that if the current user has no data from one year, the table gets smushed down to only that year. I thought 'show empty columns' would fix that but it seems to be taking precedent over the year filter.

                • 5. Re: Top n + empty columns
                  Joe Oppelt

                  OK, and looking at the example you gave, if I also add a filter for [Name] and select "Y", without the "show Empty Columns" I would see only year 4, but with "show empty" I see both 3 and 4.

                   

                   

                  And that's what you expect, but somehow in your actual workbook all 4 years come out with "show empty" even though there is a filter for the year that should only allow the last 2 years.


                  Am I understanding this correctly?

                  If so ... regarding the filter for year ...  Is it perhaps a table calc instead of a quick filter?

                  • 6. Re: Top n + empty columns
                    Sven Halvorson

                    Yes, that is exactly right; all 4 years show up even though I am filtering off the top 2.

                     

                    There is no table calculation involved for the year although it is filtered by top 2 of MAX(year).

                    • 7. Re: Top n + empty columns
                      Joe Oppelt

                      The sample workbook is filtering by MAX(year) too.

                       

                      That's why I want to see the problem in a workbook.  Something else is different from the vanilla example we're looking at here.

                       

                      Go to the link I first posted.  It's a 10 minute video showing how you can anonymize your data.  You put enough records into an excel file, delete out unneeded columns, change the data where necessary (and if you don't have a ton of rows, that's pretty easy to do), and create a stripped-down version of your actual workbook.  (You do a "Replace DataSource" to use the new excel version.)  We don't need the full workbook.  Delete out all the other dashboards and sheets.  Delete out unneeded variables.

                       

                      Otherwise, I just don't know what to suggest.