OK,
Thank you for the quick responses. My problem is a little different than the concept in the samples you provided, but you have given me the insight I needed to move significantly forward.
In your solution above, I can now ADD the complete contents of the new data file to the old datafile, BUT, my issue is related to "moving" to a leter version of updated data in that my NEW file simply has additional data rows beyond the first. It is not a matter of connecting/correlation of two seperate data sets.
Your sample did give me the understanding that when I execute the "Source" script in the original table (which is actually pointed at the new/updated source data file of the same name and location as the original data) I get a new data table with only the "Source" script present. I was lost when I now had a new table with the current/updated data as desired, but none of my other scripts.
In your sample, you ended the data merge with the "now copy your scripts from the old table to the new table".
Light bulb moment....you can do that?
So, searching the forums I found some examples of listing the scripts in one table and inserting them into another. At some point I will figure out how to link to other discussion so I will be able to point to references such as this, but for now, here is the code in the sample:
for a single script:
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
scriptName = "Oneway";
scriptDef = dt << get table variable( scriptName );
dt2 = New Table( "little class" );
Eval(
Parse(
Eval Insert(
"
dt2 << New Script( \!"^scriptName^\!", ^scriptDef^ )
"
)
)
);
for all scripts in a table:
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
dt2 = New Table( "little class" );
Wait( 3 );
lstScriptNames = dt << Get Table Script Names;
Wait( 3 );
j = N Items( lstScriptNames );
For( i = 1, i <= N Items( lstScriptNames ), i++,
// scriptName = lstScriptNames;
scriptName = lstScriptNames( i );
scriptDef = dt << get table variable( scriptName );
Eval(
Parse(
Eval Insert( "dt2 << New Script( \!"^scriptName^\!", ^scriptDef^ )" )
)
);
);
Now - I made a copy of the "Source" script, added asignments of the tables to dt variables and then attempted to follow the open command with the loop to copy all scripts. I was unable to get the scriptName and scriptDef values to load correctly. scriptName appears to load the correct list of scripts in the current table, but the scriptDef call does not pull in the defintions.
I therefore manually added each of my test scripts with repeated manual single copies which worked wonderfully. Here is my resuilting code:
dtCurrent = Current Data Table();
dtUpdate = Open(
"Z:\JMP Data Analysis\SLOC Metrics\Data Update Testing\Project_Metrics.xlsx",
Worksheets( "Code_Change_Metrics" ),
Use for all sheets( 1 ),
Concatenate Worksheets( 0 ),
Create Concatenation Column( 0 ),
Worksheet Settings(
1,
Has Column Headers( 1 ),
Number of Rows in Headers( 1 ),
Headers Start on Row( 1 ),
Data Starts on Row( 2 ),
Data Starts on Column( 1 ),
Data Ends on Row( 0 ),
Data Ends on Column( 0 ),
Replicated Spanned Rows( 1 ),
Replicated Spanned Headers( 0 ),
Suppress Hidden Rows( 1 ),
Suppress Hidden Columns( 1 ),
Suppress Empty Columns( 1 ),
Treat as Hierarchy( 0 ),
Multiple Series Stack( 0 ),
Import Cell Colors( 0 ),
Limit Column Detect( 0 ),
Column Separator String( "-" )
)
);
scriptName = "Mod vs Unmod Code Change Sample";
scriptDef = dtCurrent << get table variable( scriptName );
Eval(
Parse(
Eval Insert(
"
dtUpdate << New Script( \!"^scriptName^\!", ^scriptDef^ )
"
)
)
);
scriptName = "Individual & Moving Range chart of % Code Change";
scriptDef = dtCurrent << get table variable( scriptName );
Eval(
Parse(
Eval Insert(
"
dtUpdate << New Script( \!"^scriptName^\!", ^scriptDef^ )
"
)
)
);
scriptName = "Total Lines vs. Asset / Code Analyzed";
scriptDef = dtCurrent << get table variable( scriptName );
Eval(
Parse(
Eval Insert(
"
dtUpdate << New Script( \!"^scriptName^\!", ^scriptDef^ )
"
)
)
);
scriptName = "% Code Change vs. Asset / Code Analyzed";
scriptDef = dtCurrent << get table variable( scriptName );
Eval(
Parse(
Eval Insert(
"
dtUpdate << New Script( \!"^scriptName^\!", ^scriptDef^ )
"
)
)
);
scriptName = "UpdateDataTable";
scriptDef = dtCurrent << get table variable( scriptName );
Eval(
Parse(
Eval Insert(
"
dtUpdate << New Script( \!"^scriptName^\!", ^scriptDef^ )
"
)
)
);
scriptName = "TestingTableUpdateScript";
scriptDef = dtCurrent << get table variable( scriptName );
Eval(
Parse(
Eval Insert(
"
dtUpdate << New Script( \!"^scriptName^\!", ^scriptDef^ )
"
)
)
);
scriptName = "CopySingleScriptFromOldTable";
scriptDef = dtCurrent << get table variable( scriptName );
Eval(
Parse(
Eval Insert(
"
dtUpdate << New Script( \!"^scriptName^\!", ^scriptDef^ )
"
)
)
);
scriptName = "CopyAllScriptsFromOldTable";
scriptDef = dtCurrent << get table variable( scriptName );
Eval(
Parse(
Eval Insert(
"
dtUpdate << New Script( \!"^scriptName^\!", ^scriptDef^ )
"
)
)
);
With my original JMP table file open (created with the last version of the source data file) I can now execute this script which creates a NEW TABLE from the updated source data file and then copies all of the scripts over to the new table. I then have TWO JMP tables open, both with the same titles, both with the same scripts, but one with the old data and one with the new data (more data). I now close the old table and SAVE the new table right over it in the same location.
BOOM! Updated data with all of the scripts available for execution. Same file location and name so the process can repeat with each weekly or monthly report update as needed.
I would really like to get the automated loop for loading all scripts dynamically working so I can use the same script on other datasets without having to manage script names in the actual code. For right now I am moving forward with the manual version until I figure out the issue with the loop.
Thank you so much for your quick response and samples which lead me to a solution in the end.