3 Replies Latest reply on Apr 10, 2018 6:24 AM by Deepak Rai

    Create a choice and select customers who product A along with other products

    sirisha putta
      Header 1Header 2Header 3Header 4Header 5
      customer_idprod 1prod 2prod 3prod 4
      aaa076087
      bbb67009
      ccc7556780

      I have  above table and I want create a dropdown (filter)list for all the items so user can select the product.Then I would like to display customers who bought the selected product and other products.

      Ex:The drop down list should include prod1,prod2,prod3 and prod4

      Now, if I select prod1 then the result should be

      Header 1Header 2Header 3Header 4Header 5
      customer_idprod 1prod 2prod 3 prod 4
      bbb67009
      ccc7556780

       

      similarly if I select prod3.I should be able to see below

      Header 1Header 2Header 3Header 4Header 5
      customer_idprod 1prod 2prod 3 prod 4
      ccc7556780

      I tried this query.But not getting the desired result and it is working only for if condition and rest of else if condition isn't properly working.

      if{FIXED [Customer]: SUM([Prod 1]) = 1}

      AND

      {FIXED [Customer]:  SUM([Prod 2]) + SUM([Prod 3]) + SUM([Prod 4]) > 1}then "Select customer who bought Prod 1 "

      else if

      {FIXED [Customer]: SUM([Prod 2]) = 1}

      AND

      {FIXED [Customer]: SUM([Prod1]) + SUM([Prod3]) + SUM([Prod 4])  > 1}then"select customers who bought Prod 2"

      :

      :

      :

      end

       

      Your help is greatly appreciated.Thanks in advance.