- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
row() results in missing value for 1st row
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")
1 ACCEPTED SOLUTION
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: row() results in missing value for 1st row
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( ... )
)
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: row() results in missing value for 1st row
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( ... )
)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: row() results in missing value for 1st row
Thank you, that did it