2 Replies Latest reply on Jan 18, 2015 11:46 PM by Jonathan Barberi

    How to get the dates between a startDate and an endDate

    Jonathan Barberi

      Hi all,

       

      I'm new to Tableau Software and I would like to know how to solve this simple problematic.

       

      I am connected on a datasource "contracts" with a contract start date and a contract end date fields.

       

      Using those two fields, I'm able to calculate month by month how many new customer I gain on a specific month using the contract start date, and the same for the number of customer lost on a specific month.

       

      By now, I want to track how many total customer I had on a timeline starting on a specific date up to today.

       

      But, the problem is that I don't know how to get all the months between the startDate and the endDate as a column ...

       

      Then, with this date field, I would be able to create a calculated field like :

       

      IF [contract start date] <= [aMonth]

      THEN

        IF ([contract end date] > [aMonth] OR ISNULL([contract end date])) THEN

          1

        ELSE

          0

        END

      ELSE

        0

      END

       

      To count how many active contracts I have on a month ...

       

      Maybe you can help me to achieve this !

       

      Regards

       

      Jonathan