Subscribe Bookmark RSS Feed

Exporting table properties to a datatable

robert_j_maurie

New Contributor

Joined:

May 16, 2016

I have a data table with rows of different parts and each column are various tests for each part.  The spec limits for each column are embedded spec limits in each column property.  I would like to create a data table where each row is now the parameter, with a column of USL, LSL and mean of each parameter.

Not sure how to do this, any help would be appreciated.

2 REPLIES
vince_faller

Super User

Joined:

Mar 17, 2015

Here's one way with JSL.

dt = open("$SAMPLE_DATA\Big Class.jmp");

Column(dt, "height")<< Set Property("Spec LImits", {LSL( 61 ), USL( 65 ), Target( 63 ), Show Limits( 0 )});

Column(dt, "height")<< Set Property("Spec LImits", {LSL( 70 ), USL( 120 ), Target( 90 ), Show Limits( 0 )});

col_names = dt << Get Column Names;

dt_new = New Table("Spec Limits", New Column("Test", Character), New Column("LSL")

       , New Column("Target"), New Column("USL")

);

for(i=1, i<=nitems(col_names), i++,

       sls = column(dt, col_names)<<Get Property("Spec Limits");

       if(!isempty(sls),

              dt_new << Add Rows({:Test = char(col_names), :LSL = sls["LSL"],

                     :Target = sls["Target"], :USL = sls["USL"]

                     }

              )

       )

);

If you're getting the spec limits from capability analysis you can also get it from the hot button

11571_pastedImage_7.png

ian_jmp

Staff

Joined:

Jun 23, 2011

I had some old code pretty much the same as that from vince.faller0​ above. So I added a couple of lines to also give the mean.