cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Browse apps to extend the software in the new JMP Marketplace
Choose Language Hide Translation Bar
haleyhoewt
Level I

Elapsed Time Calculation

so i have different "runs" in one dataset, while i could break them out, i'd like to leave them as one dataset the goal is as follows:

 

  • Two relevant columns for formula
    • Run Number (Numeric Ordinal)
    • Elapsed Time (Numeric Cont)
  • Goal: do a count with a 20ms offset and reset to zero each time the Run Number changes 
  • Since this time series is in set intervals of 20ms, i'm safe to do a count, but the count isn't going to go in intervals of 20ms
3 REPLIES 3
jthi
Super User

Re: Elapsed Time Calculation

I'm not sure if I understand correctly how your data looks like, but Col Cumulative Sum should work. Take the sum of either 1 or :"Elapsed Time"n

Col Cumulative Sum(1, :"Run Number"n)
-Jarmo
GregF_JMP
Staff

Re: Elapsed Time Calculation

Hello,

I am also not sure I followed the question setup, but assuming Elapsed Time is a continuously running clock, and you want to calculate time within each "Run Number" from zero to the duration of the run- this slightly longer alternative will do it in the units of the elapsed time column.

 

:Elapsed Time - Col Minimum( :Elapsed Time, :Run Number )
SamGardner
Level VII

Re: Elapsed Time Calculation

This appears to me that you want automatically make a data table like this

SamGardner_1-1672955013393.png

 

You can use a formula for the Elapsed Time Column like the one shown below.  It uses conditional If( ) and also the Lag( ) function to get the previous row's data from a column

 

 

 

SamGardner_0-1672954974687.png

 

example data table attached.