I think this should do what you want.
Add new (numeric) column to your table to calculate "groups" with formula like
If(Row() == 1,
counter = 0;
);
If(:Product != Lag(:Product),
counter++;
);
counter;
Then you can use Summary table to perform the min/max part
Remove and re-order columns from summary table as needed
Here is a script from Enhanced Log to perform those actions
// Open Data Table: Run Time Index.jmp
// → Data Table("Run Time Index")
Open("$DOWNLOADS/Run Time Index.jmp");
// New column: R
Data Table("Run Time Index") << New Column("R",
Numeric,
"Continuous",
Format("Best", 12),
Formula(
If(Row() == 1, counter = 0);
If(:Product != Lag(:Product),
counter
++);
counter;
)
);
// Data table summary
// → Data Table("Run Time Index By (R, Product)")
Data Table("Run Time Index") << Summary(
Group(:R, :Product),
Min(:Run Index),
Min(:Start),
Max(:End),
Freq("None"),
Weight("None"),
statistics column name format("column"),
Link to original data table(0)
);
// Delete columns
Data Table("Run Time Index By (R, Product)") << Delete Columns(:R, :N Rows);
// Move selected column: Run Index
Data Table("Run Time Index By (R, Product)") << Move Selected Columns({:Run Index}, To First);
// Change column modeling type: Run Index
Data Table("Run Time Index By (R, Product)"):Run Index << Set Modeling Type("Ordinal");
-Jarmo