4 Replies Latest reply on May 18, 2016 4:27 AM by Prateek Gupta

    Calculate based on date range

    Prateek Gupta

      I have two tables, in this format

      table 1:

      Seller
      MarginDate From

      A

      20%

      1-Apr-16

      B10%10-Apr-16
      B20%1-May-16
      B30%10-May-16

       

      Table 2

      SellerOrder DateSale Value
      B

      8-May-16

      1000
      A20-May-162000

       

      When I join these, I am trying to get commission value for each seller. Seller is not an issue, for seller B:

      I need the calculation to be 1000*20% = 200.  (20% margin was applicable for all orders from 1st may to 10th May)

       

      Can someone please help me on how to go about this in tableau ?