3 Replies Latest reply on Jan 13, 2017 8:28 AM by Santiago Sanchez

    Customer Group Filter

    hiten.anand

      Hi,

       

      I have created a calculated field (Top 10 customers) which will be used in a Parameter in order to filter across multiple data sources in a dash board.

       

      The field currently  uses IF ELSEIF condition statements something like this

       

      IF CONTAINS([Customer]. UPPER('OMER 1') THEN 'CUSTOMER 1'

      ELSEIF CONTAINS([Customer]. UPPER('OMER 2') THEN 'CUSTOMER 2'

      ELSE 'OTHERS'

      END

       

      I am now trying to change this logic so that I also have a 'Top 10 Customer' option that the user can select, I know that I can do this by making this a multi value selection but was wondering whether there was a way I can do it so that the user only has to select one entry.

       

      Thank you

        • 1. Re: Customer Group Filter
          Santiago Sanchez

          Hi Hiten,

           

          Interesting challenge! I don't think you can mix both conditions (Top N & Groups) in the same calculated field because you can potentially have customers that fit on both sides, thus generating incorrect results if you only select one option.

           

          That said, you may be able to do achieve something similar using a parameter and a couple of calculated fields:

           

          1. First, create a parameter that lets the user pick between seeing results by 'Customer Group' or by 'Top Customers'. Let's call it [See by:]

          2. Create a dynamic set of Top N customers. Let's call it [Top Customers by Profit]

          3. Create a calculated field that will display either a [Customer Name] or a [Customer Group] based on the parameter selection. Let's call it [Selected Option], we'll place this on Rows.

          4. Finally, let's create another calculated field that we'll use as a filter. This will limit results to Top N customers only when the parameter is selected to show 'Top Customers'. Let's call it [Selected Filter], drag to filters and set it to TRUE only.

           

          A working example is attached. You can potentially add another filter for [Customer Group] but then the user will have to make 2 selections.

           

          Hope this helps!

          • 2. Re: Customer Group Filter
            hiten.anand

            Hi Santiago,

             

            Thanks for your feedback.  I went with a two parameter approach one as you said is a group of the Top-N.

             

            Wishing you all the best

            • 3. Re: Customer Group Filter
              Santiago Sanchez

              Glad to hear it worked, Hiten! All the best to you too.