cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Sign-in to the JMP Community will be unavailable intermittently Dec. 6-7 due to a system update. Thank you for your understanding!
  • We’re retiring the File Exchange at the end of this year. The JMP Marketplace is now your destination for add-ins and extensions.
  • JMP 19 is here! Learn more about the new features.

Discussions

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

Transpose column to rows and add Single quotation mark for each row

How can I use JSL to Transpose one column (:Number) to rows and add single quotation mark for each row? 

ReliabilityWolf_0-1717724919749.png

or add add single quotation mark for each row of "Number" column, then Transpose to row? 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
WebDesignesCrow
Super User

Re: Transpose column to rows and add Single quotation mark for each row

Hi @ReliabilityWolf 

Perhaps you can try this JSL script.

 

//To add prefix single quotation mark
Names Default to Here( 1 );
dt = current data table();
dt:Number << Data Type( Character);
for each row(
	dt:Number = "'" || dt:Number
);

//To transpose Number column to row
// Transpose data table
// → Data Table( "Transpose of dt" )
Data Table( "dt" ) << Transpose(
	columns( :Number ),
	Output Table( "Transpose of dt" )
);

View solution in original post

1 REPLY 1
WebDesignesCrow
Super User

Re: Transpose column to rows and add Single quotation mark for each row

Hi @ReliabilityWolf 

Perhaps you can try this JSL script.

 

//To add prefix single quotation mark
Names Default to Here( 1 );
dt = current data table();
dt:Number << Data Type( Character);
for each row(
	dt:Number = "'" || dt:Number
);

//To transpose Number column to row
// Transpose data table
// → Data Table( "Transpose of dt" )
Data Table( "dt" ) << Transpose(
	columns( :Number ),
	Output Table( "Transpose of dt" )
);

Recommended Articles