To verify my approach, I created a data table with the same columns your data table has, then I ran your Data Filter, Subset and Control Chart Code, with my 2 changes, and it worked without issue. Here is the copy of your code with my 2 changes. The 2 changes are that I added "cc=" in front of the control chart platform so I could reference it to get the control chart to save. The second change is the "report(cc) << save picture(................." at the end of the script. That line will have to be changed to point to a folder path where you can save the output jpg. Attached is the jpg file the script produced.
Open(
"R:\Operations\Engineering\FTP DATA\FT_LPC_Results.txt",
Date = Numeric,
Time = Numeric,
Lot # = Character,
Part # = Character,
Brush # = Character,
Station # = Numeric,
LPC = Numeric,
Column 8 = Numeric,
Column 9 = Numeric,
Column 10 = Numeric,
Column 11 = Numeric,
Column 12 = Numeric,
Column 13 = Numeric,
Column 14 = Numeric,
Column 15 = Numeric,
Column 16 = Numeric,
Column 17 = Character
),
End Of Line( CRLF, CR, LF ),
End Of Field( Tab, Comma ),
Strip Quotes( 1 ),
Use Apostrophe as Quotation Mark( 0 ),
Scan Whole File( 1 ),
Labels( 1 ),
Column Names Start( 1 ),
Data Starts( 2 ),
Lines To Read( All ),
Year Rule( "10-90" )
);
Current Data Table() << Data Filter(
Add Filter(
columns( :Part # ),
Where( :Part # == "H2FEN-70-31NM-0317" ),
Display( :Part #, Size( 204, 259 ), List Display )
);
Data Table( "FT_LPC_Results" ) << Subset( Copy formula( 0 ) );
cc=Control Chart(
Sample Label( :Lot # ),
Sample Size( 1 ),
KSigma( 3 ),
Chart Col( :Name( "LPC >0.1" ), Run Chart( Show Center Line( 0 ) ) ),
Dispatch( {}, "Run Chart of LPC >0.1", OutlineBox, Set Title( "H2FEN-70-31NN-0317 - LPC" ) ),
{"Run Chart of LPC >0.1"},
"2",
ScaleBox,
{Min( 100.2945275076211 ), Max(130.92103353172 ), Inc( 250 ),
Add Ref Line( 2000, Solid, {255, 0, 0}, "USL 2000" )}
),
{"Run Chart of LPC >0.1"},
"1",
ScaleBox,
{Min( 15230.3237 ), Max( 19677.7118706835 ), Inc( 8 ), Rotated Labels( 1 )}
),
Dispatch( {"Run Chart of LPC >0.1"}, "Run Chart", FrameBox, Frame Size( 897, 415 ) ),
Dispatch( {"Run Chart of LPC >0.1"}, "Run Chart", FrameBox( 2 ), Frame Size( 69, 415 ) );
report(cc) << save picture("<change this to the path you want to use>\thepicture.jpg");
Jim