Hello,
Is there a way to have a column created that identifies when a change occurs in data based on sorted date and another column. The data is grouped by building and sorted on date. I want to count if a change has occurred. For each building I want to calculate the number of color changes based on the sorted date.
Example
Data set
| Building | Color | date |
| 23 | G | 12/16/2015 |
| 23 | G | 1/17/2016 |
| 23 | R | 2/18/2016 |
| 23 | G | 3/1/2016 |
| 56 | R | 3/1/2016 |
| 56 | G | 3/12/2016 |
required outcome
| Building | Color | Date | Change |
| 23 | G | 12/16/2015 | 0 |
| 23 | G | 1/17/2016 | 0 |
| 23 | R | 2/18/2016 | 1 |
| 23 | G | 3/1/2016 | 1 |
| 56 | R | 3/12/2016 | 0 |
| 56 | G | 3/1/2016 | 1 |