Link to home
Start Free TrialLog in
Avatar of Trygve Thayer
Trygve ThayerFlag for United States of America

asked on

Crystal Reports Formula Help

I have a formula field I am trying to get a total but due to being a novice I need some help with the syntax.  I have a field called {GLTBDetail.FiscalPerOB}  I need to add up all the values and then subtract some of the records based on certain criteria.

I can add it easy enough     Sum  ({GLTBDetail.FiscalPerOB})

Can get the subtract part   "Select the records that are equal to the field above where {GLAccount.SegValue3} = "990" and sum them

So here is what I have and looking for the ?    Sum  ({GLTBDetail.FiscalPerOB}) - ?
ASKER CERTIFIED SOLUTION
Avatar of Mike McCracken
Mike McCracken

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Trygve Thayer

ASKER

Trying that now.
Ok I called the field  PeriodOB_990  then in the formula field I was using I put in Sum ( PeriodOB_990) and it worked.    Not sure I understand what it does but does the formula you gave  exclude the "990" because it is set to 0 and then all the others fall into  {GLTBDetail.FiscalPerOB}

if you can create a group on some field you wish to seprate your records you may use SUM function as
sum({field}, {groupField})
OK what you game me works so I will just go with that.  Thanks very much!!!
Thanks to the Experts and fast too!!!
is this works fine, if so accept the answer and rank my points up
Avatar of Mike McCracken
Mike McCracken

Yes that is exactly what it does.

If you didn't need the 990 records for other purposes you could have used a selection formula to not select them for the report.

mlmcc