Share your ideas for the JMP Scripting Unsession at Discovery Summit by September 17th. We hope to see you there!
Choose Language Hide Translation Bar
Highlighted
steven_gong
Level II

How to get all columns into JSL Combine Columns()?

The question is about Combine Columns().

From Scripting index, I can find below example.

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Consumer Preferences.jmp" );
dt << Combine Columns(
	delimiter( "," ),
	Columns(
		:Brush After Waking Up,
		:Brush After Meal,
		:Brush Before Sleep,
		:Brush Another Time
	),
	Selected Columns are Indicator Columns( 1 ),
	Column Name( "When to Brush" )
);

My problem is that I have random 100 columns to 200 columns of data.

How can I utilize the script to get all columns to replace above exact column name in red font?

Thanks.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
steven_gong
Level II

Re: How to get all columns into JSL Combine Columns()?

I tried that out, see below script.

It's actually an easy one, just stuck there for a moment.

Keep trying, keep learning..

 

dt = current data table();
N = Ncol();
dt << Combine Columns(
	delimiter( "," ),
	Columns(
	1::N		
	),
	Selected Columns are Indicator Columns( 0 ),
	Column Name( "Combined" )
);

View solution in original post

2 REPLIES 2
Highlighted
steven_gong
Level II

Re: How to get all columns into JSL Combine Columns()?

Sorry for that there is no red fond in the JSL formatted script.

It's about below column's name in red font.

:Brush After Waking Up,
:Brush After Meal,
:Brush Before Sleep,
:Brush Another Time

Highlighted
steven_gong
Level II

Re: How to get all columns into JSL Combine Columns()?

I tried that out, see below script.

It's actually an easy one, just stuck there for a moment.

Keep trying, keep learning..

 

dt = current data table();
N = Ncol();
dt << Combine Columns(
	delimiter( "," ),
	Columns(
	1::N		
	),
	Selected Columns are Indicator Columns( 0 ),
	Column Name( "Combined" )
);

View solution in original post

Article Labels