cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Learn how to build custom Python data connectors and further customize JMP’s Data Connector Framework with the Python Data Connector Demo, available now in the JMP Marketplace!
  • See how to create experiments to support product design and ID useful product features. Register for June 12 webinar, 2pm US Eastern Time.

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