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
Jackie_
Level VI

Group columns containing column properties

Hello,

 

Is there a way to use contain to search the column properties and group them if only the column contains spec limits properties?

Trying to group the columns that contain the column property "Spec Limits". Any advice?

Jackie__0-1697549346004.png

 

Thanks,

Jackie

2 ACCEPTED SOLUTIONS

Accepted Solutions
txnelson
Super User

Re: Group columns containing column properties

You just need to go through the numeric columns and put into a list, the ones with Spec Limits.  Then use the Group Columns message to create the group

Names Default To Here( 1 );
dt = Current Data Table();

theNames = dt << get column names( numeric, string );

specLimitsList = {};
For Each( {colName}, theNames,
	If( Is Empty( Column( colName ) << get property( "Spec Limits" ) ) == 0,
		Insert Into( specLimitsList, colName )
	)
);
dt << group columns( "HaveSpecLimits", specLimitsList );
Jim

View solution in original post

Ressel
Level VI

Re: Group columns containing column properties

This should work on your example table:

Names Default To Here( 1 );

dt = Current Data Table();

colList = dt << Get Column Names();

For( i = 1, i <= N Items( colList ), i++,
	If( Contains( Char( (Column( i ) << Get Column Properties( string )) ), "Spec" ),
		Column( i ) << set selected
	)
);

dt << group columns( "name of your group" );

View solution in original post

2 REPLIES 2
txnelson
Super User

Re: Group columns containing column properties

You just need to go through the numeric columns and put into a list, the ones with Spec Limits.  Then use the Group Columns message to create the group

Names Default To Here( 1 );
dt = Current Data Table();

theNames = dt << get column names( numeric, string );

specLimitsList = {};
For Each( {colName}, theNames,
	If( Is Empty( Column( colName ) << get property( "Spec Limits" ) ) == 0,
		Insert Into( specLimitsList, colName )
	)
);
dt << group columns( "HaveSpecLimits", specLimitsList );
Jim
Ressel
Level VI

Re: Group columns containing column properties

This should work on your example table:

Names Default To Here( 1 );

dt = Current Data Table();

colList = dt << Get Column Names();

For( i = 1, i <= N Items( colList ), i++,
	If( Contains( Char( (Column( i ) << Get Column Properties( string )) ), "Spec" ),
		Column( i ) << set selected
	)
);

dt << group columns( "name of your group" );