Assigning data table to new name and keep the original data table untouched after processingI'm trying to avoid making changes in my original data table and keep it un-intact when I do some operations
say we have this kind of scenario
for (i = 1, 3, i++,
dt_process = data table("dt_original);
dt_process << newcolumn("elclassico", character,formula(if (Contains(:club, "BARC") , "Barcelona", "delete")
dt_process << save("save_my_club"||char(i))
)After this process when i = 2 it the jsl says to me cannot find dt_original because the name has been changed.
Why this is happening ?
Data TableScriptingRe: Assigning data table to new name and keep the original data table untouched after processingSave will change the name of the dataset and you are always using reference to same datatable (dt_original)
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
show(dt << get name);
dt << Save("$temp\deleteme Big Class.jmp"); // explicit location
show(dt << get name);
You could create subset instead and save that (if you don't need to leave these open, remember to close them)
dt_process = dt_original << Subset(Selected Columns(0), All Rows);