I have no idea how your data looks like or your chart, so it makes this a bit more difficult. If we assume your column with filename is called "filename" you should be able to access first value for the sample with :filename[qc_firstRow].
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Quality Control/Coating.jmp");
obj = dt << Control Chart(
Sample Size(:Sample),
KSigma(3),
Chart Col(:Weight, XBar, R),
Alarm Script(
Write("Out of Control for test ", qc_test, " in column ", qc_col, " in sample ", qc_sample, " marker is ", :Markers[qc_firstRow])
)
);
obj << Test 1(1);
-Jarmo