새로 만든 열에 있는 색칠된 셀의 행 번호를 구하고 태그(예: "1")를 지정하는 방법은 무엇입니까?저는 Color Out of Spec Values()를 사용하여 측정 데이터에서 실패한 색상을 지정합니다. 측정 데이터가 있는 여러 열이 있고 각 열의 out of spec 값은 각 매개변수 열의 사양에 따라 색상이 지정됩니다.
각 매개변수 열에 대해 셀이 색칠되면 "1"을 할당하고 그렇지 않으면 "0"을 할당하는 인접 열을 만들고 싶습니다.
JSL을 통해 이를 어떻게 달성할 수 있을까?
자동화 및 스크립팅윈도우Re: 새로 만든 열에 있는 색칠된 셀의 행 번호를 구하고 태그(예: "1")를 지정하는 방법은 무엇인가요?와우, 좋은 아이디어네요. 칼럼 스크립트를 통해서요!
JMP의 멋진 점:
해결 방법 : )
JMP의 별로 멋지지 않은 점:
해결 방법을 위한 해결 방법입니다.
Color를 통해 우회 없이 사양 밖의 값을 직접 얻으려면 :folded_hands: is in spec (value)에 투표하세요.
Re: 새로 만든 열에 있는 색칠된 셀의 행 번호를 구하고 태그(예: "1")를 지정하는 방법은 무엇인가요?For 루프를 사용하지 말고 << 선택한 열 이동을 사용하여 지정된 열 뒤로 열을 이동합니다.
더 보기...
Names Default To Here(1);
get_colored_cells = Function({dt, colname}, {Default Local},
colscript = Column(dt, colname) << Get Script;
l = Substitute(Name Expr(colscript), Expr(New Column()), List());
colored_cells = {};
Try(
colors = l["Color Cells"];
If(Type(colors[1]) == "List",
jmptrickery = 1,
jmptrickery = 0
);
For Each({color}, colors,
If(jmptrickery,
Insert Into(colored_cells, color[2]),
Insert Into(colored_cells, color)
)
);
);
Return(Matrix(colored_cells));
);
create_failed_column_after = function({dt, colname}, {Default Local},
curname = Column(dt, colname) << get name;
failed_rows = get_colored_cells(dt, colname);
row_vals = J(1, N Rows(dt), 0);
row_vals[failed_rows] = 1;
new_col = dt << New Column((curname || "_FAIL"), Numeric, Nominal, Values(row_vals));
dt << Move Selected Columns(new_col, After(Column(dt, colname)));
return(new_col);
);
dt = Open("$SAMPLE_DATA/Semiconductor Capability.jmp");
col_names = dt << Get Column Group("Processes");
dt << show window(0);
wait(0);
ps = dt << Process Screening(
Process Variables(Eval(col_names)),
Spec Limits Dialog("No (skip columns with no spec limits)")
);
ps << Color Out Of Spec Values(1);
ps << Close Window;
dt << Clear Select << Clear Column Selection;
For Each({colref}, col_names,
colname = colref << get name;
create_failed_column_after(dt, colname);
);
dt << show window(1);
wait(0);
Re: 새로 만든 열에 있는 색칠된 셀의 행 번호를 구하고 태그(예: "1")를 지정하는 방법은 무엇인가요?@jthi 고맙습니다. 저는 귀하의 스크립트를 제 스크립트와 매우 유사한 데이터세트에 사용하도록 조정했습니다. 한 열 이름에는 잘 작동하지만 열 이름을 반복할 때는 작동하지 않습니다. 또한 루프 내에서 작업이 수행되는 열 옆(오른쪽)에 새로 생성된 각 열을 어떻게 배치합니까?
Names Default To Here( 1 );
Clear Log();
dt = Open( "$SAMPLE_DATA/Semiconductor Capability.jmp" );
col_names = dt << Get Column Group( "Processes" );
ps = dt << Process Screening(
Process Variables( Eval( col_names ) ),
Spec Limits Dialog( "No (skip columns with no spec limits)" ),
);
ps << Color Out Of Spec Values (1);
t = ps << Get Window Title; //Show( t );
ps << Close Window;
dt << Clear Select << Clear Column Selection;
get_colored_cells = Function({dt, colname}, {Default Local},
colscript = Column(dt, colname) << Get Script;
l = Substitute(Name Expr(colscript), Expr(New Column()), List());
colored_cells = {};
Try(
colors = l["Color Cells"];
If(Type(colors[1]) == "List",
jmptrickery = 1;
,
jmptrickery = 0;
);
For Each({color}, colors,
If(jmptrickery,
Insert Into(colored_cells, color[2]);
,
Insert Into(colored_cells, color);
);
);
);
return(Matrix(colored_cells));
);
measColNames = dt << get column names(Numeric,Continuous ); show (measColNames[1]);
For( i = 1, i <= N Items( measColNames), i++,
rows = J( 1, N Rows( dt ), 0 );
colored_rows = get_colored_cells( dt, measColNames[i]);
rows[colored_rows] = 1;
dt << New Column( "PassFail"||measColNames[i], Numeric, Nominal, Values( rows ) );
);
//colname = "NPN1";
///// for single column
/*rows = J(1, N Rows(dt), 0);
colored_rows = get_colored_cells(dt, colname);
rows[colored_rows] = 1;
dt << New Column("result", Numeric, Nominal, Values(rows));*/
Re: 새로 만든 열에 있는 색칠된 셀의 행 번호를 구하고 태그(예: "1")를 지정하는 방법은 무엇인가요?이는 한 열에 대한 상황을 어떻게 처리할 수 있는지에 대한 아이디어를 제공합니다.
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
a = {1, 3, 5};
b = {2, 4, 6};
c = {7, 8, 9};
:height << color cells({{"Red", a}, {"blue", b}, {"yellow", c}});
:weight << color cells({{"Red", a}});
:age << color cells({{"Red", a}, {"blue", b}});
get_colored_cells = Function({dt, colname}, {Default Local},
colscript = Column(dt, colname) << Get Script;
l = Substitute(Name Expr(colscript), Expr(New Column()), List());
colored_cells = {};
Try(
colors = l["Color Cells"];
If(Type(colors[1]) == "List",
jmptrickery = 1;
,
jmptrickery = 0;
);
For Each({color}, colors,
If(jmptrickery,
Insert Into(colored_cells, color[2]);
,
Insert Into(colored_cells, color);
);
);
);
return(Matrix(colored_cells));
);
colname = "age";
// for single column
rows = J(1, N Rows(dt), 0);
colored_rows = get_colored_cells(dt, colname);
rows[colored_rows] = 1;
dt << New Column("result", Numeric, Nominal, Values(rows));
그런 다음 루프를 돌 때 각 열에 색상을 입히기 위해 추가 열을 만들 수 있습니다.