2 Replies Latest reply on Nov 14, 2012 11:32 AM by A J

    Filter on multiple values

    A J

      Hi all,

           New to Tableau. Quick question, I have a data table that contains the following data:

      CustomerProductHitCountYear
      AXDVD348

      2012

      DXDVD34872012
      DXDVD3872012
      AXDVD02011
      DXDVD02011
      KDFJK3882011
      KFJDS38782010

       

      Need to display only Customer that had Zero (0) ProductHitCount in 2011 and have ProductHitCount greater than 0 in 2012.

       

      Not sure how to approach. Any help is greately appreciated.

        • 1. Re: Filter on multiple values
          Tracy Rodgers

          Hi AJ,

           

          One way to do this is to create a calculated field similar to the following:

           

          if sum([ProductHitCount])=0 and max(Year)=2011 then 1

          elseif sum([ProductHitCount])>0 and max(Year)=2012 then 1

          else 0

          end

           

          Then, place this calculation on the filter shelf, and filter to 1.

           

          Hope this helps!

           

          -Tracy

          • 2. Re: Filter on multiple values
            A J

            That worked. Thanks Tracy!

             

            What if there was no related row. For example AXDVD has an entry for 2012 but not for 2011

             

            Need to display only Customer that had Zero (0) ProductHitCount in 2011 or no entry and have ProductHitCount greater than 0 in 2012.