1 Reply Latest reply on Nov 22, 2016 12:10 AM by Shinichiro Murakami

    Dates as a number count

    Tommy Campbell

      This is probably very basic, I want Tableau to calculate the number of days between 2 dates and assign a number to each respective date. For example 22/11/16 is Day 1 and 6/12/16 is day 11, this is working days. Thanks in advance to anyone who can help.

        • 1. Re: Dates as a number count
          Shinichiro Murakami



          The formula needs to be modified according to the "basis Date" (in this case 11/22/2016

          Anyways here is a concept.



          [Date End]    // adjust weekend

          if datename('weekday',[Date])="Saturday" then [Date]+2

          elseif datename('weekday',[Date])="Sunday" then [Date] +1

          else  [Date] end


          [Days between] // days exclude Sat, Sun

          [Date End]-date("2016/11/21")-int(([Date End]-date("2016/11/21"))/7)*2


          Put [Days between] to Dimension