I have data table with column 'plant' which represents numeric entry corresponding to specific plant. I recoded this column using the following script so that Plant number appears as plant name in the data table. This worked fine, but the problem I am having is that I get new data every quarter and when I add new data to this data table, plant name is missing for the new data and I have to re-run the script again and again. I have tried using recode option available in the Cols drop down menu as well. Is there any way to recode this column and make sure that it works when I add new data?
FD = Current Data Table();
FD << New Column( "Plant Name", Character, Nominal );
For Each Row(
:Plant Name = Match( :Plant,
"1022", "UK",
"1030", "India",
"1050", "Canada",
"1080", "Australia",
"1110", "UAE",
"1120", "US",
"1140", "US"
);
);
@O_Lippincott Thank you very much. This works.
Saving your recode as a formula column would allow the formula to evaluate when you append additional rows onto the main table even if that column is not in the new data.
The option in the Cols menu recode to save as a formula column can be found here.

Now I can go to the Rows menu>Concatenate and choose to append the new data onto the existing main data table. I also created a source column in this example.


The formula recodes the new data.

-Olivia