I have a dataset (see example below)
Where Key_Text equals AAAInterventionType, where the Ref matches, find AAAReviewReason in the Key_Text column return the value of Key_Code in the column called ReviewReason.
Desired Outcome
Where Key_Text equals AAAInterventionType, where the Ref matches, find AAAReviewReason in the Key_Text column return the value of Key_Code in the column called ReviewReason.
DTS | Ref | KEY_Text | KEY_Code |
11/04/2023 8:03 | 9995a | AAAChannel | PHO |
11/04/2023 8:03 | 9995a | AAAInterventionStatus | STA |
11/04/2023 8:03 | 9995a | AAAInterventionType | IQI |
11/04/2023 8:03 | 9995a | AAAOrigin | INT |
11/04/2023 8:03 | 9995a | AAAReviewReason | CDI |
11/04/2023 8:05 | 9995a | AAAChannel | PHO |
11/04/2023 8:05 | 9995a | AAAInterventionStatus | STA |
11/04/2023 8:05 | 9995a | AAAInterventionType | IQI |
11/04/2023 8:05 | 9995a | AAAOrigin | INT |
11/04/2023 8:05 | 9995a | AAAReviewReason | CDI |
11/04/2023 8:06 | 9995a | AAAChannel | PHO |
11/04/2023 8:06 | 9995a | AAAInterventionStatus | STA |
11/04/2023 8:06 | 9995a | AAAInterventionType | IQI |
11/04/2023 8:06 | 9995a | AAAOrigin | INT |
11/04/2023 8:06 | 9995a | AAAReviewReason | CDI |
Desired Outcome
DTS | Ref | KEY_Text | KEY_Code | ReviewReason |
11/04/2023 8:03 | 9995a | AAAChannel | PHO | |
11/04/2023 8:03 | 9995a | AAAInterventionStatus | STA | |
11/04/2023 8:03 | 9995a | AAAInterventionType | IQI | CDI |
11/04/2023 8:03 | 9995a | AAAOrigin | INT | |
11/04/2023 8:03 | 9995a | AAAReviewReason | CDI | |
11/04/2023 8:05 | 9995a | AAAChannel | PHO | |
11/04/2023 8:05 | 9995a | AAAInterventionStatus | STA | |
11/04/2023 8:05 | 9995a | AAAInterventionType | IQI | CDI |
11/04/2023 8:05 | 9995a | AAAOrigin | INT | |
11/04/2023 8:05 | 9995a | AAAReviewReason | CDI | |
11/04/2023 8:06 | 9995a | AAAChannel | PHO | |
11/04/2023 8:06 | 9995a | AAAInterventionStatus | STA | |
11/04/2023 8:06 | 9995a | AAAInterventionType | IQI | CDI |
11/04/2023 8:06 | 9995a | AAAOrigin | INT | |
11/04/2023 8:06 | 9995a | AAAReviewReason | CDI |