繪製指定日期範圍內的分佈追蹤圖大家好,
我希望你們一切都好!我有一個問題,非常感謝您的幫助。
我一直在開發一個函數來創建 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 ) /*###*/

任何人都可以提供一些關於如何改進這一點的指導或提示嗎?
多謝!
自動化和腳本編寫視窗回覆:在定義的日期範圍內繪製分佈追蹤圖問題出在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);
);
回覆:在定義的日期範圍內繪製分佈追蹤圖Date() 函數有什麼作用?
回覆:在定義的日期範圍內繪製分佈追蹤圖我使用Date()從日期清單建立日期物件。就我而言,我將獲取從月初到今天的所有日期,並且 Date() 函數將確保日期採用支援日期算術和比較的日期格式。
回覆:在定義的日期範圍內繪製分佈追蹤圖據我所知,JMP 中沒有 Date() 函數(有 << Date() 可以發送到日曆框,但它是完全不同的東西)。
回覆:在定義的日期範圍內繪製分佈追蹤圖好吧,我明白。在這種情況下我可以使用:
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);
);回覆:在定義的日期範圍內繪製分佈追蹤圖您正在混合數字(日期數字)和字串。當您將日期轉換為字串時,我會使用比 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});
);
(我還在我的示例中多次向您提供了這些更強大的方法)。
回覆:在定義的日期範圍內繪製分佈追蹤圖是的,這就是我現在正在努力做的事情。我將保留日期格式並研究邏輯以查看它是否有效。
謝謝,如果我的問題重複並且有時看起來很愚蠢,我很抱歉,這只是因為我兩個月前開始使用 JMP 和 JSL 語言進行實習。
回覆:在定義的日期範圍內繪製分佈追蹤圖我真的很困惑。我試過這個方法:
" ),
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>
我每次都會收到錯誤。
我想要做的是建立一個計算 NOK 百分比的函數,例如第二個函數 TOP5:calculate_nok_percentages_over_time 。不同之處在於,該函數將計算從今天到月初的 NOK 百分比,然後從昨天到月初,依此類推,直到達到月初。結果應該儲存在一個新表中,以便我可以使用它們來建立圖表。
回覆:在定義的日期範圍內繪製分佈追蹤圖您遇到的錯誤是什麼?
回覆:在定義的日期範圍內繪製分佈追蹤圖/*:
存取或計算「Format」時,第 1 行參數必須是數字,Format/*###*/(date, "yyyy-mm-dd")。
回覆:在定義的日期範圍內繪製分佈追蹤圖您很可能會收到該錯誤,因為您的日期變數是字串,而Format()要求您有一個數字變數。我猜這個錯誤來自於此

date 與 Today_date 相同,today_date 來自 TOP5:get_dates(),它傳回字串。將日期保留為數值,您將避免所有這些問題(無需使用 Num(Char()) 轉換,特別是當您從 Today() 這是一個數值開始時)。
我建議您閱讀腳本指南中的日期時間部分,從https://www.jmp.com/support/help/en/18.0/#page/jmp/datetime-functions-and-formats.shtml#開始
回覆:在定義的日期範圍內繪製分佈追蹤圖我考慮了你的建議並嘗試了這個方法。但是,我仍然面臨一個問題:我的函數傳回一個包含行中的點的表。

我保留了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>
回覆:在定義的日期範圍內繪製分佈追蹤圖單元格中的點意味著缺少數據,因為您有數字資料類型列。
回覆:在定義的日期範圍內繪製分佈追蹤圖我不確定問題是否與程式碼與我的資料集的兼容性有關。
我附上了我的數據表樣本供您參考。
回覆:在定義的日期範圍內繪製分佈追蹤圖如果您的意思是,您的日期是數值
Names Default To Here(1);
dt = Open("$DOWNLOADS/TableData SVI PY.jmp");
vals = Column(dt, "Date") << get values;
show(vals);


回覆:在定義的日期範圍內繪製分佈追蹤圖是的,我的日期是數值
回覆:在定義的日期範圍內繪製分佈追蹤圖更新:)
我嘗試以這種方式使用該函數,我將所有日期都放在數字格式中。但一如既往,我確實收到了此錯誤,我認為它位於日期列中:
/*:
"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;
回覆:在定義的日期範圍內繪製分佈追蹤圖
這可能是 Date() 函數導致了問題(我不確定,因為我不知道你是如何定義它的)。
回覆:在定義的日期範圍內繪製分佈追蹤圖您會發現隨附的程式碼的更新版本適用於對此主題感興趣的任何人!
// 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 />