Subscribe Bookmark RSS Feed

Concatenation of multiple tables

Christian

Community Trekker

Joined:

Jun 2, 2014

I have found a method in the forum that provided the capability of concatenating tables together. I have tried with a list of existing tables where the starting tables is of the same kind. The error mesage that comes is: Wrong result type for expression for column Source{1} in access or evaluation of 'set each value' , set each value( filenow ) /*###*/

Names Default To Here( 1 ); Clear Log(); Clear Symbols(); Close All(Data Tables, No Save);  Close All(Journals, No Save); Close All(Reports,No Save);
Path = "C:\JmpTest\";
filelist = {};
filelist[1] = Open(Path||"file 1.jmp",private);
filelist[2] = Open(Path||"file 2.jmp",private);
filelist[3] = Open(Path||"file 3.jmp",private);
filefinal 	= "file 123.jmp";

nf=nitems(filelist); //number of items in the working list
cctable= New Table( "Combined data table ");//make an empty table
cctable << New Column( "Source", Character, Nominal );
For( iii = 2 , iii <= nf, iii++, //this starts the first loop
filenow = ( filelist[iii] );
fileopen= filenow;
//dt=open(fileopen,private);
//dt=open(fileopen,importset,private);//Import settings used in the open argument
dt = filelist[1];
New Column( "Source", Character, Nominal );
:Source << set each value( filenow );
dt<<new column("Source", character, nominal)<<set each value(9999);
dt << Run Formulas();
//add the current table to the bottom of the combined data table
cctable << Concatenate( Data Table( dt ), Append to first table );
//don't use "Create Source Column" argument
Close( dt, NoSave );//after concatenating the table, close it and move on
);//end of the first for loop
2 REPLIES
txnelson

Super User

Joined:

Jun 22, 2012

As noted in the JMP log

Name Unresolved: filepath in access or evaluation of 'filepath' ,

The variable "filepath" does not exist

Jim
Christian

Community Trekker

Joined:

Jun 2, 2014

Thanks for the observation. I have updated the file and the request. Not it is executable.