cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • JMP will suspend normal business operations for our Winter Holiday beginning on Wednesday, Dec. 24, 2025, at 5:00 p.m. ET (2:00 p.m. ET for JMP Accounts Receivable).
    Regular business hours will resume at 9:00 a.m. EST on Friday, Jan. 2, 2026.
  • We’re retiring the File Exchange at the end of this year. The JMP Marketplace is now your destination for add-ins and extensions.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
paulp
Level III

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")

paulp_1-1673988610311.png

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
ih
Super User (Alumni) ih
Super User (Alumni)

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( ... )
)

View solution in original post

2 REPLIES 2
ih
Super User (Alumni) ih
Super User (Alumni)

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( ... )
)
paulp
Level III

Re: row() results in missing value for 1st row

Thank you, that did it

Recommended Articles