Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Calcualating % Change from one event to the next Post Reply Post New Topic
Author Message
apbeaulne
Newbie
Newbie
Avatar

Joined: 05 Dec 2007
Location: Canada
Online Status: Offline
Posts: 11
Quote apbeaulne Replybullet Topic: Calcualating % Change from one event to the next
    Posted: 05 Dec 2007 at 2:45pm
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
Paul
IP IP Logged
Lugh
Senior Member
Senior Member
Avatar

Joined: 14 Nov 2007
Online Status: Offline
Posts: 377
Quote Lugh Replybullet Posted: 07 Dec 2007 at 7:20am
Answered in the Report Design forum.

Look into the Previous function.
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.016 seconds.