cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Learn how to build custom Python data connectors and further customize JMP’s Data Connector Framework with the Python Data Connector Demo, available now in the JMP Marketplace!
  • See how to create experiments to support product design and ID useful product features. Register for June 12 webinar, 2pm US Eastern Time.

Discussions

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

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

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