정의된 날짜 범위에 대한 분포 추적 차트 플로팅안녕하세요 여러분,
다들 잘 지내시길 바랍니다! 질문이 있어서 도와주시면 정말 감사하겠습니다.
저는 특정 날짜 범위에 걸쳐 NOK 백분율을 보여주는 NOK 추적 차트를 만드는 함수를 작업해 왔습니다. 제가 함수에서 하기를 원하는 것에 대한 간단한 요약은 다음과 같습니다.
- 현재 월의 시작 및 종료 날짜를 가져옵니다.
- 다음으로 각 날짜별 NOK 백분율을 저장할 새 테이블을 만듭니다. 이는 해당 월의 시작부터 오늘까지 매일을 검토합니다.
- 그런 다음 날짜와 해당 NOK 백분율을 새 표에 삽입합니다.
- 마지막으로, 해당 날짜 범위에 따른 NOK 백분율을 보여주는 선 그래프를 만듭니다.
대부분의 기능은 정상적으로 작동하고 있지만, 약간의 문제가 발생했습니다.
TOP5:get_dates = Function({},
today_date = Format(Today(), "yyyy-mm-dd");
start_of_month = Format(Date Increment(Today(), "Month", 0, "Start"), "yyyy-mm-dd");
evallist({start_of_month, today_date});
);
TOP5:calculate_nok_percentages = Function({dt},
{start_of_month, today_date} = TOP5:get_dates();
dt_top5 = dt << Summary(
Group(:Date, :Nom de fichier, :Ref Produit, :ProductName, :Baie, :ICT_FCT, :Result, :Reason Error, :CodeError),
Freq("Aucun(e)"),
Weight("Aucun(e)"),
invisible
);
nameFilesNok = Associative Array(Column(dt_top5, "Nom de fichier") << Get Values) << Get Keys;
total_nb_total_ict = 0;
total_nb_total_fct = 0;
total_nb_nok_ict = 0;
total_nb_nok_fct = 0;
For(k = 1, k <= N Items(nameFilesNok), k++,
FileRows = dt_top5 << get rows where(
:File Name == nameFilesNok[k] & Num(Char(:Date)) >= Num(start_of_month) & Num(Char(:Date)) <= Num(today_date) & Contains(:File Name, "GOLDEN") == 0
);
nb_total_ict = 0;
nb_total_fct = 0;
nb_nok_ict = 0;
nb_nok_fct = 0;
total_rows = N Items(FileRows);
For(j = 1, j <= total_rows, j++,
If(dt_top5:ICT_FCT[FileRows[j]] == "ICT",
nb_total_ict = nb_total_ict + dt_top5:Nb. de lignes[FileRows[j]];
If(dt_top5:Result[FileRows[j]] == "NOK",
nb_nok_ict = nb_nok_ict + dt_top5:Nb. de lignes[FileRows[j]]
);
, dt_top5:ICT_FCT[FileRows[j]] == "FCT",
nb_total_fct = nb_total_fct + dt_top5:Nb. de lignes[FileRows[j]];
If(dt_top5:Result[FileRows[j]] == "NOK",
nb_nok_fct = nb_nok_fct + dt_top5:Nb. de lignes[FileRows[j]]
);
)
);
total_nb_total_ict += nb_total_ict;
total_nb_total_fct += nb_total_fct;
total_nb_nok_ict += nb_nok_ict;
total_nb_nok_fct += nb_nok_fct;
);
percent_nok_ict = (total_nb_nok_ict / total_nb_total_ict) * 100;
percent_nok_fct = (total_nb_nok_fct / total_nb_total_fct) * 100;
Eval List({percent_nok_ict, percent_nok_fct});
);
TOP5:create_nok_tracking_chart = Function({dt},
{start_of_month, today_date} = TOP5:get_dates();
dt_nok = New Table("NOK Percentages",
Add Rows(0),
New Column("Date", Character),
New Column("Percent NOK ICT", Numeric),
New Column("Percent NOK FCT", Numeric)
);
For(i = Num(start_of_month), i <= Num(today_date), i++,
// Correct date formatting
today_str = Format(Date(i), "yyyy-mm-dd");
Eval List({start_of_month, today_date}) = Eval List({today_str, today_str});
result = TOP5:calculate_nok_percentages(dt);
Insert Into(dt_nok,
today_str,
result[1],
result[2]
);
);
Graph Builder(
Size( 700, 500 ),
Show Control Panel( 0 ),
Variables( X( :Date ), Y( :Percent NOK ICT ), Y( :Percent NOK FCT ) ),
Elements(
Line(
X,
Y( 1 ),
Legend( 6 ),
Line Color( "Red" )
),
Line(
X,
Y( 2 ),
Legend( 8 ),
Line Color( "Blue" )
)
),
Legend Position( "Top" )
);
);
나는 다음과 같은 오류 메시지를 받았습니다 :
/*:
Unresolved name: Date JSL when accessing or evaluating "Date JSL". Date JSL( i ) /*###*/

이것을 개선하기 위한 지침이나 팁을 제공해 줄 수 있는 분이 있나요?
정말 감사합니다!
자동화 및 스크립팅윈도우Re: 정의된 날짜 범위에 대한 분포 추적 차트 플로팅문제는 create_nok_tracking_chart 함수에 있습니다
For 루프를 단순화하기 위해 몇 가지 변경을 했지만 불행히도 작동하지 않습니다.
current_date = Date(start_of_month);
While(current_date <= Date(today_date),
// Correct date formatting
today_str = Format(current_date, "yyyy-MM-dd");
result = TOP5:calculate_nok_percentages(dt);
Insert Into(dt_nok,
today_str,
result[1],
result[2]
);
// Increment date by 1 day
current_date = Date Increment(current_date, "Day", 1);
);
Re: 정의된 날짜 범위에 대한 분포 추적 차트 플로팅Date() 함수는 어떤 역할을 하나요?
Re: 정의된 날짜 범위에 대한 분포 추적 차트 플로팅Date()를 사용하여 날짜 목록에서 날짜 객체를 만들었습니다. 제 경우에는 월 초부터 오늘까지의 모든 날짜를 가져오고 Date() 함수는 날짜가 날짜 산술 및 비교를 지원하는 날짜 형식인지 확인합니다.
Re: 정의된 날짜 범위에 대한 분포 추적 차트 플로팅제가 아는 한 JMP에는 Date() 함수가 없습니다(캘린더 상자로 전송할 수 있는 << Date()는 있지만 완전히 다른 것입니다).
Re: 정의된 날짜 범위에 대한 분포 추적 차트 플로팅알겠습니다. 알겠습니다. 그런 경우 다음을 사용할 수 있습니까?
current_date = Format(start_of_month, "yyyy-MM-dd");
While ( current_date <= today_date,
today_str = Format(current_date, "yyyy-MM-dd");
result = TOP5:calculate_nok_percentages(dt);
Insert Into (dt_nok,
today_str
result[1],
result[2]
);
current_date = Date Increment(current_date, "Day", 1);
);Re: 정의된 날짜 범위에 대한 분포 추적 차트 플로팅숫자(datenums)와 문자열을 섞고 있습니다. 저는 get_dates 함수보다 날짜를 처리하는 훨씬 더 강력한 방법을 사용할 것입니다. 날짜를 문자열로 변환하기 때문입니다. 날짜로 유지해야 합니다.
TOP5:get_dates = Function({},
today_date = Format(Today(), "yyyy-mm-dd");
start_of_month = Format(Date Increment(Today(), "Month", 0, "Start"), "yyyy-mm-dd");
evallist({start_of_month, today_date});
);
(저는 여러분에게 이러한 더욱 견고한 방법을 여러 번 예시로 보여드렸습니다.)
Re: 정의된 날짜 범위에 대한 분포 추적 차트 플로팅네, 지금 제가 하려고 하는 게 바로 그것입니다. 날짜 형식을 유지하고 논리를 연구해서 제대로 작동하는지 확인해보겠습니다.
감사합니다. 제 질문이 반복적이고 때로는 어리석게 들린다면 죄송합니다. 제가 인턴십을 위해 두 달 전에 JMP와 JSL 언어를 사용하기 시작했기 때문입니다.
Re: 정의된 날짜 범위에 대한 분포 추적 차트 플로팅정말 헷갈려요. 이 방법을 시도해봤어요:
" ),
Format( "Date Abbrev", 20 )
) << Set Field Width(10);
date = today_date;
While(Num(Char(date)) >= Num(start_of_month),
{percent_nok_ict, percent_nok_fct} = TOP5:calculate_nok_percentages_for_date(dt, date);
dt_results << Add Rows(
{Format(date, "yyyy-mm-dd"), percent_nok_ict, percent_nok_fct}
);
date = Date Increment(date, "day", -1);
);
dt_results;
);
TOP5:calculate_nok_percentages_for_date = Function({dt, specific_date},
{start_of_month, today_date} = TOP5:get_dates();
dt_top5 = dt << Summary(
Group(:Date, :Nom de fichier, :Ref Produit, :ProductName, :Baie, :ICT_FCT, :Result, :Reason Error, :CodeError),
Freq("Aucun(e)"),
Weight("Aucun(e)"),
invisible
);
nameFilesNok = Associative Array(Column(dt_top5, "Nom de fichier") << Get Values) << Get Keys;
total_nb_total_ict = 0;
total_nb_total_fct = 0;
total_nb_nok_ict = 0;
total_nb_nok_fct = 0;
For(k = 1, k <= N Items(nameFilesNok), k++,
FileRows = dt_top5 << get rows where(
:File Name == nameFilesNok[k] & Num(Char(:Date)) >= Num(start_of_month) & Num(Char(:Date)) <= Num(specific_date) & Contains(:File Name, "GOLDEN") == 0
);
nb_total_ict = 0;
nb_total_fct = 0;
nb_nok_ict = 0;
nb_nok_fct = 0;
total_rows = N Items(FileRows);
For(j = 1, j <= total_rows, j++,
If(dt_top5:ICT_FCT[FileRows[j]] == "ICT",
nb_total_ict = nb_total_ict + dt_top5:Nb. de lignes[FileRows[j]];
If(dt_top5:Result[FileRows[j]] == "NOK",
nb_nok_ict = nb_nok_ict + dt_top5:Nb. de lignes[FileRows[j]]
);
, dt_top5:ICT_FCT[FileRows[j]] == "FCT",
nb_total_fct = nb_total_fct + dt_top5:Nb. de lignes[FileRows[j]];
If(dt_top5:Result[FileRows[j]] == "NOK",
nb_nok_fct = nb_nok_fct + dt_top5:Nb. de lignes[FileRows[j]]
);
)
);
total_nb_total_ict += nb_total_ict;
total_nb_total_fct += nb_total_fct;
total_nb_nok_ict += nb_nok_ict;
total_nb_nok_fct += nb_nok_fct;
);
percent_nok_ict = (total_nb_nok_ict / total_nb_total_ict) * 100;
percent_nok_fct = (total_nb_nok_fct / total_nb_total_fct) * 100;
Eval List({percent_nok_ict, percent_nok_fct});
);
그리고 내가 언제 기능을 할 수 있는지:TOP5:Do = Function ({nb_date1, nb_date2},
//Ouverture de la table de données
dt = Open( "/D:/Project JMP/Tables/TableData PY.jmp", invisible );
// Calculate NOK percentages
{percent_nok_ict, percent_nok_fct} = TOP5:calculate_nok_percentages(dt);
// Call the new function to get NOK percentages over time
dt_results = TOP5:calculate_nok_percentages_over_time(dt);
// Display the results table
dt_results << Show Window;Names Default To Here( 1 );
TOP5 = New Namespace(
"TOP5"
);
TOP5:get_dates = Function({},
today_date = Format(Today(), "yyyy-mm-dd");
start_of_month = Format(Date Increment(Today(), "Month", 0, "Start"), "yyyy-mm-dd");
evallist({start_of_month, today_date});
);
TOP5:calculate_nok_percentages = Function({dt},
{start_of_month, today_date} = TOP5:get_dates();
dt_top5 = dt << Summary(
Group(:Date, :Nom de fichier, :Ref Produit, :ProductName, :Baie, :ICT_FCT, :Result, :Reason Error, :CodeError),
Freq("Aucun(e)"),
Weight("Aucun(e)"),
invisible
);
nameFilesNok = Associative Array(Column(dt_top5, "Nom de fichier") << Get Values) << Get Keys;
total_nb_total_ict = 0;
total_nb_total_fct = 0;
total_nb_nok_ict = 0;
total_nb_nok_fct = 0;
For(k = 1, k <= N Items(nameFilesNok), k++,
FileRows = dt_top5 << get rows where(
:File Name == nameFilesNok[k] & Num(Char(:Date)) >= Num(start_of_month) & Num(Char(:Date)) <= Num(today_date) & Contains(:File Name, "GOLDEN") == 0
);
nb_total_ict = 0;
nb_total_fct = 0;
nb_nok_ict = 0;
nb_nok_fct = 0;
total_rows = N Items(FileRows);
For(j = 1, j <= total_rows, j++,
If(dt_top5:ICT_FCT[FileRows[j]] == "ICT",
nb_total_ict = nb_total_ict + dt_top5:Nb. de lignes[FileRows[j]];
If(dt_top5:Result[FileRows[j]] == "NOK",
nb_nok_ict = nb_nok_ict + dt_top5:Nb. de lignes[FileRows[j]]
);
, dt_top5:ICT_FCT[FileRows[j]] == "FCT",
nb_total_fct = nb_total_fct + dt_top5:Nb. de lignes[FileRows[j]];
If(dt_top5:Result[FileRows[j]] == "NOK",
nb_nok_fct = nb_nok_fct + dt_top5:Nb. de lignes[FileRows[j]]
);
)
);
total_nb_total_ict += nb_total_ict;
total_nb_total_fct += nb_total_fct;
total_nb_nok_ict += nb_nok_ict;
total_nb_nok_fct += nb_nok_fct;
);
percent_nok_ict = (total_nb_nok_ict / total_nb_total_ict) * 100;
percent_nok_fct = (total_nb_nok_fct / total_nb_total_fct) * 100;
Eval List({percent_nok_ict, percent_nok_fct});
);
TOP5:calculate_nok_percentages_over_time = Function({dt},
{start_of_month, today_date} = TOP5:get_dates();
dt_results = New Table("NOK Percentages Over Time",
New Column("Date", Numeric),
New Column("Percent_NOK_ICT", Numeric),
New Column("Percent_NOK_FCT", Numeric)
);
// Set the format for the Date column
Column(dt_results, "Date") << Data Type(
Numeric,
Format( "Format Pattern", "<YYYY>-<MM>-<DL><DD>", 10 ),
Input Format( "Format Pattern", "<YYYY>-<MM>-</MM></YYYY></DD></DL></MM></YYYY>
매번 오류가 발생합니다.
제가 하고 싶은 것은 두 번째 함수 TOP5:calculate_nok_percentages_over_time 처럼 NOK 백분율을 계산하는 함수를 만드는 것입니다. 차이점은 이 함수는 오늘 날짜와 월 초 사이의 NOK 백분율을 계산하고, 어제부터 월 초까지, 그리고 월 초에 도달할 때까지 계속 계산한다는 것입니다. 결과는 새 테이블에 저장해야 그래프를 만드는 데 사용할 수 있습니다.
Re: 정의된 날짜 범위에 대한 분포 추적 차트 플로팅어떤 오류가 발생합니까?
Re: 정의된 날짜 범위에 대한 분포 추적 차트 플로팅/*:
'Format'에 접근하거나 평가할 때 1번째 줄의 인수는 숫자형이어야 합니다. Format/*###*/(date, "yyyy-mm-dd").
Re: 정의된 날짜 범위에 대한 분포 추적 차트 플로팅날짜 변수가 문자열이고 Format() 에서 숫자 변수가 있어야 하기 때문에 오류가 발생할 가능성이 가장 높습니다. 제 추측으로는 이 오류에서 비롯된 것입니다.

date는 today_date와 동일하며, today_date는 문자열을 반환하는 TOP5:get_dates()에서 나옵니다. 날짜를 숫자 값으로 유지하면 이러한 모든 문제를 피할 수 있습니다(특히 숫자 값인 Today()에서 시작하는 경우 Num(Char()) 변환을 사용할 필요가 없습니다).
Scripting Guide에서 Date-Time 부분을 읽어보시기를 권장합니다. https://www.jmp.com/support/help/en/18.0/#page/jmp/datetime-functions-and-formats.shtml# 부터 시작하세요.
Re: 정의된 날짜 범위에 대한 분포 추적 차트 플로팅저는 여러분의 제안을 고려하여 이 방법을 시도했습니다. 하지만 여전히 문제가 있습니다. 제 함수는 행에 점이 있는 테이블을 반환합니다.

그리고 나는 지켰다date = today_date;왜냐하면 내가 스크립트를 실행할 때today_date매개변수로 직접,JMP가 응답하지 않습니다.왜 할당하는지 이해가 안 갑니다date = today_date실행을 더욱 효율적으로 처리합니다.
"),
Format("Date Abbrev", 20)
) << Set Field Width(10);
date = today_date;
While(date >= start_of_month,
{percent_nok_ict, percent_nok_fct} = TOP5:calculate_nok_percentages_for_date(dt, date);
dt_results << Add Rows(
{Format(date, "yyyy-mm-dd"), percent_nok_ict, percent_nok_fct}
);
date = Date Increment(date, "day", -1);
);
dt_results;
);
TOP5:calculate_nok_percentages_for_date = Function({dt, specific_date},
{start_of_month, today_date} = TOP5:get_dates_percent();
dt_top5 = dt << Summary(
Group(:Date, :Nom de fichier, :Ref Produit, :ProductName, :Baie, :ICT_FCT, :Result, :Reason Error, :CodeError),
Freq("Aucun(e)"),
Weight("Aucun(e)"),
invisible
);
nameFilesNok = Associative Array(Column(dt_top5, "Nom de fichier") << Get Values) << Get Keys;
total_nb_total_ict = 0;
total_nb_total_fct = 0;
total_nb_nok_ict = 0;
total_nb_nok_fct = 0;
For(k = 1, k <= N Items(nameFilesNok), k++,
FileRows = dt_top5 << get rows where(
:File Name == nameFilesNok[k] & :Date >= start_of_month & :Date <= specific_date & Contains(:File Name, "GOLDEN") == 0
);
nb_total_ict = 0;
nb_total_fct = 0;
nb_nok_ict = 0;
nb_nok_fct = 0;
total_rows = N Items(FileRows);
For(j = 1, j <= total_rows, j++,
If(dt_top5:ICT_FCT[FileRows[j]] == "ICT",
nb_total_ict = nb_total_ict + dt_top5:Nb. de lignes[FileRows[j]];
If(dt_top5:Result[FileRows[j]] == "NOK",
nb_nok_ict = nb_nok_ict + dt_top5:Nb. de lignes[FileRows[j]]
);
, dt_top5:ICT_FCT[FileRows[j]] == "FCT",
nb_total_fct = nb_total_fct + dt_top5:Nb. de lignes[FileRows[j]];
If(dt_top5:Result[FileRows[j]] == "NOK",
nb_nok_fct = nb_nok_fct + dt_top5:Nb. de lignes[FileRows[j]]
);
)
);
total_nb_total_ict += nb_total_ict;
total_nb_total_fct += nb_total_fct;
total_nb_nok_ict += nb_nok_ict;
total_nb_nok_fct += nb_nok_fct;
);
percent_nok_ict = (total_nb_nok_ict / total_nb_total_ict) * 100;
percent_nok_fct = (total_nb_nok_fct / total_nb_total_fct) * 100;
Eval List({percent_nok_ict, percent_nok_fct});
);
미리 감사드립니다. TOP5:get_dates_percent = Function({},
today_date = Today();
start_of_month = Date Increment(Today(), "Month", 0, "Start");
evallist({start_of_month, today_date});
);
TOP5:calculate_nok_percentages_over_time = Function({dt},
{start_of_month, today_date} = TOP5:get_dates_percent();
dt_results = New Table("NOK Percentages Over Time",
New Column("Date", Numeric),
New Column("Percent_NOK_ICT", Numeric),
New Column("Percent_NOK_FCT", Numeric)
);
// Set the format for the Date column
Column(dt_results, "Date") << Data Type(
Numeric,
Format("Format Pattern", "<YYYY>-<MM>-<DL><DD>", 10),
Input Format("Format Pattern", "<YYYY>-<MM>-</MM></YYYY></DD></DL></MM></YYYY>
Re: 정의된 날짜 범위에 대한 분포 추적 차트 플로팅셀의 점은 숫자형 데이터 유형 열이 있으므로 누락된 데이터를 의미합니다.
Re: 정의된 날짜 범위에 대한 분포 추적 차트 플로팅문제가 내 데이터 세트와 코드의 호환성에 관한 것인지는 확실하지 않습니다.
참고하실 수 있도록 제 데이터 테이블 샘플을 첨부했습니다.
Re: 정의된 날짜 범위에 대한 분포 추적 차트 플로팅귀하의 날짜는 숫자 값입니다.
Names Default To Here(1);
dt = Open("$DOWNLOADS/TableData SVI PY.jmp");
vals = Column(dt, "Date") << get values;
show(vals);


Re: 정의된 날짜 범위에 대한 분포 추적 차트 플로팅네, 내 날짜는 숫자 값입니다
Re: 정의된 날짜 범위에 대한 분포 추적 차트 플로팅업데이트:)
나는 이런 방식으로 함수를 사용하려고 했고 모든 날짜를 숫자 형식으로 입력했습니다. 하지만 언제나 그렇듯이 이 오류가 발생했는데 날짜 열에 있는 것 같습니다.
/*:
"Cannot set the value of column 'Percent_NOK_ICT' because the row number (0) is not valid."
// Ouvrir le fichier de données
dt = Open("$DOWNLOADS/TableData SVI PY.jmp", invisible);
// Créer un résumé des données
dt_top5 = dt << Summary(
Group(:Date, :Nom de fichier, :Ref Produit, :ProductName, :Baie, :ICT_FCT, :Result, :Reason Error, :CodeError),
Freq("Aucun(e)"),
Weight("Aucun(e)"),
invisible
);
// Créer la table de résultats
dt_results = New Table("NOK Percentages Over Time",
New Column("Date", Numeric),
New Column("Percent_NOK_ICT", Numeric),
New Column("Percent_NOK_FCT", Numeric)
);
// Obtenir les noms de fichiers NOK
nameFilesNok = Associative Array(Column(dt_top5, "Nom de fichier") << Get Values) << Get Keys;
// Boucle sur chaque jour depuis aujourd'hui jusqu'au début du mois
For(i = Today(), i >= Num(Date Increment(Today(), "Month", 0, "Start")), i -= 1,
current_date = i;
total_nb_total_ict = 0;
total_nb_total_fct = 0;
total_nb_nok_ict = 0;
total_nb_nok_fct = 0;
// Calcul des pourcentages NOK pour chaque jour
For(k = 1, k <= N Items(nameFilesNok), k++,
FileRows = dt_top5 << get rows where(
:Nom de fichier == nameFilesNok[k] & Num(Date(:Date)) >= current_date & Num(Date(:Date)) <= Num(Today()) & Contains(:Nom de fichier, "GOLDEN") == 0
);
nb_total_ict = 0;
nb_total_fct = 0;
nb_nok_ict = 0;
nb_nok_fct = 0;
total_rows = N Items(FileRows);
For(j = 1, j <= total_rows, j++,
If(dt_top5:ICT_FCT[FileRows[j]] == "ICT",
nb_total_ict = nb_total_ict + dt_top5:Nb. de lignes[FileRows[j]];
If(dt_top5:Result[FileRows[j]] == "NOK",
nb_nok_ict = nb_nok_ict + dt_top5:Nb. de lignes[FileRows[j]]
);
, dt_top5:ICT_FCT[FileRows[j]] == "FCT",
nb_total_fct = nb_total_fct + dt_top5:Nb. de lignes[FileRows[j]];
If(dt_top5:Result[FileRows[j]] == "NOK",
nb_nok_fct = nb_nok_fct + dt_top5:Nb. de lignes[FileRows[j]]
);
)
);
total_nb_total_ict += nb_total_ict;
total_nb_total_fct += nb_total_fct;
total_nb_nok_ict += nb_nok_ict;
total_nb_nok_fct += nb_nok_fct;
);
// Assurez-vous que les totaux ne sont pas zéro avant de calculer les pourcentages
If(total_nb_total_ict > 0,
percent_nok_ict = (total_nb_nok_ict / total_nb_total_ict) * 100;
,
percent_nok_ict = 0;
);
If(total_nb_total_fct > 0,
percent_nok_fct = (total_nb_nok_fct / total_nb_total_fct) * 100;
,
percent_nok_fct = 0;
);
// Ajouter une nouvelle ligne et définir les valeurs
dt_results << Add Rows(1);
last_row_index = N Rows(dt_results);
dt_results:Date[last_row_index] = current_date;
dt_results:Percent_NOK_ICT[last_row_index] = percent_nok_ict;
dt_results:Percent_NOK_FCT[last_row_index] = percent_nok_fct;
);
// Affichage des résultats
dt_results;
Re: 정의된 날짜 범위에 대한 분포 추적 차트 플로팅
문제를 일으키는 원인이 Date() 함수일 수도 있습니다(어떻게 정의했는지 모르기 때문에 잘 모르겠습니다).
Re: 정의된 날짜 범위에 대한 분포 추적 차트 플로팅이 주제에 관심 있는 분들을 위해 업데이트된 버전의 코드를 첨부했습니다!
// Ouvrir le fichier de données
dt = Open( "/D:/Project JMP/Tables/TableDataPY.jmp", invisible );
today_date = Format(Today(), "yyyy-mm-dd");
start_of_month = Format(Date Increment(Today(), "Month", 0, "Start"), "yyyy-mm-dd");
evallist({start_of_month, today_date});
dt_top5 = dt << Summary(
Group(:Date, :Nom de fichier, :Ref Produit, :ProductName, :Baie, :ICT_FCT, :Result, :Reason Error, :CodeError),
Freq("Aucun(e)"),
Weight("Aucun(e)"),
invisible
);
results_table = New Table( "Results",
New Column( "Date", Character ),
New Column( "Percent NOK ICT", Numeric ),
New Column( "Percent NOK FCT", Numeric ),
New Column( "Total ICT", Numeric ),
New Column( "NOK ICT", Numeric ),
New Column( "Total FCT", Numeric ),
New Column( "NOK FCT", Numeric )
);
For(day = Num(start_of_month), day <= Num(today_date), day = Date Increment(day, "Day", 1),
current_date = Format(day, "yyyy-mm-dd");
FileRows = dt_top5 << get rows where(
Num(Char(:Date)) == Num(current_date) & Contains(:Nom de fichier, "GOLDEN") == 0
);
nb_total_ict = 0;
nb_total_fct = 0;
nb_nok_ict = 0;
nb_nok_fct = 0;
total_rows = N Items(FileRows);
For(j = 1, j <= total_rows, j++,
If(dt_top5:ICT_FCT[FileRows[j]] == "ICT",
nb_total_ict = nb_total_ict + dt_top5:Nb. de lignes[FileRows[j]];
If(dt_top5:Result[FileRows[j]] == "NOK",
nb_nok_ict = nb_nok_ict + dt_top5:Nb. de lignes[FileRows[j]]
);
, dt_top5:ICT_FCT[FileRows[j]] == "FCT",
nb_total_fct = nb_total_fct + dt_top5:Nb. de lignes[FileRows[j]];
If(dt_top5:Result[FileRows[j]] == "NOK",
nb_nok_fct = nb_nok_fct + dt_top5:Nb. de lignes[FileRows[j]]
);
)
);
If(nb_total_ict > 0,
percent_nok_ict = (nb_nok_ict / nb_total_ict) * 100,
percent_nok_ict = 0
);
If(nb_total_fct > 0,
percent_nok_fct = (nb_nok_fct / nb_total_fct) * 100,
percent_nok_fct = 0
);
results_table << Add Rows(1);
row_index = N Rows(results_table);
results_table:Date[row_index] = current_date;
results_table:Percent NOK ICT[row_index] = percent_nok_ict;
results_table:Percent NOK FCT[row_index] = percent_nok_fct;
results_table:Total ICT[row_index] = nb_total_ict;
results_table:NOK ICT[row_index] = nb_nok_ict;
results_table:Total FCT[row_index] = nb_total_fct;
results_table:NOK FCT[row_index] = nb_nok_fct;
);
results_table << Save( "D:/Project JMP/Tables Resultats NOK percentages/Results.jmp" );
// Fermer toutes les tables ouvertes
Close( dt, "No Save" );
Close( dt_top5, "No Save" );
<BR />