Names Default to Here(1); Clear Globals(); Clear Log(); //Constants todaysdate = format(today(), "yyyymmdd"); todaystime = ( if(hour(Today())<10,"0" || char(hour(Today())), char(hour(Today()))) || if(minute(Today())<10,"0" || char(minute(Today())), char(minute(Today()))) || if(second(Today())<10,"0" || char(second(Today())), char(second(Today()))) ); Products = {"A", "B", "C", "D", "E", "F", "G"}; numProducts = length( Products ); //Set up directory where output files will be saved pathname = ""; pathname = Pick Directory("Select a directory to save image files.") //, "C:\20190426 JMP Discovery Summit\"); //Change the directory pathname2 = pathname || "Reliability Analysis " || todaysdate || "-" || todaystime; //Open data table and clear all selections dt = Open(pathname || "\Data Table 2.jmp"); //this is where you place the data table dt << Clear Select() << Clear Column Selection; //Produce a Reliabiliy Graph with the data, grouped by Product ld = dt << Life Distribution( Perspective( Compare Groups ), Y( :Hours ), Grouping( :Product ), Censor( :Name( "Failure?" ) ), Censor Code( 0 ), Confidence Interval Method( Wald ), Select Distribution( Distribution, Nonparametric ), Select Scale( Nonparametric ), Tabbed Report( 0 ), // Show Confidence Area( 0 ), SendToReport( Dispatch( {"Life Distribution - Compare Groups", "Compare Distribution"}, "1", ScaleBox, {Min( 0 ), Max( 3000 ), Inc( 500 ), Minor Ticks( 0 )} ), Dispatch( {"Life Distribution - Compare Groups", "Compare Distribution"}, "2", ScaleBox, {Format( "Percent", 12, 0 ), Min( 0 ), Max( 0.3 ), Inc( 0.05 ), Minor Ticks( 0 )} ) ) ); //Finish up Create Directory(pathname2); //Get and save the portion of the output that is wanted rep = ld << Report(); pic = rep[Layout Atom Box( 1 )]; pic << Save Picture( pathname2 || "/01a - All Products.emf", "emf" ); //Disable the confidence interval area and save the graph ld << Show Confidence Area (0); pic = rep[Layout Atom Box( 1 )]; pic << Save Picture( pathname2 || "/01b - All Products.emf", "emf" ); //Pause the code if there are many records Wait( 5 ); //Add a data filter df = dt << Data Filter( Mode( Select( 0 ), Show( 1 ), Include( 1 ) ), Add Filter( columns( :Product ), Display( :Product, Size( 159, 105 ), List Display ) ) ); //Loop through each Product and save the graphics For (i= 1, i <= numProducts, i++, ThisProduct = Products[i]; df << Match ( Filter Columns ( :Product ), Where ( :Product == ThisProduct ) ); rep = ld << Report(); pic = rep[Layout Atom Box( 1 )]; pic << Save Picture( pathname2 || "/02 - " || ThisProduct || ".emf", "emf" ); ); //Clear the data filter df << Clear; //Write Title slide Blanks = text box(""); titlebox = text box("Record of Analysis for 2019 JMP Statistical Discovery Summit", << set font size(16), justify text(center), << font color({0,0,0.5})); datebox = text box("Date and Time: " || format(today(), "ddMonyyyy") || " at " || Format(Time Of Day( today() ), "h:m:s"), justify text(center), << font color({0,0,0.5})); numproductsbox = text box("Number of Products: " || char(numProducts)); lub = lineupbox(ncol(1), titlebox, Blanks, datebox, Blanks, numproductsbox, Blanks); lub << journal; lub << Save picture (pathname2 || "/00 - Setup.emf", emf); //Launch PowerPoint dt99 = Open(pathname || "\IMPORT file 20191007.pptm"); //Clean up Close All(Journals, NoSave); Close(dt, NoSave);