Hi Team,
In the same column, i have two different sets of data,
Data as follows , 12 digit Alphanumeric and few of them 9 characters like mentioned below , i want to make new column by using formula that if field having 12 characters then RED , If field contain 9 character then Green.
Please help me out in this regards! - Thanks in advance.
Input | |
Column | |
040114AV2 | |
36209CVG8 | |
US36224NWQ23 | |
CA078149DW82 | |
Required Output | |
040114AV2 | GREEN |
36209CVG8 | GREEN |
US36224NWQ23 | RED |
CA078149DW82 | RED |
@Jaganmohan , as the other have mentioned you did not specify how you wanted the nulls to be handled.
My solution assumed 12 is RED and the rest are GREEN, so it would have made nulls GREEN.
If you want them handled differently you just add another clause, as @atcodedog05 has shown.
M.
if you have many different possibilities it might be worth maintaining a separate table with the length values:
Then using the formula to return the length value:
Then you can simply add new values for new lengths.
Workflow attached.
M.