Hello community,
I want to form a descending 'New_target' where 0 represents the failure of a machine (In Fault or Target). I show a table (the real data I will put it in excel to download). Any ideas?
| Target | Date | Hours | Fault | S1 | New_target |
| 0 | 20/01/2018 | 8 | 0 | 6 | 0 |
| 1 | 20/01/2018 | 12 | | 2 | 5 |
| 2 | 20/01/2018 | 13 | | 7 | 4 |
| 3 | 20/01/2018 | 16 | | 9 | 3 |
| 4 | 20/01/2018 | 18 | | 3 | 2 |
| 5 | 20/01/2018 | 19 | | 9 | 1 |
| 0 | 20/01/2018 | 22 | 0 | 5 | 0 |
| 1 | 20/01/2018 | 23 | | 3 | 3 |
| 2 | 21/01/2018 | 0 | | 8 | 2 |
| 3 | 21/01/2018 | 1 | | 7 | 1 |
| 0 | 21/01/2018 | 12 | 0 | 7 | 0 |
| 1 | 21/01/2018 | 21 | | 5 | 4 |
| 2 | 22/01/2018 | 1 | | 2 | 3 |
| 3 | 22/01/2018 | 2 | | 1 | 2 |
| 4 | 22/01/2018 | 23 | | 2 | 1 |
| 0 | 22/01/2018 | 24 | 0 | 1 | 0 |