Is there an alternative to iterating through rows using column formula?I have a dataset which is a series of test runs, all collected in one table. The experiment is 6 sweeps from high to low speed for each sample, and what I need to do is assign the correct sweep number to each one (i.e. from 1 to 6) and then restart the sequence for the next sample. I could easily do this with the sequence or count function, however the number of points in each sweep is not always the same, it varies around 24-26. See image below for an example of one "sweep" from high to low speed before starting the next one.
I'm sure this could be done with a script, however my experience in that area is minimal. Is there a quick and dirty way of doing it using column formulas?

Advanced Statistical ModelingAutomation and ScriptingMass CustomizationQuality and Process EngineeringRe: Is there an alternative to iterating through rows using column formula?Lag() could be helpful here.
Replace :Column 1 with your speed column:
If(Row() == 1, curVal = 1);
If(:Column 1 > Lag(:Column 1),
curVal += 1
);
curVal;
