New to scripting in JMP and want to filter the table of tool errors. I have a set of data and want to filter by alarm date next delete the repeated rows of errors. For example, if an error occurs at 1:00 and it repeats itself 4 times within 1 hour I want to delete the repeats and only catches when the error first appears.
My script is below and I want to resort the script after I do the delete of repeated rows by alarm date (descending).
dt = open ("SR_Loop_LAM_002_Alarm_Log.csv");
dt << sort (by (:ENTITY), order (ascending), replace table (0));
for (i = nrows (dt), i>0, i--,
if(:ENTITY[i-1]==:ENTITY & :ALARM_ID[i-1] == :ALARM_ID & date difference(:ALARM_DATE[i-1], :ALARM_DATE, "hour", "fractional") < 1,
dt << delete rows (i))
);
dt << save ("SR_Loop_LAM_002_Alarm_Log.csv");
close (dt, no save)