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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SOS with formula fields!! 2

Status
Not open for further replies.

Gonfer

Programmer
Jul 4, 2007
22
CA
Hi guys,

Please!!, I need to solve a headache with formula fields, I need totalize each column column code on the report footer. Eeach formula field calculates the amount for each employee So, after I have grouped, I calculate the amount for each one, example: for @CALC22E I get the %value from {@RRSP22EPCODES} and calculate tha amount based in the payrate for each employee:

For the Code22E, the formula field is @CALC22E and it contains the formula:

({eeCompensate.PayRate}* Maximum({@RRSP22EPCODES},{eeEmployee.ChequeName}))/100;

The formula field for {@RRSP22EPCODES} is :
If {eePayCodes.Code} in ['22E'] Then {eePayCodes.Amount}

Depending of the code I get the value porcent from a table eePayCodes, and apply that value to calculate in @CALC22E

It works, but when I try to totalize SUM({@CALC22E}) and the remain codes for each column on the report footer, I have not choice to sum the formula field, and when I try to create a new formula to sum the msg is : "This field can not be sumarized"

Please I will apreciate any help!!!!

GonFer





 
If {eePayCodes.Code} in ['22E'] Then {eePayCodes.Amount}
else 0

 
Thanks Charliy for your response, your suggestion is correct, but it doesn't solve my problem. My only one problem is how can I to sum the formula fields on the report footer

Anyway

Thanks!
 
Gonfer,

You are unable to sumarize the field as it is based on a summary (Maximum() in this case). To total the report, you will need a RunningTotal formula which adds the results of each employee as it calculates.

In general terms, these approaches require three fields: (1) a reset, (2) an accumulation, and (3) a display.

For your situation, I would propose something like follows:
{@RESET_TotalCompensation}
Code:
WhilePrintingRecords;
Shared NumberVar TotalCompensation:=0;
**This is placed in your report header

{@ACCUM_TotalCompensation}
Code:
WhilePrintingRecords;
Shared NumberVar TotalCompensation;

TotalCompensation:=TotalCompensation+({eeCompensate.PayRate}* Maximum({@RRSP22EPCODES},{eeEmployee.ChequeName}))/100;
**This is placed in your footer for each employee

{@DISPLAY_TotalCompensation}
Code:
WhilePrintingRecords;
Shared NumberVar TotalCompensation;
**This is placed in your report footer

Please note: I put this together in short order and without any testing, the "ACCUM" formula might require some fine tuning, but I can't say for certain.

Hope this helps!

Mike
---------------------------------------------------------------
"To be alive is to revel in the moments, in the sunrise and the sunset, in the sudden and brief episodes of love and adventure,
in the hours of companionship. It is, most of all, to never be paralyzed by your fears of a future that no one can foretell."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top