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
uwe_hiss
Level II

jsl: how to combine multiple report in one

Hello,

Since my last question a few days I have come a little further with my script.

To complete the first step I would like to combine the reports (in 3 Windows) in one Report (1 Windows).

How can I do this ... See line 51 ff

And how can I save this Report automaticly named by data_file name (first 10 characters) AND _Baseline (if select more than one Month) OR _Monthly (with selected Month)? ... see line  33-40

my scrpit:

Clear log();

Clear globals();

data_file= Pick File("Select data base");

dt_data= Open( data_file, invisible);

spec_file= Pick File("Select spec file");

dt_spec= Open( spec_file, invisible);

//dt_ssum= New Table("Stat Summary", invisible);

specColName = dt_spec << GetColumnNames( Numeric, String );

dataColName = dt_data << GetColumnNames( Numeric, String );

specExpr = Expr(

  Column( dt_data, name ) << set property(

  "Spec Limits",

  {LSL( Expr( lower ) ), USL( Expr( upper ) )}

  );

);

For( i = 1, i <= N Rows( dt_spec ), i++,

  name = Column( dt_spec, "Process" );

  lower = Column( dt_spec, "LSL" );

  upper = Column( dt_spec, "USL" );

  If( Contains( dataColName, name ),

  Eval( Eval Expr( specExpr ) )

  );

);

Current Data Table(dt_data);

New Window( "Select ONE month ", <<Modal,

V List Box(

      Text Box("or ALL for baseline"),

      mon = List Box(:Stage << get values),

      Button Box( "OK", cho = mon << get selected),

      )

);

dt_data << Select Where(Contains(cho, :Stage));

if (

      cho [1] == "Baseline",

      dt_data << delete rows,

      dt_data << invert row selection;

      dt_data << delete rows;

);

for (k = 1, k <= N Items(dataColName),k++,

cc = dt_data << Control Chart(

      Group Size( 1 ),

      KSigma( 3 ),

      Chart Col(

            dataColName,

            Individual Measurement( Test 1( 1 ), Test 2( 1 ), Test 3( 1 ) ),

            Moving Range,

            Capability(

                  Distribution(

                        Continuous Distribution(

                             Column( dataColName),

                             Quantiles( 0 ),

                             Horizontal Layout( 0 ),

                             Histogram( 0 ),

                             Vertical( 0 ),

                             Outlier Box Plot( 0 ),

                             Summary Statistics ( 1 ), //  no funktion

                             Normal Quantile Plot( 0 ),  // no function

                             PpK Capability Labeling( 1 ),

                             Capability Analysis,

                             )

                  )

            )

      ),

      SendToReport(

            Dispatch(

                  {"Individual Measurement of Assay"},

                  "IR Chart of IM",

                  FrameBox( 2 ),

                  {Frame Size( 75, 162 )}

            ),

            Dispatch(

                  {"Moving Range of Assay"},

                  "IR Chart of MR",

                  FrameBox( 2 ),

                  {Frame Size( 75, 162 )}

            ),

           

            Dispatch(

                  {"Capability Analysis"},

                  " Long Term Sigma",

                  OutlineBox,

                  {Close( 1 )}

            ),

            Dispatch(

                  {"Capability Analysis"},

                  " Control Chart Sigma",

            )

      )

    ) 

);

// create and save new table with LSL, USL, UCL, AVG, LCL,

// Summary Statistics, CP, CPK, CPL, CPU, Sigma (Control Chart Sigma)

ccr = cc << Report;

ccr << show tree structure();

//ccr[StringColBox(1)]

//ccr[NumberColBox(1)]

//ccr[FrameBox(2)]

//ccr[StringColBox(7)]

//ccr[NumberColBox(9)]

//ccr[TextBox(6)]

Thanks for your help

1 ACCEPTED SOLUTION

Accepted Solutions
David_Burnham
Super User (Alumni)

Re: jsl: how to combine multiple report in one

There seem to be 3 questions here.

Here is some example code for combining output into a single window:

dt = Open("$SAMPLE_DATA/Semiconductor Capability.jmp");

nw= New Window("Demo",

    container = V List Box()

);

For (i=5,i<8,i++,

    content = V List Box(

        dt << Control Chart(

            Chart Col( Column(i), XBar ),

            Sample Label( :wafer ),

            KSigma( 3 )

        )

    );

    container << Append(content)

);

About saving the report automatically I'll try and answer without working out the detail of your code.  There are two aspects - how to get the right name and how to do the save.  You want to derive the name from multiple components - table name and baseline.  I haven't looked at the detail of what you mean by baseline but the principles are to use character manipulation.  If you want the first 10 letters of the table name you can write:

tableName = dt_data << Get Name;

shortName = Left(tableName,10);

On the basis that you construct another string representing the baseline information (say strBaseline) then you can construct a filename e.g

filename = shortName || "_" || strBaseline || ".pdf";

Then to save the report automatically you can write something like:

nw << Save PDF (filename);

If you want to save it as a JMP Report, I'm not sure how or if that can be done automatically, but you can save it as a journal :

filename = shortName || "_" || strBaseline || ".jrn";

nw << Save Journal(filename);

- Dave

-Dave

View solution in original post

4 REPLIES 4
David_Burnham
Super User (Alumni)

Re: jsl: how to combine multiple report in one

There seem to be 3 questions here.

Here is some example code for combining output into a single window:

dt = Open("$SAMPLE_DATA/Semiconductor Capability.jmp");

nw= New Window("Demo",

    container = V List Box()

);

For (i=5,i<8,i++,

    content = V List Box(

        dt << Control Chart(

            Chart Col( Column(i), XBar ),

            Sample Label( :wafer ),

            KSigma( 3 )

        )

    );

    container << Append(content)

);

About saving the report automatically I'll try and answer without working out the detail of your code.  There are two aspects - how to get the right name and how to do the save.  You want to derive the name from multiple components - table name and baseline.  I haven't looked at the detail of what you mean by baseline but the principles are to use character manipulation.  If you want the first 10 letters of the table name you can write:

tableName = dt_data << Get Name;

shortName = Left(tableName,10);

On the basis that you construct another string representing the baseline information (say strBaseline) then you can construct a filename e.g

filename = shortName || "_" || strBaseline || ".pdf";

Then to save the report automatically you can write something like:

nw << Save PDF (filename);

If you want to save it as a JMP Report, I'm not sure how or if that can be done automatically, but you can save it as a journal :

filename = shortName || "_" || strBaseline || ".jrn";

nw << Save Journal(filename);

- Dave

-Dave
derchieh
Level II

Re: jsl: how to combine multiple report in one

Hi David,

Thank you for the example using "container" and "content"....it makes a lot more sense.

I have a question: with the new window "Demo", why is it I can't see it listed in Window -> Combine Windows as an option to be selected?

Thank you.

Derchieh

 

Re: jsl: how to combine multiple report in one

Combine Windows is really an alternative to the <<Append() method for combining the original reports.  Combine Windows creates a Dashboard (in JMP 13+), and the building block units for Dashboards are Platforms and Data Tables.  If you would like to create a Dashboard, it would be better to start with the individual platform windows rather than a window where they have already been combined.

derchieh
Level II

Re: jsl: how to combine multiple report in one

I see. Thank you.