Plotting a Distribution Tracking Chart Over a Defined Date RangeHi everyone,
I hope you're all doing well ! I have a question and would really appreciate your help.
I've been working on a function to create a NOK tracking chart that shows the NOK percentages over a specific date range. Here's a quick rundown of what i want my function to do :
- I get the start and end dates for the current month.
- Next i creat new table to store the NOK percentages for each date and It goes through each day from the start of the month to today.
- Then it inserts the date and the corresponding NOK percentages into the new table.
- Finally, it creates a line graph showing the NOK percentages over the date range.
I've got the function mostly working, but I'm running into a bit of trouble.
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" )
);
);
i did get this error message :
/*:
Unresolved name: Date JSL when accessing or evaluating "Date JSL". Date JSL( i ) /*###*/

Could anyone provide some guidance or tips on how to improve this ?
Thanks a lot!
Automation and ScriptingWindowsRe: Plotting a Distribution Tracking Chart Over a Defined Date RangeThe problem is in the create_nok_tracking_chart function
I made some changes to simplify the For loop, but unfortunately, it's not working:
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: Plotting a Distribution Tracking Chart Over a Defined Date RangeWhat does Date() function do?
Re: Plotting a Distribution Tracking Chart Over a Defined Date RangeI used Date() to create a date object from a list of date. In my case i will get all dates from the begining of month to today's and Date() function will ensure that date are in a date format that supports date arithmetic and comparisons.
Re: Plotting a Distribution Tracking Chart Over a Defined Date RangeTo my knowledge there is no Date() function in JMP (there is << Date() which can be sent to calendar box but it is totally different thing).
Re: Plotting a Distribution Tracking Chart Over a Defined Date RangeOkay I understand. In that case can I use:
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: Plotting a Distribution Tracking Chart Over a Defined Date RangeYou are mixing numbers (datenums) and strings. I would use much more robust methods of handling dates than your get_dates function as you are converting dates to strings. You should keep them as 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});
);
(I have also provided these more robust methods multiple times in my examples to you).
Re: Plotting a Distribution Tracking Chart Over a Defined Date RangeYes, that’s what I’m trying to do now. I will keep the date format and work on the logic to see if it works.
Thank you and I’m sorry if my questions are repetitive and sometimes seem silly it’s just because I started using JMP and the JSL language two months ago for my internship.
Re: Plotting a Distribution Tracking Chart Over a Defined Date RangeI'm really confused. I've tried this method :
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><DD>" ),
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});
);<P><BR />and when i can my fonction in :</P><PRE><CODE class=" language-jsl">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;
I keep getting an error every time.
What I want to do is create a function that calculates the NOK percentages like the second function TOP5:calculate_nok_percentages_over_time . The difference is that this function will calculate the NOK percentage between today's date and the start of the month, then from yesterday to the start of the month, and so on, until it reaches the start of the month. The results should be stored in a new table so I can use them to create graphs.
Re: Plotting a Distribution Tracking Chart Over a Defined Date RangeWhat is the error you are getting?
Re: Plotting a Distribution Tracking Chart Over a Defined Date Range/*:
The argument must be numeric at line 1 when accessing or evaluating 'Format', Format/*###*/(date, "yyyy-mm-dd").
Re: Plotting a Distribution Tracking Chart Over a Defined Date RangeYou are most likely getting that error as your date variable is a string and Format() requires you to have a numeric variable. My guess that error is from this

date is same as today_date, today_date comes from TOP5:get_dates() which returns strings. Keep the dates as numeric values and you will avoid all of these issues (there is no need to use Num(Char()) conversions, especially when you are starting from Today() which is a numeric value).
I suggest you read Date-Time parts from Scripting Guide, starting from this https://www.jmp.com/support/help/en/18.0/#page/jmp/datetime-functions-and-formats.shtml#
Re: Plotting a Distribution Tracking Chart Over a Defined Date RangeI took your suggestions into account and tried this method. However, I'm still facing an issue: my function returns a table with points in rows.

and I kept date = today_date; because when I run the script with today_date as a parameter directly, JMP doesn't respond. I don't understand why assigning date = today_date handles the run more efficiently.
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><DD>"),
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});
);<P><BR />thank you in advance.</P><P> </P></DD></DL></MM></YYYY>Re: Plotting a Distribution Tracking Chart Over a Defined Date RangePoints in cells mean missing data as you have numeric data type columns.
Re: Plotting a Distribution Tracking Chart Over a Defined Date RangeI'm uncertain if the problem is about the code's compatibility with my dataset.
I've attached a sample of my data table for your reference.
Re: Plotting a Distribution Tracking Chart Over a Defined Date RangeYour dates are numeric value if you mean that
Names Default To Here(1);
dt = Open("$DOWNLOADS/TableData SVI PY.jmp");
vals = Column(dt, "Date") << get values;
show(vals);


Re: Plotting a Distribution Tracking Chart Over a Defined Date Rangeyes my dates are numeric value
Re: Plotting a Distribution Tracking Chart Over a Defined Date Rangeupdates
I tried to use the function this way i did put all date on format Numeric. but as always i did get this error i think it's in Date Column:
/*:
"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: Plotting a Distribution Tracking Chart Over a Defined Date Range
It could be the Date() function which is causing issues (I'm not sure as I don't know how you have defined it).
Re: Plotting a Distribution Tracking Chart Over a Defined Date RangeYou’ll find attached an updated version of the code that works for anyone interested in this subject !
// 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 />