1 Reply Latest reply on Aug 18, 2018 9:51 AM by Simon Runc

    VALUES GOING INTO NULL & UNIONS [URGENT]

    Daivik Mehra

      We are facing small issue in Tableau.

       

      Below are the two tables Table-1 , Table-2 with sample data.

       

       

      Table -1
      Year_MonthLocationCost_DescCost Value
      201806HYDComisionDiscount10
      201806KOLComisionDiscount20
      201806KOLComisionDiscount30

       

       

       

      Table-2
      Year_MonthLocationCustomer SegmentNetWeigt*QTY
      201806HYDloc11
      201806KOLloc24
      201806BLOloc12

       

       

      We have joined the above table using left join.

       

      As per the business requirement , we need to calculate the cost per unit by customer segment.

       

      The expected result are mentioned in the below table. We have filtered Cost_Desc as " ComisionDiscount" as per the business requirement.( In original data we have many Cost_Desc).

       

       

      Customer SegmentTotal Cost ValueNetWeigt*QTYCost Per Unit
      loc11033.33
      loc250412.5

       

       

      But we are getting  the cost per unit for the loc1   is 10 . the 3rd record is excluding in Table-2 because of Cost_Desc filter( there is no record with location MPD in Table-1).

       

      Could you please suggest any quick solution for this.

        • 1. Re: VALUES GOING INTO NULL & UNIONS [URGENT]
          Simon Runc

          hi Daivik,

           

          So not sure I fully understand...what columns are you joining on? is it Year_Month and Location?

           

          If so there is no location BLO in Table 1. If I choose a full outer join you can hopefully see what is going on

           

           

          It might be that this might be what you need...in that SUM(Cost Value)/SUM(NetWeight*QTY) with CustomerSegment in the Level of Detail (Column Shelf) will give you the result you want, but that might just be a bit of a fluke due to the limited 2 rows of data you've posted here.