Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Perform a calculation on data Post Reply Post New Topic
Author Message
Ace76
Newbie
Newbie
Avatar

Joined: 13 Jun 2013
Location: Canada
Online Status: Offline
Posts: 7
Quote Ace76 Replybullet Topic: Perform a calculation on data
    Posted: 17 Jun 2013 at 10:28am
I am trying to figure out how I can perform a calculation on data in the same column but different rows.
 
Tail # AFH Added QTY Current AFH HRS Between Oil Addition Liters/10Hrs
(Max=1.42)
156101 7249.7 1.0 7272.7 33.7 0.297
156101 7216.0 1.0 7272.7 25.3 0.395
156101 7190.7 1.0 7272.7
156102 8439.1 1.0 8461.2
156105 9252.8 1.0 9267.1 22.0 0.455
156105 9230.8 1.0 9267.1
156106 8288.9 1.0 8303.2 3.5 2.857
156106 8285.4 1.0 8303.2
 
This is an Excel version of what I want my Crystal to be able to do.
 
The first 4 columns are the results set .
 
The 'HRS Between Oil Addition' and the 'Liters/10 HRS' columns are calculated.
 
HRS Between Oil Addition column = AFH(x) - AFH(y). If row y is blank then the column is left blank as well.
 
The Liters/10 HRS = QTY Added(x) / HRS Between Oil Addition(x). If HRS Between Oil Addition is blank then the column is left blank.
 
Any suggestions on how I can accomplish this in Crystal??
 
Thanks!
Ace
 
IP IP Logged
Sastry
Moderator
Moderator
Avatar

Joined: 16 Jul 2012
Online Status: Offline
Posts: 537
Quote Sastry Replybullet Posted: 18 Jun 2013 at 3:07am
HI

First you have to achive HRS between Oil Additon using below formula

if next({AFH}) = 0 THEN 0 ELSE
{AFH}-NEXT({AFH})

Now you will get 0 when next afh is null or 0, you can suppres this value by going into format field--common tab-- suppress
Thanks,
Sastry
IP IP Logged
Ace76
Newbie
Newbie
Avatar

Joined: 13 Jun 2013
Location: Canada
Online Status: Offline
Posts: 7
Quote Ace76 Replybullet Posted: 19 Jun 2013 at 6:39am
This appears to be working.
 
Have to create more test data to know for sure.
 
But thanks for your help!
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.000 seconds.