cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Instantly extract effect sizes, F-ratios, and FDR-adjusted p-values from your models with the Calculate Effects Sizes extension, available now in the JMP Marketplace!
  • New to JMP? Join us Sept. 23-24 for the Early User Edition of Discovery Summit, tailor-made for new users. Register now for free!
  • Your voice matters! Tell us how you prefer to receive JMP updates, so we can tailor our communication to your needs. Take short survey.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
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
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
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

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

Recommended Articles