GetNthRecord is a function that can access the value of a field in a previous or succeeding record. That can allow you to compute a percent change.
Let ( N = Get ( recordNumber ) ; If ( N > 1 ; GetNthRecord ( YourTable::Field ; N - 1 ) ) )
will access the value of Field from the previous record.
Thanks so much, this is exactly what I was hoping to accomplish. Fast response to the question as well.
I have another inquiry related to my original question, how do I alter the equation you provided to get the previous weight reading for the current client being viewed. As it is right now it retrieves the weight from the previous record regardless of client.
You did specify "previous consecutive record".
a) limit your found set to only records for that client so that such a mis-reference cannot occur when looking at your data.
b) In some reports, you might be able to group your records by client via sorting records to achieve the same result.
Let ( [N = Get ( recordNumber ) ;
C = GetNthRecord ( If ( N > 1 ; GetNthRecord ( YourTable::CustomerID ; N - 1 ) )
If ( N > 1 AND C = YourTable::CustomerID ; GetNthRecord ( YourTable::Field ; N - 1 ) )
) // let
C) Don't use getNthRecord, There are ways to set up a self join in Manage | Database | relationships or using ExecuteSQL() that will allow a given record to link to the "previous record with same customer ID" over all the records in your table--no matter what state your current found set is in. Needless to say, this takes quite a bit more "work" to set up than the other options.
I realize my first question was incomplete considering my intended use. I have enough to go on now thanks to your suggestions.