Simple Example
Fields
Identification Number
Event Date
Outcome
Each person (Identification Number) can have a number of event outcomes.
For example a score on a test.
I would llike to calculate the Percent Change in score from one event to the next.
The Report might look like this
ID Date Score %Change
1 April 10 2007 10 N/A
1 May 12 2007 11 10.00
1 June 12 2007 12 9.00
2 April 10 2007 10 N/A
2 May 12 2007 11 10.00
2 June 12 2007 12 9.00
% Change ((12 - 11)/11) * 100
Each score is compared to the previous score.
The data is sorted by Chart and Event Date.
In other programs I have been able to use a LAG function
and so the code would be
do if Chart = lag(chart)
%Change = ((score - lag (score) )/ lag (score)) * 100
end if
Paul