- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Simplify JSL in transpose column #
Hi I am trying to reduce the transpose JSL columns.
Currently, when transpose col from col (3) to col (8), each col needs to be listed specifically.
Can I convert it to transpose between col (3) and col (8)? without list each column name.
Thanks
dt = Current Data Table();
dt << Transpose(
columns(
Column( 3 ),
Column( 4 ),
Column( 5 ),
Column( 6 ),
Column( 7 ),
Column( 8 )
)
);
2 ACCEPTED SOLUTIONS
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Simplify JSL in transpose column #
Here is one way to do what you want
dt = Current Data Table();
colNames = (dt << get column names(string))[3::8];
dt << Transpose(
columns(
colNames
)
);
Jim
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Simplify JSL in transpose column #
You can index the columns by number:
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Blood Pressure.jmp" );
dt << Transpose( Columns( 2::6 ), By( :Dose ), Label( :Subject ) );
Jordan
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Simplify JSL in transpose column #
Here is one way to do what you want
dt = Current Data Table();
colNames = (dt << get column names(string))[3::8];
dt << Transpose(
columns(
colNames
)
);
Jim
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Simplify JSL in transpose column #
You can index the columns by number:
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Blood Pressure.jmp" );
dt << Transpose( Columns( 2::6 ), By( :Dose ), Label( :Subject ) );
Jordan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Simplify JSL in transpose column #
Hi, Both solution works great