OrderNo Status1 Status2 Status3
123 Completed Pending Pending
456 Rejected Completed Completed
789 Pending In Progress Completed
Above is the table which is the input data set and the expected output is below. The catch here is we should count based on the order no and not by no of status occurrences. Can we do this with the help of spark dataframes using scala? Appreciate your help in advance.
Pending 2
Rejected 1
Completed 3
In Progress 2