Solved

# Crystal Reports Formula Help

Posted on 2011-02-18
Medium Priority
977 Views
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}) - ?
0
Question by:Trygve Thayer
• 4
• 2
• 2

LVL 101

Accepted Solution

mlmcc earned 2000 total points
ID: 34931556
How about a formula like this

If {GLAccount.SegValue3} = "990" then
0
Else
{GLTBDetail.FiscalPerOB}

Yoou can then do a summary on that formula and get the result you need.

mlmcc
0

LVL 3

Author Comment

ID: 34931569
Trying that now.
0

LVL 3

Author Comment

ID: 34931590
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}

0

Expert Comment

ID: 34931612
if you can create a group on some field you wish to seprate your records you may use SUM function as
sum({field}, {groupField})
0

LVL 3

Author Comment

ID: 34931616
OK what you game me works so I will just go with that.  Thanks very much!!!
0

LVL 3

Author Closing Comment

ID: 34931618
Thanks to the Experts and fast too!!!
0

Expert Comment

ID: 34931636
is this works fine, if so accept the answer and rank my points up
0

LVL 101

Expert Comment

ID: 34931650
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
0

## Featured Post

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirementsâ€¦
There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater â€¦