Hello,
I have a dataset which look something like table below.

The output I am trying to get is as following. For each ID if the latest State transitioned to is either A, K, C or W, than take only latest date transitioned out of State and latest State transition To for that ID. If the latest State transitioned to is not A, K, C or W then eliminate all the entries for that ID from the output.
The output for that table should look something like table below.

Please let me know if my question is not clear.
Thank you very much in Advance! Really appreciate your help.
Best,