cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
New to using JMP? Hit the ground running with the Early User Edition of Discovery Summit. Register now, free of charge.
Register for our Discovery Summit 2024 conference, Oct. 21-24, where you’ll learn, connect, and be inspired.
Choose Language Hide Translation Bar
lwx228
Level VIII

How to used JSL JMP tables into a multi-tabbed Excel workbook?

I would like to ask JMP community to help me out on a custom way to export JMP table to excel.

 

Thanks!2019-08-23_14-23-06.png

dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
11 REPLIES 11
txnelson
Super User

Re: How to used JSL JMP tables into a multi-tabbed Excel workbook?

I am not sure exactly what all you need with your code, but here is a simple script that creates your required subsets and saves them to an Excel workbook.  If you need to save the jmp tables as separate tables, in addition to the workbook, you can do that with a simple loop after the workbook is created.

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );

cNa = dt << get column names;
xF = {};
For( c = 2, c <= N Col( dt ), c++,
	d2 = dt << Subset(
		All rows,
		columns( dt:name, Column( dt, c ) ),
		output table( Char( cNa[c] ) )
	);
	Insert Into( xF, d2 << get name );
);

close( dt, nosave );

Create Excel Workbook( "c:\TheWorkBook.xlsx", Eval( xF ), Eval( xF ) );
Jim
lwx228
Level VIII

Re: How to used JSL JMP tables into a multi-tabbed Excel workbook?

That's exactly what's needed.

Thank Jim!