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
fionaweston
Level III

How could I script so that I get back the correct duration for each row?

I have a table consisting of timestamps (attached).

They are categorized into T7 timestamps which could be any of T7/T7A/B/C/D…..H etc. and T8 timestamps which could be any of T8/T8A/B/C/D….H etc.

I need to subtract the largest T7 value from the largest T8 value available for that row and I have made a column  “T8-T7” to identify those values.

How could I script so that I get back the correct duration for each row?

Thanks

Fiona

1 ACCEPTED SOLUTION

Accepted Solutions

Re: How could I script so that I get back the correct duration for each row?

You can  have JMP script this for you if you are willing to create 2 extra columns--

 

1) select the columns T7 through T7H, then right-click on one of the column headers in this group and select New Formula Column > Combine > Maximum.

 

2) Repeat the process above, but using the columns T8 through T8H.

 

3) Select these 2 newly-created columns, then right-click on one of their headers and select New Formula Column > Combine > Difference (reverse order).

 

If this doesn't work for you because you don't like having the 2 extra columns, take a look at the formulas in the columns you created in step 1 and 2 above. These will show you how to write the formulas you need... basically you will just subtract the first of these formulas from the second to create your single "master" formula.

 

Cheers,

Brady

View solution in original post

2 REPLIES 2

Re: How could I script so that I get back the correct duration for each row?

You can  have JMP script this for you if you are willing to create 2 extra columns--

 

1) select the columns T7 through T7H, then right-click on one of the column headers in this group and select New Formula Column > Combine > Maximum.

 

2) Repeat the process above, but using the columns T8 through T8H.

 

3) Select these 2 newly-created columns, then right-click on one of their headers and select New Formula Column > Combine > Difference (reverse order).

 

If this doesn't work for you because you don't like having the 2 extra columns, take a look at the formulas in the columns you created in step 1 and 2 above. These will show you how to write the formulas you need... basically you will just subtract the first of these formulas from the second to create your single "master" formula.

 

Cheers,

Brady

fionaweston
Level III

Re: How could I script so that I get back the correct duration for each row?

Awesome, works great!
I don't mind the extra columns:)