9 Replies Latest reply on Aug 31, 2016 6:58 AM by Bastian S.

    How to combine filters

    Bastian S.

      Hi there,

      the basic problem I have sound quite easy, but I have no idea to implement it.

       

      I have to do some sales evaluations, regarding sales activities in a specific postal area (1. filter), sales activities in the country of a specific sales man (2. filter). These two filters should be comnined with AND.

       

      It is not possible to combine these two filters with a Set...

       

      Can anybody give me a hint how to combine these two filters?

       

      Regards from Germany

       

      Bastian

        • 1. Re: How to combine filters
          Philip Riggs

          You can create a combined field that contains both fields.

          Combine Fields from Tableau Online Help.

           

          Would this give you what you need?

          • 2. Re: How to combine filters
            David Li

            Hallo Bastian! In addition to Philip's suggestion, is there any reason why you can't just use two separate filters? That is, can you just put in a postal area filter and a salesman filter? Filters in Tableau are independent, which means that they behave like logical AND statements when used together.

            • 3. Re: How to combine filters
              Bastian S.

              Hi Philips, Hi David,

              thank you for your quick help.

              I built a combined field with these two fields. Now I'm trying to filter this field.

              The combined field looks like:  'Sales man A', 'postal code' It is a text field

              Now I'm trying to filter regarding two points:

              1.) All sales activities, which has happened within a specific postal code without sales man A. E.G.:  PLZ01, PLZ10, PLZ15

              2.) All sales activities, which has happened with the specific sales man A within all postal areas.

               

              When I'm trying to filter this combined field by a formular, it always says, that there should be string, string??

              Could you please help me to fill in the formula field with the filter?

               

              Many regards from Germany

              • 4. Re: How to combine filters
                David Li

                Hi Bastian, I think you're way better off using two separate filters, if at all possible. Combining them makes it considerably more onerous to do the search.

                 

                For instance, if you had two separate filters, for #1, you could just filter in a postal code (let's say PLZ01) in the postal code filter and then exclude the salesman in the salesman filter. For #2, you would just filter in the specific salesman with no postal code filter.

                • 5. Re: How to combine filters
                  Bastian S.

                  Hi David,

                   

                  If I want to filter in the combined field with a filter n a combination with a formula ( [combined field]='sales man A"), it says I'm not allowed to compare combined field and string values.

                  As you already mentioned, I tried to filter in two steps in this formula filter Editor.

                   

                  In the end it should be in one list...

                  • 6. Re: How to combine filters
                    David Li

                    Bastian, could you please either share a packaged workbook or paste the exact text of your combined field formula and whatever formula you're trying to use for the filter?

                    • 7. Re: How to combine filters
                      Philip Riggs

                      Hi Bastian

                       

                      I'm not understanding why you need a combined field for the two examples you listed above. I was able to answer the questions using only a single filter on the salesperson field.

                       

                      Can you give some examples of the questions you want to answer?

                      • 8. Re: How to combine filters
                        Bastian S.

                        Hi David, Hi Philip,

                        again thank you for your Patience and your help!

                         

                        Enclosed please find the attached sample workbook.

                         

                        Let's say we want to focus on sales man Mark. In the end I need the turnover of his sales area (e.g. PLZ01 to PLZ09) and his turnover when he was outside of his area (in this case e.g. PLZ75, PLZ74, PLZ85).

                         

                        I also tried to filter the combined field of 'responsible for Sales' and 'Postal area'. At the Moment there are all possibilities of variations in this filter list. So I could filter the table for the Moment, but for the future I have to fix it again and again with another new checkmarks.

                        My idea is to filter the combined field by a formula (filter in two steps as discussed before..), but it doesn't work..

                        • 9. Re: How to combine filters
                          Bastian S.

                          Hi there,

                           

                          I've got the solution:

                          I created two calculated fields for two mentioned filters. The result of this two filters was "yes" or "no". A third calculated field "turnover of the sales man" results "yes", if the two other fields are saying "yes".

                           

                          It's a bit complicated, but it works.

                           

                          Thanks for your help