cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Don’t miss your chance to experience Discovery Summit Europe at our best available rate! Early bird registration through 31 Oct.
  • Graph Builder Toolbar streamlines interactive graphing. Creates shortcuts on Report and GraphBuilder Helpers toolbars. Download and install the extension.
  • JMP will suspend normal business operations for our Rest and Recharge Day on Friday, October 2, 2026.
    Regular business hours will resume on Monday, October 5, 2026.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
switzal87
Level III

Concatenate output tables from a Loop

Hello JMP community!

 

I had these 5 tables coming from a loop. Below is the screenshot of the script (Assuming its working fine)

 

Loop.JPG

How should I write a script that concatenates all the output table of the loop?!

Appreciate all inputs from this community!

 

Thanks in advance! :)

1 ACCEPTED SOLUTION

Accepted Solutions
jules
Community Manager Community Manager

Re: Concatenate output tables from a Loop

Hi @switzal87,

 

The following will concatenate the last 5 tables opened:

Data Table(N Table()) << Concatenate(
	Data Table( N Table()-1 ),
	Data Table( N Table()-2 ),
	Data Table( N Table()-3 ),
	Data Table( N Table()-4 ),
	Create source column
);

This works because Data Table(number) refers to a specific table, N Table() returns the number of data tables open in JMP, data tables are numbered based on when they are opened, thus Data Table(N Table()) returns the last table, and subtracting k from N Table() returns the table opened k tables ago. You could generalize this by writing a loop to generate the concatenation code, but if you're always pulling 5 tables this is a pretty easy way to combine them. 

 

I hope this helps!

 

@jules

 

edit: Here is a generalized version for any number of tables:

tableList={};

for(k=1,k<=4,k++,InsertInto(tableList,Data Table( N Table()-k )));

Data Table(N Table()) << Concatenate(tableList,Create source column);

View solution in original post

1 REPLY 1
jules
Community Manager Community Manager

Re: Concatenate output tables from a Loop

Hi @switzal87,

 

The following will concatenate the last 5 tables opened:

Data Table(N Table()) << Concatenate(
	Data Table( N Table()-1 ),
	Data Table( N Table()-2 ),
	Data Table( N Table()-3 ),
	Data Table( N Table()-4 ),
	Create source column
);

This works because Data Table(number) refers to a specific table, N Table() returns the number of data tables open in JMP, data tables are numbered based on when they are opened, thus Data Table(N Table()) returns the last table, and subtracting k from N Table() returns the table opened k tables ago. You could generalize this by writing a loop to generate the concatenation code, but if you're always pulling 5 tables this is a pretty easy way to combine them. 

 

I hope this helps!

 

@jules

 

edit: Here is a generalized version for any number of tables:

tableList={};

for(k=1,k<=4,k++,InsertInto(tableList,Data Table( N Table()-k )));

Data Table(N Table()) << Concatenate(tableList,Create source column);

Recommended Articles