- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Assigning data table to new name and keep the original data table untouched after processing
I'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
<JSL>
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 ?
1 ACCEPTED SOLUTION
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Assigning data table to new name and keep the original data table untouched after processing
Save 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);
-Jarmo
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Assigning data table to new name and keep the original data table untouched after processing
Save 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);
-Jarmo
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Assigning data table to new name and keep the original data table untouched after processing
thank you very much!