Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to create expression to do a calculation using previous record value

    I need to create an expression for a straight table for a column to subtract previous surgery stop time from the next surgery start time, if on same day.   I've tried using variables but discovered you can't set those values in an expression.  I don't know how to check if 1) the same date and 2) use previous records' stop time.   Is that possible in an expression?

1 Solution

Accepted Solutions
maxgro
MVP
MVP

9 Replies
Not applicable
Author

Carmalita, could you post en example set of data ? or an example app ? it would be helpful to understand visually what you are trying to achieve

ecolomer
Master II
Master II

Use function ABOVE

Not applicable
Author

      I have a chart type of Straight Table with columns:

     surgery_date            surgery_start_time         surgery_stop_time         NEW COLUMN FOR TURN-AROUND TIME

     09/16/2014                  08:00                            09:00                         00 min (first record of day not applicable)

     09/16/2014                  09:15                            10:15                         15 min   (start time minus prev record stop time)

     09/17/2014                  08:00                             08:30                        00 min

     09/17/2014                  10:00                             11:00                        90 min    (10:00-8:30)


    I need a column to show turn-around time from end of one surgery to start of next surgery (for that day).

       Thank you!

maxgro
MVP
MVP

search in online help

Chart Inter Record Functions

as Enrique said

Not applicable
Author

    I tried your suggestion only used the BELOW function (for last/prior?) and my formula returns all nil values ?

               SURG_PIR_TIME_START -  BELOW(SURG_PIR_TIME_STOP)*1440

     My table is sorted in SURG_PIR_TIME_START (date/timestamp) order.  So not sure what I'm doing wrong.

    Thank you.

Not applicable
Author

     I tried ABOVE but also nil results:

 

SURG_PIR_TIME_START-ABOVE(SURG_PIR_TIME_STOP))*1440


maxgro
MVP
MVP

see attachment

1.png

Not applicable
Author

    That should work for me. I"m having some syntax issues but will work it out.  Thanks so much.

Not applicable
Author

Massimo

If I have 2 columns in my straight table, SURG_TIME_STOP and Above(SURG_TIME_STOP) the Above function works fine.But if I add another column it doesn't.  Why would that be?  I'm attaching screenshots of my properties.

Thanks so much for your input.

Carmalita