3 Replies Latest reply on Jan 23, 2013 8:45 AM by Susan Anderson

    Double counting issue

    Assaf Milman

      I'm having trouble dealing with 2 tables in my sql server DB.

      The first table holds a list of customer orders. Fields in that table are the Order ID, total deal amount, and state inwhich the order was taken.

      Second Table stores the products in EACH order. The fields in that table are Order ID, product ID and order quantity.

       

      I wish to display on the same dashboard a barchart of the total sales  per state, and display another view of product total sales in the various states.

      The trouble  is that when I join the tables, I get a double counting problem: the total order amount is duplicated because it appears  next to every product  in the joined table... (product which was of course at that order)

       

      I tried using data blending, but to no avail. Tableau's complaining that I'm trying to blend data from the same data source. Makes sense..

      Is there an easy way to deal with this issue in Tableau or does it require some custom SQL?

      Thanks in advance,

      Assaf

        • 1. Re: Double counting issue
          Susan Anderson

          I replicated this but with 2 basic excel sheets and the data blending worked, could an idea be to try some custom SQL to join your 2 tables even if just to test?

          1 of 1 people found this helpful
          • 2. Re: Double counting issue
            Assaf Milman

            Thanks for the quick response.

            You're right - it works in excel.

            But...Let's say I add another field to the first table - State (the state where the order was taken),

            and I want to see two things:

            Total sales per state AND quantity of each product sold in each state.

             

            I get can't to see the quantity of products sold in each state, as Tableau says that there's no linking field. That's correct, OrderID is actually the linking field between the 2 tables, and State only exists in the first table. Any way to get it done with data blending?

            thanks...

            • 3. Re: Double counting issue
              Susan Anderson

              I should point out I am using the Version 8 Beta 6 desktop version..  Wonder if that makes a difference?