1 Reply Latest reply on Oct 30, 2012 4:14 PM by Tracy Rodgers

    1:N Joins in Tableau

    Philip George



      I have a two tables like below.


      Table A                                                                 Table B

      ----------                                                                -------------


      Emp ID          Name            Job        sal                         

      213               Ram              AB        1000                 EmpID      Address     Product_purchase

                                                                                     213           loc1                    prod1

      123               Sam               BC       2000                  213          loc1                      prod2

      124               Tom               AB        1500                 123          loc2                    prod3

      125               Nam               DF        500                  124          loc3                     prod4

                                                                                    124         loc3                    prod5

                                                                                   125         loc4                     prod6

                                                                                   125         loc5                    prod7



      If I make a join between these two files using Emp ID 1:N join will happen and there will be more number of rows in the resultant dataset.

      like below.

      Emp ID          Name            Job        sal       tableB_EmpID      Address     Product_purchase

      213                   Ram          AB        1000          213                    loc1          prod1

      214                    Ram          AB        1000          213                    loc1          prod2






      My query is if use only fields from table A when I do the reporting.


      keeping sum(sal) on test shelf and Job on the rows shelf.


      output will be

      job          sum(Sal)

      AB        5000   



      But this is wrong.What I will expect is


      job     sum(sal)

      AB     2500


      Is there any way to correct this.Is this because of1:N join.