1 Reply Latest reply on May 15, 2015 1:36 AM by Simon Runc

    Sum_product

    Arihant Jain

      Hi All,

       

      I am new in tableau and want some help related to sumproduct function in tableau.

       

      Sumproduct Formula in use in Excel:

      1.) =sumproduct(Amount in USD*Payment Days)/Sum(Amount in USD)

       

      2.) =Sumproduct(--(A2:A1000 ="January"),--(B2:B1000="Supplier Name"), (Amount in USD*Payment Days)/Sumproduct(--(A2:A1000="January"),--(B2:B1000="Supplier Name"), Amount in USD)

       

      I believe 2nd Formula can be done with filter function if I can create 1st formula in tableau.

       

      I have attached the data with all the required filed. Please help me how to create such formula

       

      Thanks

      AJ

        • 1. Re: Sum_product
          Simon Runc

          hi Arihant,

           

          So to get the SumProduct, the formula is actually very similar to the one you've posted!

           

          So from your attached the formula in Excel is

           

          =SUMPRODUCT(D2:D64*E2:E64)/SUM(D2:D64)

           

          and for all rows (unfiltered) this is 56.8

           

          In Tableau the formula is;

           

          SUM([Amount in USD]*[Payment Days])/SUM([Amount in USD])

           

          As you say you can then use a quick filter to just look at January, for a particular supplier (as per the attached).

           

          Hope this is what you were after, but if not please post back