2 Replies Latest reply on Oct 20, 2018 10:07 PM by Tushar More

    LOD Needed for Sale and Product IDs

    Stephen Groff

      Question:

       

      IF PRODUCT X was purchased, what were the top 5 items that were purchased along with that item?

       

      So I need a list of product IDs (have), sales IDs that coincide with that product id  (this list is an easy drag and drop)

       

      But how do I get a list of items purchased along with each item?

       

      I have [SALE ID], [PRODUCT ID], [ITEM NAME] & [QTY Purchased] as dimensions.

       

        • 1. Re: LOD Needed for Sale and Product IDs
          Ankit Bansal

          Stephen,

           

          You basically need to do a self join on sale ID. Let say your data s as below:

           

          sale id, productid

          1     , P1

          1     , P2

          1     , P3

          2     , P1

          2     , P3

           

          Now you need to join self join with this data on sale ID, Output will look like this:

           

          sale id, productid , other_productid

          1     , P1     , P1

          1     , P1     , P2

          1     , P1     , P3

          1     , P2     ,P1

          1     , P2     ,P2

          1     , P2     ,P3

          1     , P3     ,P1

          1     , P3     ,P2

          1     , P3     ,P3

           

          2     , P1     ,P1

          2     , P1     ,P3

          2     , P3     ,P1

          2     , P3     ,P3

           

          Now you can filter out the rows where product_id and other_product_id are same like create a calculated field:

          product_id=other_product_id

          put it on filter shelf and choose false.

           

          This should do the work for you.

           

          Thanks,

          AB

          1 of 1 people found this helpful
          • 2. Re: LOD Needed for Sale and Product IDs
            Tushar  More

            Not sure I have understood your question. Please check the attached.

             

            Tushar

            1 of 1 people found this helpful