title: How to create historical data set for current and previous records
body: <p>I have a regular table in the SQL Server database as the below</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>Name</th>
  <th>Status</th>
  <th>Modified Date</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>X</td>
  <td>Fail</td>
  <td>16/09/2021</td>
  </tr>
  <tr>
  <td>X</td>
  <td>Fail</td>
  <td>28/09/2021</td>
  </tr>
  <tr>
  <td>X</td>
  <td>Done</td>
  <td>02/10/2021</td>
  </tr>
  <tr>
  <td>Y</td>
  <td>Fail</td>
  <td>30/09/2021</td>
  </tr>
  <tr>
  <td>Y</td>
  <td>Done</td>
  <td>02/10/2021</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>And I'm looking to make a report as a historical report based on the group of data as the below result</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>Name</th>
  <th>Current Status</th>
  <th>Previous status</th>
  <th>Modified Date</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>X</td>
  <td>Done</td>
  <td>Fail</td>
  <td>02/10/2021</td>
  </tr>
  <tr>
  <td>X</td>
  <td>Fail</td>
  <td>Fail</td>
  <td>28/09/2021</td>
  </tr>
  <tr>
  <td>Y</td>
  <td>Done</td>
  <td>Fail</td>
  <td>02/10/2021</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>any help will be highly appreciated</p>