해결해야 하는 문제는 알 수 없는 수의 Y 열을 처리한 다음 알 수 없는 수의 Y 열을 컨트롤 차트 빌더에 삽입하는 방법입니다.아래는 그렇게하는 한 가지 방법입니다
/* Query the user for X and Y columns */
cdlg = Column Dialog(
yCol = ColList( "Y, Response", MinCol( 1 ), MaxCol( 25 ), Data Type( "Numeric" ) ),
xCol = ColList( "X, Factor", MinCol( 1 ), MaxCol( 1 ) )
);
// There isn't a need to unload the values from the Column Dialog
/* Unload the values from the Column Dialog */
/*my_Y1 = cdlg["yCol"][1];
my_Y2 = cdlg["yCol"][2];
my_Y3 = cdlg["yCol"][3];
my_Y4 = cdlg["yCol"][4];
my_Y5 = cdlg["yCol"][5];
my_Y6 = cdlg["yCol"][6];
my_Y7 = cdlg["yCol"][7];
my_Y8 = cdlg["yCol"][8];
my_Y9 = cdlg["yCol"][9];
my_Y10 = cdlg["yCol"][10];
my_Y11 = cdlg["yCol"][11];
my_Y12 = cdlg["yCol"][12];
my_Y13 = cdlg["yCol"][13];
my_X = cdlg["xCol"][1];*/
// What is returned from the ColDialog for yCol is a list of columns in the
// form of expressions, not strings. Control Chart builder does not seem to
// like processing of lists of a length greater than 1. So to get around that
// I take the list and convert it into a single character string. I have found
// the fastest way to do this is to strip off the "{}" from the list leaving
// everything inside of the list as a single string
temp = Substr( Char( cdlg["yCol"] ), 2, Length( Char( cdlg["yCol"] ) ) - 2 );
/* Use the column selections in an analysis */
// Build a character string that is the complete command string
// to run the Control Chart Builder, inserting the above created
// temp variable and then run it.
Eval(
Parse(
"Control Chart Builder(
Show Two Shewhart Charts( 0 ),
Sort by Row Order( 1 ),
Connect Thru Missing( 1 ),
Variables(
Subgroup(eval(cdlg[\!"xCol\!"])),
Y("
|| temp ||
")),
Chart(
Points( Statistic( \!"Individual\!" ) ),
Limits( Sigma( \!"Levey Jennings\!" ) ),
Process Capability Analysis(
Within Sigma Capability( 0 ),
Histogram( 1, Show Within Sigma Density( 0 ) )
)
));"
)
);
;나는 이것이 매우 기본적인 요청이라는 것을 알고 있지만 나는 코딩이 처음이고 마지막 허들에서 약간 당황했습니다.
저는 품질 엔지니어가 하나의 테이블에서 데이터를 가져오고, 테이블을 분할하고, 다른 테이블에서 사양 및 제어 한계를 추가한 다음 그들을 위해 생성할 제어 차트를 갖도록 추가 기능을 작성했습니다. 열을 선택하는 대화 상자가 있거나 모든 숫자/연속 열이 플롯됩니다.
문제는 제품에 따라 다르고 일반 추가 기능을 원하기 때문에 이름과 열 수가 매번 달라지는 것입니다.
이것은 저를 괴롭히는 마지막 코드입니다. 규정된 수의 열(이 경우 13개)로 작동하도록 할 수 있지만 임의의 수를 원합니다.나는 몇 줄의 간단한 코드가 필요하다는 것을 알고 있지만 그것에 대해 머리를 감을 수 없습니다.도움을 주셔서 감사합니다.
/* Query the user for X and Y columns */
cdlg = Column Dialog(
yCol = ColList( "Y, Response", MinCol( 1 ), MaxCol( 25 ), Data Type( "Numeric" ) ),
xCol = ColList( "X, Factor", MinCol( 1 ), MaxCol( 1 ) )
);
/* Unload the values from the Column Dialog */
my_Y1 = cdlg["yCol"][1];
my_Y2 = cdlg["yCol"][2];
my_Y3 = cdlg["yCol"][3];
my_Y4 = cdlg["yCol"][4];
my_Y5 = cdlg["yCol"][5];
my_Y6 = cdlg["yCol"][6];
my_Y7 = cdlg["yCol"][7];
my_Y8 = cdlg["yCol"][8];
my_Y9 = cdlg["yCol"][9];
my_Y10 = cdlg["yCol"][10];
my_Y11 = cdlg["yCol"][11];
my_Y12 = cdlg["yCol"][12];
my_Y13 = cdlg["yCol"][13];
my_X = cdlg["xCol"][1];
/* Use the column selections in an analysis */
Control Chart Builder(
Show Two Shewhart Charts( 0 ),
Sort by Row Order( 1 ),
Connect Thru Missing( 1 ),
Variables(
Subgroup(my_X ),
Y(my_Y1,my_Y2,my_Y3,my_Y4,my_Y5,my_Y6,my_Y7,my_Y8,my_Y9,my_Y10,my_Y11,my_Y12,my_Y13)),
Chart(
Points( Statistic( "Individual" ) ),
Limits( Sigma( "Levey Jennings" ) ),
Process Capability Analysis(
Within Sigma Capability( 0 ),
Histogram( 1, Show Within Sigma Density( 0 ) )
)
));