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
PruningTheBird9
New Member

How to find the difference between rows by a group with missing data?

I'm running into this issue where I have two sets of datapoints across my timeline. One is collected at every point in the interval, the other is collected sporadically. When placed together in a data table, one of the columns is missing data every in the interval. I attached a data table as an example but essentially looks like this:

PruningTheBird9_0-1767111143533.png

What I need now is to get the difference between rows that contain data in the Glucose (g/L) column, grouped by Bioreactor column. For e.g., at 36 hrs for Bioreactor 1, my value would be "-1" (3 - 4). For bioreactor 2 at 120 hrs, my value would be "1" (2 - 1).

Lag hasn't been working since it requires that the values are spaced apart similarly, which they are not. I would appreciate any help and/or guidance!

1 ACCEPTED SOLUTION

Accepted Solutions
jthi
Super User

Re: How to find the difference between rows by a group with missing data?

As you seem to be using JMP19 Col At() might do what you are looking for (but I'm not 100% sure). You could try with formula like

:"Glucose (g/L)"n - Col At(:"Glucose (g/L)"n, -1, :Bioreactor, << relative(1), <<Skip Missing(:"Glucose (g/L)"n))

jthi_0-1767115608220.png

If this isn't what you are looking for, could you provide full "correct result" column? For example for Bioreactor 1 what would be the values at 0, 84, 132 and 180 hours? Or are you just interested in the first difference which can be calculated?

-Jarmo

View solution in original post

2 REPLIES 2
jthi
Super User

Re: How to find the difference between rows by a group with missing data?

As you seem to be using JMP19 Col At() might do what you are looking for (but I'm not 100% sure). You could try with formula like

:"Glucose (g/L)"n - Col At(:"Glucose (g/L)"n, -1, :Bioreactor, << relative(1), <<Skip Missing(:"Glucose (g/L)"n))

jthi_0-1767115608220.png

If this isn't what you are looking for, could you provide full "correct result" column? For example for Bioreactor 1 what would be the values at 0, 84, 132 and 180 hours? Or are you just interested in the first difference which can be calculated?

-Jarmo
PruningTheBird9
New Member

Re: How to find the difference between rows by a group with missing data?

This is exactly what I was looking for! Thank you so much I've been trying for hours to figure this out.

Solution accepted.

Recommended Articles