JMP® Pro 17.0.0 (622753)
Hello, I understand that using Lag in the 1st row results in a missing value. But I need to avoid a missing value, because my predictive algorithm is using Informative Missing elsewhere. So in this one instance, I'd like to avoid it.
I'm not much good with JSL...
Formula Result: want to force this missing value to change to a zero. My initial forays have been trying combinations of If statements using Is Empty, Is Missing. e.g.
If Lag (the whole formula) ==Is Empty
Then ==0
Else == Lag (the whole formula)
Any suggestions? thanks, Paul
Lag("the whole formula")

Try putting your if statement outside of the lag function. So..
if( row() == 1,
hCounter = 1; // set the hCounter value so future evaluations work, but
0;, //return 0 for the first row
lag( ... )
)