cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Browse apps to extend the software in the new JMP Marketplace
Choose Language Hide Translation Bar
HR
HR
Level I

How to transpose excel cells during import

Hello!

I was wondering if anyone else has tried this before or has any tips on how to accomplish the following issue.

I am looking to import data from an excel file but need to transpose the data. I would prefer not to transpose ALL of the cells in excel prior to using the Excel Wizard on JMP but rather have JMP automatically transpose my data while importing it into a JMP table.

 

I would normally manually transpose the excel cells if the data set is small, but in my current situation I don't want to waste hours transposing cells before importing the information into JMP.

 

I am pretty novice with JSL but am willing to give it a shot if it will help my case.

 

Thanks,

Heather

1 ACCEPTED SOLUTION

Accepted Solutions
txnelson
Super User

Re: How to transpose excel cells during import

Here is what I think would be the most straight forward and easiest way to accomplish what you want.  It reads in the data and then transposes it without visibility to the user.

names default to here(1);
dt = open("path and name.xlsx",invisible);

colNames = dt << get column names;
remove from(colNames, 1, 1 );

dtTrans =  dt << Transpose(
	columns( colNames ),
	Label( column( 1 ) ),
	Output Table( "Transpose of Sheet1" ));
	
close( dt, nosave );
Jim

View solution in original post

4 REPLIES 4
txnelson
Super User

Re: How to transpose excel cells during import

Can you supply a sample Excel file, and an example of what you expect the transform to end up looking like?
Jim
HR
HR
Level I

Re: How to transpose excel cells during import

The goal is to avoid having to import the excel file into one JMP table  and have to generate a second JMP data table using table > transpose. I would like to just have the data transposed into one data table from the start.

 

-HR

txnelson
Super User

Re: How to transpose excel cells during import

Here is what I think would be the most straight forward and easiest way to accomplish what you want.  It reads in the data and then transposes it without visibility to the user.

names default to here(1);
dt = open("path and name.xlsx",invisible);

colNames = dt << get column names;
remove from(colNames, 1, 1 );

dtTrans =  dt << Transpose(
	columns( colNames ),
	Label( column( 1 ) ),
	Output Table( "Transpose of Sheet1" ));
	
close( dt, nosave );
Jim
HR
HR
Level I

Re: How to transpose excel cells during import

Worked like a charm, thank you so much!

-HR