You could combine Col Cumulative Sum with Col Min
Names Default To Here(1);
dt = New Table("Untitled",
Add Rows(12),
Compress File When Saved(1),
New Column("Column 1", Character, "Nominal", Set Values({"A", "A", "A", "A", "A", "A", "B", "B", "B", "B", "B", "B"})),
New Column("Column 2", Numeric, "Continuous", Format("Best", 12), Set Values([1, 1, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1])),
New Column("Column 3", Numeric, "Continuous", Format("Best", 12), Set Values([1, 2, 2, 3, 1, 1, 1, 1, 2, 2, 3, 3]))
);
dt << New Column("R", Numeric, Continuous, Formula(
Col Cumulative Sum(Row() == Col Min(Row(), :Column 1, :Column 2, :Column 3), :Column 1, :Column 2)
));
![jthi_0-1706634475143.png jthi_0-1706634475143.png](https://community.jmp.com/t5/image/serverpage/image-id/60751iA6E8AFF4C5DD8831/image-size/medium?v=v2&px=400)
-Jarmo