cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Choose Language Hide Translation Bar
billi
Level V

recoding column using JSL and using recode option in Cols drop down menu

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"
);
);
1 ACCEPTED SOLUTION

Accepted Solutions

Re: recoding column using JSL and using recode option in Cols drop down menu

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.

olippincott_0-1583437848526.png

 

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.

olippincott_1-1583438041133.pngolippincott_2-1583438119434.png

 

The formula recodes the new data.

olippincott_3-1583438271702.png

 

-Olivia

 

View solution in original post

2 REPLIES 2

Re: recoding column using JSL and using recode option in Cols drop down menu

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.

olippincott_0-1583437848526.png

 

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.

olippincott_1-1583438041133.pngolippincott_2-1583438119434.png

 

The formula recodes the new data.

olippincott_3-1583438271702.png

 

-Olivia

 

billi
Level V

Re: recoding column using JSL and using recode option in Cols drop down menu

@O_Lippincott Thank you very much. This works.