Choose Language Hide Translation Bar
Highlighted
CharlesIII
Community Trekker

Creating Control Charts in a loop

Hello, 

I have a large data table that I need to create control charts for. I need a new control chart for every column with the first column in the data table being the Sample Label. 

 

I have searched and found similar posts that I tried to recreate for my purpose but haven't had any luck. If someone could tell me where I am going wrong with my code that would be great. 

 

I am still pretty new to jmp scripting so please feel free to tell me if I am using sloppy syntax as well.

 

 

Current Data Table(dt5);
Rcols = dt5 << GetColumnNames(Numeric);
nw= New Window("Control Charts", myVLB = V List Box());
For(i=1, i<=nitems(Rcols), i++,
cc = Control Chart(
Sample Label( Column(dt5, Rcols[1] ) ),
KSigma( 3 ),
Chart Col( Column( Rcols[i] ) ),
Levey Jennings);

myVLB << Append(Report(cc));
);

 

0 Kudos
1 ACCEPTED SOLUTION

Accepted Solutions
txnelson
Super User

Re: Creating Control Charts in a loop

try this one

Names Default To Here( 1 );
dt5 = Current Data Table();
Rcols = dt5 << GetColumnNames( Numeric );

nw = New Window( "Control Charts", myVLB = V List Box() );

For( i = 1, i <= N Items( Rcols ), i++, 

	cc = Control Chart(
		Sample Label( Column( dt5, Rcols[1] ) ),
		KSigma( 3 ),
		Chart Col( Column( dt5, Rcols[i] ), Levey Jennings )
	);

	myVLB << Append( Report( cc ) );
	cc << close window;
);
Jim

View solution in original post

2 REPLIES 2
txnelson
Super User

Re: Creating Control Charts in a loop

try this one

Names Default To Here( 1 );
dt5 = Current Data Table();
Rcols = dt5 << GetColumnNames( Numeric );

nw = New Window( "Control Charts", myVLB = V List Box() );

For( i = 1, i <= N Items( Rcols ), i++, 

	cc = Control Chart(
		Sample Label( Column( dt5, Rcols[1] ) ),
		KSigma( 3 ),
		Chart Col( Column( dt5, Rcols[i] ), Levey Jennings )
	);

	myVLB << Append( Report( cc ) );
	cc << close window;
);
Jim

View solution in original post

CharlesIII
Community Trekker

Re: Creating Control Charts in a loop

Awesome this worked thank you! 

0 Kudos