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
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" )
);