As there was no "correct" answer column provided, I made guesses. This script will create formula columns which should help building the final column. There are also other options when using formulas or you could use completely different method than just formulas
Names Default To Here(1);
dt = Open("$DOWNLOADS/Sample Data for JMP Forum.jmp");
dt << Sort(By(:Time), Order(Ascending), Replace Table); // to make this a bit simpler sort by :Time
// Assumption: Time and Analyte create a group
dt << New Column("Mean_TimeAnalyte", Numeric, Continuous, Formula(
Col Mean(:"Concentration (mM)"n, :Time, :Analyte)
));
// Assumption: We are looking for first and last average value for each Analyte
dt << New Column("FirstAnalyteValue", Numeric, Continuous, Formula(
Col Sum(
If(Row() == Col Min(Row(), :Analyte),
:Mean_TimeAnalyte
,
0
),
:Analyte
)
));
dt << New Column("LastAnalyteValue", Numeric, Continuous, Formula(
Col Sum(
If(Row() == Col Max(Row(), :Analyte),
:Mean_TimeAnalyte
,
0
),
:Analyte
)
));
dt << New Column("AnalyteStatus", Numeric, Continuous, Formula(
If(:LastAnalyteValue > :FirstAnalyteValue,
"Accumulating"
,
"Depleting"
);
));
gb = dt << Graph Builder(
Size(528, 492),
Show Control Panel(0),
Variables(
X(:Time),
Y(:"Concentration (mM)"n),
Group X(:AnalyteStatus),
Overlay(:Analyte)
),
Elements(
Points(X, Y, Legend(5), Summary Statistic("Mean")),
Line(X, Y, Legend(6))
),
Local Data Filter(Add Filter(columns(:AnalyteStatus)))
);
-Jarmo