6 Replies Latest reply on Feb 8, 2013 8:46 AM by David Kim

    Create a filter based on a range of data/values

    David Kim

      Hi Guys, hoping someone can help..

       

      In the attached image, I have a list of items in the 3rd column and its dimensions as the following columns.

      I need to create a filter that is based on a range of values for just one of the attributes, which are represented by each column.

       

      In this case I need a filter that will be able to exclude any items if its Avg Days is > 30 in the 1st Column titled' 01 - VND Enrich' in the image.

      I feel like there should be an easy way to solve this, can someone advise?

       

      Conditional filtering does not allow me to specify that I only want to look at values in a specific column.

        • 1. Re: Create a filter based on a range of data/values
          Joshua Milligan

          David,

           

          I'm not sure the image is enough to be able to give a concrete answer.  The best, and most likely to get a good quick answer, would be if you could post a packaged workbook.  At least if you could expand the image to include the fields in play it would help.

           

          Joshua

          • 2. Re: Create a filter based on a range of data/values
            David Kim

            Josh,

             

            Thanks for the reply, I posted an expanded image but not sure if I can post the packaged workbook for security reasons.

             

            As you can see the 3rd column shows the list of items.  I want to be able to filter out any item that has an Avg Day value over 30 in the column titled '01 - VND Enrich'. 

             

            I tried conditional filter but it does not allow me to specify that I only want to look at the Avg Day values in column '01 - VND Enrich'

             

            Any help would be GREATLY appreciated!

             

            - David

            • 3. Re: Create a filter based on a range of data/values
              Joshua Milligan

              David,

               

              The expanded image helps.  Here's my best guess:

               

              1. Create a calculated field with this code:

               

              (IF [DotcomGroupName (group)] = "01 - VND Enrich" THEN [Avg Days in WF] ELSE 0 END) > 30

               

              That will only evaluate the average days for the 01 - VND Enrich. 

               

              2. Then drag that field to the filters shelf and filter out anything where the value is true.

               

              If the  [Avg Days in WF] field happens to be an aggregate function (which I can't tell from the image), then the code might need to change to :

               

              (IF ATTR([DotcomGroupName (group)]) = "01 - VND Enrich" THEN [Avg Days in WF] ELSE 0 END) > 30

               

              Hope that helps!  Please let me know if it doesn't work or if you get stuck at any point.

               

              Joshua

              • 4. Re: Create a filter based on a range of data/values
                David Kim

                Thanks Josh, I created the calculated field using the second formula however Tableau is not allowing me to drag this to the filter field.

                • 5. Re: Create a filter based on a range of data/values
                  Joshua Milligan

                  David,

                   

                  That's a good point.  You cannot use a discrete aggregate calculation as a filter.

                   

                  However if you modify the formula to give you a continuous value, then you will be able to.

                   

                  Try:

                   

                  IF ATTR([DotcomGroupName (group)]) = "01 - VND Enrich" THEN [Avg Days in WF] ELSE 0 END

                   


                  • 6. Re: Create a filter based on a range of data/values
                    David Kim

                    I'm starting to think this is just a capability that will need to be requested.

                     

                    The above formula will only work if I'm showing the entire list of items.

                    In terms of presentation I don't drill down farther than the "DFM" column, and the filter only looks at the Avg of the current view.  So when I use that filter it eliminates any DFM from the view if their Avg is over 30, but I need to filter out Items over 30 then the Avg calculated on that.