I have following data.
I am trying to get the number of days the project stayed in a particular status. Example below of raw data, I need to be able to get the result shown.
Can I get some pointers on how I can achieve this?
Raw data
╔══════════════════════════════════╦════════╦════════════╗
║ ID ║ STATUS ║ ENTRY_DATE ║
╠══════════════════════════════════╬════════╬════════════╣
║ 541c4cfd009784b7ad7b47a552ab7ea2 ║ WIH ║ 9/25/2015 ║
║ 541c4cfd009784b7ad7b47a552ab7ea2 ║ CPL ║ 9/9/2015 ║
║ 541c4cfd009784b7ad7b47a552ab7ea2 ║ CPL ║ 7/21/2015 ║
║ 541c4cfd009784b7ad7b47a552ab7ea2 ║ CPL ║ 7/21/2015 ║
║ 541c4cfd009784b7ad7b47a552ab7ea2 ║ CPL ║ 7/8/2015 ║
║ 541c4cfd009784b7ad7b47a552ab7ea2 ║ CUR ║ 6/25/2015 ║
║ 541c4cfd009784b7ad7b47a552ab7ea2 ║ CPL ║ 6/25/2015 ║
║ 541c4cfd009784b7ad7b47a552ab7ea2 ║ CPL ║ 6/16/2015 ║
║ 541c4cfd009784b7ad7b47a552ab7ea2 ║ TNJ ║ 5/26/2015 ║
║ 541c4cfd009784b7ad7b47a552ab7ea2 ║ CPL ║ 5/15/2015 ║
║ 541c4cfd009784b7ad7b47a552ab7ea2 ║ CPL ║ 4/22/2015 ║
║ 541c4cfd009784b7ad7b47a552ab7ea2 ║ CUR ║ 4/16/2015 ║
╚══════════════════════════════════╩════════╩════════════╝
Expected results
╔══════════════════════════════════╦════════╦════════════╦═══════════╗
║ ID ║ STATUS ║ ENTRY_DATE ║ EXIT_DATE ║
╠══════════════════════════════════╬════════╬════════════╬═══════════╣
║ 541c4cfd009784b7ad7b47a552ab7ea2 ║ WIH ║ 9/25/2015 ║ NULL ║
║ 541c4cfd009784b7ad7b47a552ab7ea2 ║ CPL ║ 7/8/2015 ║ 9/25/2015 ║
║ 541c4cfd009784b7ad7b47a552ab7ea2 ║ CUR ║ 6/25/2015 ║ 7/8/2015 ║
║ 541c4cfd009784b7ad7b47a552ab7ea2 ║ CPL ║ 6/16/2015 ║ 6/25/2015 ║
║ 541c4cfd009784b7ad7b47a552ab7ea2 ║ TNJ ║ 5/26/2015 ║ 6/16/2015 ║
║ 541c4cfd009784b7ad7b47a552ab7ea2 ║ CPL ║ 4/22/2015 ║ 5/26/2015 ║
║ 541c4cfd009784b7ad7b47a552ab7ea2 ║ CUR ║ 4/16/2015 ║ 4/22/2015 ║
╚══════════════════════════════════╩════════╩════════════╩═══════════╝