Recoding Columns using IF statementsHello JMP Experts,
I am new to IF statements and would like to use one (or something else that would accomplish the same thing) to recode a column that has a value tied to another columns value.
So in the example below:
EndTime Id is a unique run ID for 8 channels.
There are 10 repair intervals.
I would like to assign a continuous run number (see empty column) for each unique EndTime Id, that restarts with 1 when the repair interval changes.
Thank you!

Re: Recoding Columns using IF statementsHi @lizrdee
Most likely @Thierry_S 's answer is sufficient.
Otherwise, take a look at this discussion
How do I create an index column by ID?
Re: Recoding Columns using IF statementsThere is a small error in the formula: I forgot to precede one to RUN NUMBER call with ":"
If( Row() == 1,
1,
If( :EndTime Id != Lag( :EndTime Id, 1 ),
Lag( :RUN NUMBER, 1 ) + 1,
Lag( :RUN NUMBER, 1 )
)
);
Re: Recoding Columns using IF statementsHi,
You could use the following formula (copy and paste in the Formula Editor)
If( Row() == 1,
1,
If( :EndTime Id != Lag( :EndTime Id, 1 ),
Lag( :RUN NUMBER, 1 ) + 1,
Lag( RUN NUMBER, 1 )
)
);
This will only work properly if the table is sorted by EndTime Id