5 Replies Latest reply on Jul 25, 2017 4:52 PM by Derek Wong

    Removing Duplicates in filter

    rajesh.nomula.0

      Hello Friends,

       

      I have certain names in my Dimension. It have many Duplicate names in the column. I want to apply this dimension to filter. How to eliminate repeating Names in tableau.

       

      Thanks,

      Rajesh

        • 1. Re: Removing Duplicates in filter
          Wilson Po

          Hi Rajesh,

           

          Tableau typically only display distinct members for filter selections - is there anything that make the duplicates names potentially unique and distinct?  You might try to apply a TRIM() function on the dimension if you suspect there are more space characters that are causing the duplicates to appear.  Is there a screenshot or workbook you can share?

          • 2. Re: Removing Duplicates in filter
            rajesh.nomula.0

            Hi Wilson,

            Please find the Screenshot. I have Campaign name filter like this. I want remove duplicate Campaign names as shown, there are many in the drop down. I have removed the Years at the end of the campaign names. Don't want them to repeat. How can i do that.

             

            Regards,

            Rajesh

            • 3. Re: Removing Duplicates in filter
              Derek Wong

              Rajesh,

               

              I believe you can do this by making a new calculated field and a long IF statement, something like this:

               

                        IF [Campaign Name] = "Animal Health"           THEN "Animal Health"

              ELSEIF [Campaign Name] = "Animal Health 2014"  THEN "Animal Health"

              ELSEIF [Campaign Name] = "Animal Health 2015"  THEN "Animal Health"

              ELSEIF [Campaign Name] = "BioProduction 2015"  THEN "BioProduction"

              ELSEIF [Campaign Name] = "BioProduction 2016"  THEN "BioProduction"

              ...

              ...

              ELSE [Campaign Name]

              END

               

              Of course, this will require you to list every single possibility, which could get cumbersome over time or if you have a lot of data. If your naming conventions are simple, it might be easier to add in a "search" function like CONTAINS(), which will allow you to group many "like" terms. For example, instead of listing out all the years, you could simplify the above to:

               

              IF CONTAINS( [Campaign Name] , "Animal Health" )   THEN "Animal Health"

              ELSEIF CONTAINS( [Campaign Name] , "BioProduction" )   THEN "BioProduction"

              ...

              ...

              ELSE [Campaign Name]

              END

               

              Let me know if you have issues with that--if you require more help, it may be easier if you post a packaged workbook.

               

              Derek

              1 of 1 people found this helpful
              • 4. Re: Removing Duplicates in filter
                rajesh.nomula.0

                Thanks Derek,

                 

                I tried its working.

                 

                Cheers,

                Rajesh

                • 5. Re: Removing Duplicates in filter
                  Derek Wong

                  Sweet!

                   

                  If that works for you, you can mark my answer as "correct" and it'll close the thread.

                   

                  Cheers!

                   

                  Derek