0 Replies Latest reply on Oct 19, 2012 12:01 PM by Mark Lampert

    multiple joins creating duplicate rows

    Mark Lampert



      I am new to Tableau and am stumped on this situation:


      I have three tables in the same source: users, payments, and sessions.  I'd like to have users as the primary table, and then join payments, and also join sessions.  I end up with something like this (I've paired it down to the minimum columns/data needed):


      user_id (users)payment_id (payments)amount (payments)session_id (sessions)


      This is two users, with one payment each, but user 1 has two sessions whereas user 2 has one session.


      You can do a COUNTD(payment_id) to get the number of unique payments (2).  However, I can't figure out how to get the total payments ($15).  Is it possible to do a sum of unique payments?


      I could do a custom sql join and do a "group by", but the I would lose other data (ie. payments per day).   Data blending seems to be even more of a challenge. 


      Any ideas? 


      I've attached a Tableau workbook with  this example.