BookmarkSubscribeRSS Feed
gail_massari

Community Manager

Joined:

Feb 27, 2013

Easily create script to update control charts (or other charts) -- no JSL background needed

Need to run control charts on updated data regularly?

In his demo at a live Mastering JMP webinar on Tracking and Trending Manufacturing Metrics, Systems Engineer Byron Wingerd @Byron_JMP showed how to import production data from Excel, format data for analysis, run control charts, publish them to PowerPoint, and very easily create a script to do that all with several clicks when data is updated.

The video shows the whole process.

(view in My Videos)

I’ve summarized the scripting part below because it is easy to do and applicable for many JMP reports that you want to generate using updated data.

To begin, we assume you have let JMP create the scripts for your work as you imported data, formatted the data for analysis, run reports and saved them to PPT. Then:

  • Create a place for the script that you will ultimately use to rerun reports.
    1. File>New Script
  • From JMP Scripting Index, copy and add JSL code for saving PowerPoint.
    1. Select Help>Scripting Index.
    2. Search ‘save PowerPoint,’’ which finds code for ‘Save Presentation.’
    3. Copy code from the window that pops up with sample code for ‘Save Presentation.’
    4. Paste code into top of New Script window. 
  • Remove JSL code (lines 2 and 3) that would open Big Class data and run a bivariate script.
    1. Highlight lines 2 and 3, delete, add a few carriage returns.
  • Copy and add JSL code that will import your Excel data.
    1. From the Tables panel of the JMP Table where you imported the Excel data, right-click Source, then select Edit.
    2. Copy the code displayed in the Edit window.
    3. Paste copied code in New Script, Line 2.
    4. Add a semicolon at the end to indicate the end of a JSL code block.
  • Copy and add JSL code that will reformat the data as needed for the analysis.
    1. From the Tables panel of the JMP Table where you re-formatted (split and grouped) the data, right-click Source, then select Edit.
    2. Copy the code displayed in the Edit window.
    3. Paste copied code in New Script window, after the semicolon that indicates the end of the data import JSL code block.
    4. Add a semicolon at the end to indicate the end of this JSL code block.
  • Copy and add code that will create Control Charts.
    1. From the Control Chart window, right-click the Control Chart Builder red triangle, then select Save Script>To the Clipboard.
    2. Paste code in New Script window, after the semicolon that indicates the end of the reformatted data JSL code block.
    3. Add a semicolon at the end to indicate the end of this JSL code block.

Now make minor edits to the new script:

1. Create a variable called dt1 that will refer to the Excel file you will import.

 Add dt1=.JPG

2. Create a variable called dt2 by splitting table dt1. Going forward, dt2 will refer to the reformatted (split and grouped) table, no matter what you may call that table. Note: << means Send To, so the Split instructions are going to be sent to dt1, and the split table will be dt2.

Create dt2.JPG

3. Send the Control Chart Builder script instructions to dt2.

dt2 Control Chart Builder.JPG

 4. Identify the Control Chart Builder reports as an object.

Create Control Chart 2 Object.JPG

5. Create a report object variable (in the PowerPoint code you used to start New Script) to refer to the Control Charts and save the Presentation.

Create Report Object.JPG

6. Remove path so New Script will save PowerPoint presentation to same directory where New Script will live.

Remove path for PowerPoint Report to match path where new script will live.JPG

7. Name and save the New Script you created. File>Save As>yourscriptname.jsl