title: Date Table Reorganize
body: <p>I need to do a transformation of a table and I don't know where to start. This is the table:</p>
  <pre><code>| Customer   Code | Activity | Start Date |
  |:---------------:|:--------:|:----------:|
  |       100       |     A    | 01/05/2017 |
  |       100       |     A    | 19/07/2017 |
  |       100       |     B    | 18/09/2017 |
  |       100       |     C    | 07/12/2017 |
  |       101       |     A    | 11/02/2018 |
  |       101       |     B    | 02/04/2018 |
  |       101       |     B    | 14/06/2018 |
  |       100       |     A    | 13/07/2018 |
  |       100       |     B    | 14/08/2018 |
  </code></pre>
  <p>Customers can perform activities A, B and C, always in that order. To carry out activity B he/she has to carry out activity A. To carry out C, he/she has to carry out activity A, then to B. An activity or cycle can be performed more than once by the same customer.</p>
  <p>I need to reorganize the table in this way, placing the beginning and end of each step:</p>
  <pre><code>| Customer   Code | Activity | Start Date |  End Date  |
  |:---------------:|:--------:|:----------:|:----------:|
  |       100       |     A    | 01/05/2017 | 18/09/2017 |
  |       100       |     B    | 18/09/2017 | 07/12/2017 |
  |       100       |     C    | 07/12/2017 | 13/07/2018 |
  |       101       |     A    | 11/02/2018 | 02/04/2018 |
  |       101       |     B    | 02/04/2018 |            |
  |       100       |     A    | 13/07/2018 | 14/08/2018 |
  |       100       |     B    | 14/08/2018 |            |
  </code></pre>
  <p>Thank you! :-)</p>