I have a formula field in a group footer. I need to sum that formula field in the report footer.

Hi,

I am using Crystal REports.  I have a formula field in a group footer.  I need to sum said formula field in the report footer.  How can I do this?
jwebster77Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

peter57rCommented:
Please post the formula field code.
0
jwebster77Author Commented:
{@TimeHalf} * {@TimeHalfRate}=@overtimedollar

Overtimedollar is the field I need to add and display in report footer.
0
Kurt ReinhardtSr. Business Intelligence Consultant/ArchitectCommented:
Since this is a nested formula, you'll also need to post the code behind the other formulas, too.  That being said, my gut feeling is you may need to create a running total or manual running total in order to summarize the group formula. We'll be able to provide more detail once we see the code.
0
Become a CompTIA Certified Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

jwebster77Author Commented:
K.  @TimeHalf is = If {#TotalFinalHours} > 40 Then
    {#TotalFinalHours} - 40
Else
    0

@TimeHalfRate is = {CTL_HOURLY.CURRENTRATE} * 1.5
0
peter57rCommented:
Well we could go round in circles defining each formula field.. but i suspect we will end up in the same place..

In the report header add a variable..

 //I'm assuming that {@TimeHalfRate} is currency - it it's number then change the variable type
currencyvar otTotal:=0;
""

in @overtimedollar modify to...

whileprintingrecords;
currencyvar ottotal;
ottotal:=ottotal+{@TimeHalf} * {@TimeHalfRate};
{@TimeHalf} * {@TimeHalfRate}

in the report footer add another formula field..

whileprintingrecords;
currencyvar ottotal;
ottotal

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Kurt ReinhardtSr. Business Intelligence Consultant/ArchitectCommented:
I think you're going to run into problems, since you're using running totals as the basis for your nested formulas.  In other words, you'd have to take a running total of a running total.  That won't work.  You'll need to take the basic requirements for the original running total and expose them in your new manual running total rather than just refer to the formulas that use them.
0
peter57rCommented:
Indeed.

When I posted my 3 formulas above, I hadn't anticipated a running total being used in a formula field.
0
GJParkerCommented:
You should be able to do this with a manual running total, based on the @overtimedollar formula as long as you include teh instruction on when to evaluate

//@OvertimeDollarTotal Accum - Place this in the group footer
EvaluateAfter({@overtimedollar})
WhilePrintingRecords;
NumberVar OTDTotal := OTDTotal + {@overtimedollar}

//@OvertimeDollarTotal Display - place this in the report footer
WhilePrintingRecords;
NumberVar OTDTotal

0
James0628Commented:
 GJParker,

 FWIW, I don't see any point to using EvaluateAfter, since you're using @overtimedollar in your formula.  I don't think it will do any harm either.  It just doesn't seem necessary.


 And it seems to me like Peter's formulas would work, as long as @overtimedollar only produces "real" figures that should be included in the total, and isn't sometimes suppressed or something.  If it was sometimes suppressed, those suppressed figures would also be included in the total in Peter's version.  But if it only produces figures that should be included in the total, I don't see a problem.  But I could be missing something.
 
 James
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Crystal Reports

From novice to tech pro — start learning today.