Serial Number | Date | Source | Prediction column |
1 | 15.11.2015 | A | 0 |
1 | 15.11.2015 | A | 0 |
1 | 17.03.2016 | B | 0 |
1 | 17.03.2016 | B | 0 |
1 | 19.08.2016 | A | 1 |
1 | 19.08.2016 | B | 1 |
2 | 20.06.2014 | A | 1 |
2 | 20.06.2014 | B | 1 |
2 | 20.06.2014 | B | 1 |
2 | 30.07.2015 | A | 0 |
2 | 30.07.2015 | A | 0 |
2 | 30.07.2015 | A | 0 |
I would like to create the "prediction column".
I want to know per serial number and per common date (serial number), which of these common dates have A and B appearing as a source.
I know that I need to do two group loops(nested),
The first group loop would be by Serial number, the next group loop would be by date and then I struggle how to
write the appropriate rule. I am searching for something like: if source=A AND source=B then put 1 to the prediction column.
Looking forward to a reply,
Cheers.