Hi - Need help!! I have a series of strings as input with each line item assigned a different value as follows:
| Input | Value |
| A_UVWXYZ 1A_CH | 1 |
| A_VWXYZ 1A_CHD | 2 |
| A_WXYZ 1A_CHDH | 3 |
| A_TWXYZ 1A_CHDHH | 4 |
| A_XYZAB 1A_CK | 5 |
And I need the output as follows:
| Output |
| A_UVWXYZ 1A_CH |
| A_VWXYZ 1B_CHD |
| A_WXYZ 1C_CHDH |
| A_TWXYZ 1D_CHDHH |
| A_XYZAB 1E_CK |
Basically, I am looking to replace the every second instance (ONLY) of "A_" based on the assigned value as per the following conditions:
if value = 2, replace second instance of "A_" with "B_"
if value = 3, replace second instance of "A_" with "C_"
if value = 4, replace second instance of "A_" with "D_"
if value = 5, replace second instance of "A_" with "E_"
else "A_"
It is quite easy to do in excel with the "Substitute" and nested "IF" functions but I am not able to figure out the logic in Alteryx. Any help is greatly appreciated.
Thank you!