cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Register for our Discovery Summit 2024 conference, Oct. 21-24, where you’ll learn, connect, and be inspired.
Choose Language Hide Translation Bar
Neo
Neo
Level VI

How to select columns with spec limits and group them (in JSL)?

I have got a data table with several columns with spec limits and several columns without. How to I select all the columns with spec limits, group them and call the group say "myGroup"?

When it's too good to be true, it's neither
1 ACCEPTED SOLUTION

Accepted Solutions

Re: How to select columns with spec limits and group them (in JSL)?

@Neo 

This should work:

names default to here( 1 );
dt = current data table();

colsWithSpecs = {};
for( i = 1, i <= n cols( dt ), i++,
	Q = column( dt, i ) << get property( "Spec Limits" );
	if( !is empty( Q ), insert into( colsWithSpecs, column( dt, i ) << get name ) )
);

dt << group columns( "Columns with Spec Limits", colsWithSpecs )
-Scott

View solution in original post

3 REPLIES 3
jthi
Super User

Re: How to select columns with spec limits and group them (in JSL)?

Get list of continuous columns (<< get column names(continuous, "string"), loop over this list and use << Get Property("Spec Limits"). If here is a match -> add to list if not skip and continue. After you have the list you can use << Group Columns to create your group.

-Jarmo

Re: How to select columns with spec limits and group them (in JSL)?

@Neo 

This should work:

names default to here( 1 );
dt = current data table();

colsWithSpecs = {};
for( i = 1, i <= n cols( dt ), i++,
	Q = column( dt, i ) << get property( "Spec Limits" );
	if( !is empty( Q ), insert into( colsWithSpecs, column( dt, i ) << get name ) )
);

dt << group columns( "Columns with Spec Limits", colsWithSpecs )
-Scott
txnelson
Super User

Re: How to select columns with spec limits and group them (in JSL)?

Go to 

     Cols=>Column Manager

Click on the Property Down Arrow and select Spec Limits

txnelson_0-1722601542950.png

Select all displayed columns

      Select first displayed column and then scroll down to the bottom of the list and then press the shift key and click on the last displayed column

txnelson_1-1722601913884.png

Now return to the original data table.  All of the columns with Spec Limits are now selected.

Select

     Cols=>Group Columns

or go to the red triangle in the Columns Panel and select

txnelson_2-1722602307333.png

The columns will now be grouped

txnelson_3-1722602371629.png

To change the name to myGroup, double click on the default name

txnelson_4-1722602503507.png

Type in the name myGroup and press the enter key

txnelson_5-1722602577209.png

Other Community Members may have other methods

Jim