I have a table that breaks out data based on classes. In some cases, a class does not exist. In this case, I want to create a class for it by duplicating the next, closest class.
| City | Class | Rent |
| New York | A | 30 |
| New York | B | 20 |
| New York | C | 10 |
| Los Angeles | A | 20 |
| Los Angeles | B | 15 |
| Los Angeles | C | 10 |
| Seattle | B | 10 |
| Seattle | C | 5 |
| Austin | A | 15 |
| Austin | C | 5 |
In the above example, Seattle does not have a Class A row. I want to duplicate the next highest class row for that city. For Seattle, I want to duplicate the Class B row and name it Class A. For Austin, I want to duplicate the Class A row and name it Class B. My end result would be like the table below.
| City | Class | Rent |
| New York | A | 30 |
| New York | B | 20 |
| New York | C | 10 |
| Los Angeles | A | 20 |
| Los Angeles | B | 15 |
| Los Angeles | C | 10 |
| Seattle | A | 10 |
| Seattle | B | 10 |
| Seattle | C | 5 |
| Austin | A | 15 |
| Austin | B | 15 |
| Austin | C | 5 |
My end result would be each row having a Class A, B and C row, with the row being duplicated from the highest available class.