Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Use numbers from details section in calculations

Status
Not open for further replies.

acessn

Programmer
Feb 16, 2005
71
NO
Using Crystal Reports 9.0, Microsoft SQL

I have a report that has a formula in the details section.

This formula gives #hours sick & #hours worked and works fine.

What I need to do is to create a formula that says
(#hours sick / #hours worked * 100)

I've tried using a pie chart, but this chart uses
(#hours sick/(£hours sick + #hours worked) * 100) and gives me the wrong percentage..

Any ideas?

Regards, Bjorn
 
Have you tried to write this formula yet? If so where did it fail and what error messages did you get? Or if you got no error messages but have unexpected results, please post details of your data and expected results vs your current results.

Software Sales, Training, Implementation and Support for Macola, eSynergy, and Crystal Reports
 
Hi.

This is a pre-made report that I'm meddling with.
This is the formula situated in the details section:

Code:
whileprintingrecords;
shared NumberVar Array pc_id_array;
shared NumberVar Array time_amt_array; 
shared NumberVar i;
numbervar amount := 0;
NumberVar ii;
numbervar time_run_tot;


for ii:=1 to i
do if {PAYCODE.PAYCODEID} = pc_id_array[ii] then
(   
   amount := time_amt_array[ii];
);

time_run_tot := amount;

//amount;
if {PAYCODE.IS_MONEYCAT} = 0 then
(
if {?Pm-?decimal format} = 0 then 
totext(amount/3600, 2) else 

totext(amount/3600,"00") + ":" + 
totext(remainder(abs(amount),3600)/60,"00") 
);

Also in the detail section we have the pay code name.

The details section generates two lines; Hours sick and hours worked.

When trying to use this formula in the report footer, I only get one of them. What I need is to get these two numbers in order to calculate percentage in the footer, and I'm not sure how I can do that.

Thanks,
Bjorn
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top