3 Replies Latest reply on Oct 7, 2016 7:30 AM by Simon Runc

    Hide category based on presence of data

    Jason Hamer

      Hi all,

       

      I have attached an example of what I am working with here using the superstore dataset.

       

      In this example I am benchmarking profit by subcateogry between two states. However, I only want the subcategory to display when the state Delaware has any profit (positive or negative) in that subcategory (regardless of what is happening with the other state). This needs to be dynamic for when I update the segment and ship mode filter, so that the only subcategories which ever show have Delaware data.

       

      I assume the answer is some sort of filter by formula based on subcategory, but I just can't figure out how to create a formula which aggregates by Delaware only!

       

      Any help would be appreciated!!!

        • 1. Re: Hide category based on presence of data
          Simon Runc

          hi Jason,

           

          So hopefully this does the trick for you...

           

          I've created a Table Calculation, which uses compute using [State] to COUNTD the number of States for each Sub-Category. I then make this into a T/F filter, where it's true when that count = 2.

           

          [Only Show Comparable Sub-Cats]

          WINDOW_SUM(COUNTD([State]))=2

           

          Hope that helps, and makes sense.

          3 of 3 people found this helpful
          • 2. Re: Hide category based on presence of data
            Jason Hamer

            Thank you Simon. Not having done anything with table calculations before, it took a bit of research to figure out how they work before I could replicate the answer. But I eventually got it working on my own data! Looks like I have some more learning to do to use these effectively...

            • 3. Re: Hide category based on presence of data
              Simon Runc

              hi Jason,

               

              Excellent stuff...yes they (Table Calculations) took me a while to get my head around, but are a very powerful feature of Tableau. They are certainly easier with the new Tableau 10 Table Calculation set up dialogue box

               

               

              which has also helped my understanding of them, as the Viz "live updates" as you select different compute-using...etc.

               

              Although a few years old now, I'd suggest taking a look at the 3 TDT on Table Calculations

               

              The specified item was not found.

               

              They are near the end called "Setting Up for Table Calculation Sucess" , "Table Calculation" and "Table Calculations round 2). I found these really useful for understanding the "concept"