4 Replies Latest reply on Jan 11, 2017 6:23 PM by Chris Hopkinson

    Setting a calculated field based on an imported date range

    Cameron Runyeon

      I currently have a list of orders that I am importing into Tableau.  Each order has an Order Date.  Normally, we sort the orders into Periods based on goals reached, etc.  I have no way of knowing when the goals will be reached, so the period dates are kept in an Excel document then manually added.  So the spreadsheet ends up looking like:


      PeriodStart DateEnd Date
      Period 11/1/20155/25/2015
      Period 25/26/201512/3/2015
      Period 312/4/20156/8/2016



      How can I import that list into Tableau, then create a calculated "Period" tab in the order data so that it automatically calculates the period for each order based on where the order date falls in the ranges above?


      So, ideally the order filed would look like...

      Order Number
      Order DatePeriod (Calculated Field)
      13/5/2105Period 1
      22/5/2016Period 3
      37/12/2015Period 2


      What is the best way to import the period date ranges from Excel, and how would I write a formula to calculate the Period column in the order data?


      Thank you for your help!