표시기의 색상여러분, 안녕하세요,
JMP에서 특정 프로세스의 편차를 확인할 수 있는 보고서를 작성하려고 합니다.
예를 들어, 프로세스에서 6개 항목을 연구하고 색상이 있는 표시기를 갖고 싶습니다.
- 연속된 5개 이상의 포인트가 3시그마보다 큰 경우 : 빨간색
- 3개의 연속된 포인트(또는 그 이상)가 3시그마보다 큰 경우: 노란색
- 그렇지 않으면 녹색
그런 다음 표시기의 색상에 따라 항목별로 다음과 같은 내용을 보고서에 표시하고 싶습니다.

JMP에서 비슷한 기능을 구현하려면 어떻게 해야 합니까?
응답해 주셔서 감사합니다.
자동화 및 스크립팅답: 표시기의 색상각 "항목"이 별도의 열에 있습니까?
귀하의 데이터는 순차적으로 정렬되어 있습니까?
"아이템"은 몇 개나 있나요?
보고서의 각 행에 3개의 다른 항목만 있어야 합니까?
답: 표시기의 색상표를 만들고 싶다면 데이터 테이블을 사용하고 셀에 색을 칠하세요. 그래프 빌더에서 히트맵을 사용할 수도 있습니다. 스크립트를 만들고 싶다면 배경색을 설정할 수 있는 다양한 옵션이 있습니다.
답: 표시기의 색상각 "항목"이 별도의 열에 있습니까? 예, 열당 한 항목
데이터가 순차적으로 정렬되어 있습니까? 예, 순차적으로 정렬할 수 있습니다.
얼마나 많은 다른 "아이템"이 있나요? 많은... .
보고서의 각 행에 3개의 다른 항목만 있어야 합니까? 예
답: 표시기의 색상간단한 옵션 중 하나는 다음과 같습니다.
Names Default To Here(1);
dt = New Table("Untitled",
Add Rows(6),
Compress File When Saved(1),
New Column("item",
Character,
"Nominal",
Set Values({"ITEM1", "ITEM2", "ITEM3", "ITEM4", "ITEM5", "ITEM6"})
),
New Column("status",
Character,
"Nominal",
Set Values({"Green", "Green", "Red", "Yellow", "Green", "Red"})
)
);
lub = Lineup Box(N Col(3));
For Each Row(dt,
Eval(EvalExpr(
lub << Append(
Text Box(:item, << Background Color(Expr(:status)))
)
));
);
nw = New Window("",
lub
);

답: 표시기의 색상답변 감사합니다. 빨간색, 노란색, 녹색 표시기가 있는 비슷한 표를 만들려고 합니다.
내 목표는 다음을 만드는 것입니다.
- 연속된 5개 점(또는 그 이상)이 빨간색(3시그마 이상)인 경우 마지막 점의 색상은 빨간색입니다.
- 연속된 3개 점(또는 그 이상)이 빨간색(3시그마 이상)인 경우 마지막 점의 색상은 노란색입니다.
- 그 외에는 녹색
첨부 파일에서 예제로 사용되는 표를 찾을 수 있습니다. 다음 스크립트를 만들었지만 성공하지 못했습니다.
dt = current data table();
// Créez une nouvelle colonne pour l'indicateur
dt << New Column("Indicateur", Character, Nominal);
// Boucle pour calculer l'indicateur ligne par ligne
For(i = 1, i <= N Rows(5), i++,
// Récupérer les 5 dernières valeurs de l'indicateur
last_five = dt:status[i,5]; //
// Comptez le nombre de "rouge"
count_rouge = N Items( last_five == "rouge");
// Attribuer une couleur en fonction des règles
If(count_rouge == 5,
dt:Indicateur Global[i] = "rouge"; // 5 rouges
,
If(count_rouge >= 3,
dt:Indicateur Global[i] = "jaune"; // 3 ou plus rouges
,
dt:Indicateur Global[i] = "vert"; // Sinon vert
);
);
);답: 표시기의 색상이 코드는 당신이 원하는 기능을 수행한다고 생각합니다:
dt = New Table( "testcolors", Add Rows( 15 ),
New Column( "Article", Character, "Nominal",
Set Values( {"A", "A", "A", "A", "A", "A", "A", "A", "A", "A", "A", "A", "A", "A", "A"}
) ),
New Column( "Item", Numeric, "Continuous", Format( "Best", 12 ),
Set Values( [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15] )
),
New Column( "status", Character, "Nominal",
Set Values(
{"red", "red", "red", "green", "green", "red", "red", "red", "red",
"red", "red", "green", "red", "red", "red"}
)
),
// Créez une nouvelle colonne pour l'indicateur
New Column("Indicateur", Character, Nominal)
);
one_color = "xyz";
icolor = 0;
for (i = 1, i <= nrows(dt), i++,
one_color = dt:status[i];
if (one_color == "red",
icolor++;
// else
,
if (icolor >= 5,
dt:Indicateur << Color Cells( "Red", i-1 );
icolor = 0;
// else
,
icolor >= 3,
dt:Indicateur << Color Cells( "Yellow", i-1 );
icolor = 0;
);
);
);
// Handle the last row
if (icolor >= 5,
dt:Indicateur << Color Cells( "Red", i-1 );
// else
,
icolor >= 3,
dt:Indicateur << Color Cells( "Yellow", i-1 );
);

답: 표시기의 색상저는 여전히 혼란스럽습니다. 그러나 귀하가 제공한 데이터 테이블은 귀하가 계산하려고 하는 결과를 담고 있는 테이블인 듯하므로 귀하의 Indicateur 열에 대한 셀을 쉽게 색칠할 수 있습니다.

names default to here(1);
dt=current data table();
dt << New Column("Indicateur", Character, Nominal);
:indicateur << color cells("red",dt<<GET rows="" where=""></GET>
<P>또는 별도의 보고서를 생성할 수 있습니다</P>
<P><SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="txnelson_1-1736426542617.png" style="width: 400px;"><SPAN class="lia-inline-image-display-wrapper" image-alt="txnelson_1-1736426542617.png" style="width: 119px;"><SPAN class="lia-inline-image-display-wrapper" image-alt="txnelson_1-1736426542617.png" style="width: 119px;"><SPAN class="lia-inline-image-display-wrapper" image-alt="txnelson_1-1736426542617.png" style="width: 119px;"><SPAN class="lia-inline-image-display-wrapper" image-alt="txnelson_1-1736426542617.png" style="width: 119px;"><SPAN class="lia-inline-image-display-wrapper" image-alt="txnelson_1-1736426542617.png" style="width: 119px;"><SPAN class="lia-inline-image-display-wrapper" image-alt="txnelson_1-1736426542617.png" style="width: 119px;"><span class="lia-inline-image-display-wrapper" image-alt="txnelson_1-1736426542617.png" style="width: 119px;"><img src="https://us.v-cdn.net/6038925/uploads/images/71760iF5D0EC4B9B8E8098/txnelson_1-1736426542617.png" role="button" title="txnelson_1-1736426542617.png" alt="txnelson_1-1736426542617.png" /></span></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></P>
<CODE class=" language-jsl">nw=new window("colors", lub=lineupbox(ncol(3)));
For Each Row(dt,
Eval(EvalExpr(
lub << Append(
Text Box("Item" || char(:item), << Background Color(Expr(:status)))
)
));
);답: 표시기의 색상안녕하세요. 답변 감사드립니다. 이 테스트 기반에서는 잘 작동합니다!
여러 기사가 있을 때 이 스크립트를 일반화하려고 합니다. 색상 표시기는 항목별로 생성됩니다.
다음 스크립트를 사용하지만 올바른 최종 결과를 얻지 못합니다.
dt = current data table();
// Créez une nouvelle colonne pour l'indicateur
dt << New Column("Indicateur", Character, Nominal)
one_color = "xyz";
icolor = 0;
Summarize(dt, unique_objects = by(:Article));
m_obs = dt[0, "Article"];
For each( {unique_objects}, m_obs,
for (i = 1, i <= nrows(dt), i++,
one_color = dt:status[i];
if (one_color == "red",
icolor++;
// else
,
if (icolor >= 5,
dt:Indicateur << Color Cells( "Red", i-1 );
icolor = 0;
// else
,
icolor >= 3,
dt:Indicateur << Color Cells( "Yellow", i-1 );
icolor = 0;
);
);
);
// Handle the last row
if (icolor >= 5,
dt:Indicateur << Color Cells( "Red", i-1 );
// else
,
icolor >= 3,
dt:Indicateur << Color Cells( "Yellow", i-1 );
);
);얻은 결과:

기사 B에 빨간색 점이 3개 연속으로 있으므로 18행은 노란색이어야 합니다.
답: 표시기의 색상내 접근 방식은 다음과 같습니다.

names default to here(1);
dt = current data table();
// Créez une nouvelle colonne pour l'indicateur
dt << New Column("Indicateur", Character, Nominal);
one_color = "xyz";
icolor = 0;
For Each Row(
// If the value of Article has changed set icolor to 0
If( Lag( :Article ) != :Article,
icolor = 0
);
// If status is red, increment icolor else set it back to zero
If( :status == "red",
icolor++,
icolor = 0
);
// Check for the number of icolor
// Set the value for the cell to the appropriate color
// When a color is specified remove no longer correct cell colors
// for previous rows
If(
icolor >= 5,
dt:Indicateur << color cells("red",row());
dt:Indicateur << color cells("",row()-1);
If( icolor == 5,
dt:Indicateur << color cells("",row()-2);
);,
icolor >= 3,
dt:Indicateur << color cells("yellow",row());
dt:Indicateur << color cells("",row()-1);
);
);답: 표시기의 색상응답해 주셔서 감사합니다.
작동하지만 정확히 원하는 대로 작동하지는 않습니다.
두 번째 if 루프를 변경하려고 시도했지만 해결책을 찾을 수 없습니다.
내가 달성하고 싶은 정확한 결과는 다음과 같습니다.

답: 표시기의 색상제 마지막 스크립트는 계산된 색상을 유지하기 위해 시리즈의 마지막 행만 원한다고 가정했습니다. 귀하의 최신 사양을 달성하기 위해 스크립트가 시리즈의 마지막 행이 아니라고 판단한 경우 색상을 재설정하는 줄을 주석 처리했습니다.

names default to here(1);
dt = current data table();
// Créez une nouvelle colonne pour l'indicateur
dt << New Column("Indicateur", Character, Nominal);
one_color = "xyz";
icolor = 0;
For Each Row(
// If the value of Article has changed set icolor to 0
If( Lag( :Article ) != :Article,
icolor = 0
);
// If status is red, increment icolor else set it back to zero
If( :status == "red",
icolor++,
icolor = 0
);
// Check for the number of icolor
// Set the value for the cell to the appropriate color
// When a color is specified remove no longer correct cell colors
// for previous rows
If(
icolor >= 5,
dt:Indicateur << color cells("red",row());
//dt:Indicateur << color cells("",row()-1);
/*If( icolor == 5,
dt:Indicateur << color cells("",row()-2);
);*/,
icolor >= 3,
dt:Indicateur << color cells("yellow",row());
//dt:Indicateur << color cells("",row()-1);
);
);답: 표시기의 색상이것이 더 이상 초기 질문과 어떻게 관련이 있는지 확실하지 않지만 지표 열을 만드는 데 약간 다른 옵션이 있습니다.
dt = Current Data Table();
dt << New Column("Color", Character, Nominal,
Set Property(
"Value Colors",
{"Green" = "Green", "Red" = "Red", "Yellow" = "Yellow"}
),
Color Cell By Value,
Formula(
is_red = :status == "red";
If(Row() == 1,
red_count = is_red;
);
If(:Article != Lag(:Article, 1) | is_red == 0,
red_count = is_red;
,
red_count = red_count + is_red;
);
If(red_count >= 5,
"Red";
, red_count >= 3,
"Yellow"
,
"Green"
);
)
);