Link to home
Start Free TrialLog in
Avatar of yyyafp1
yyyafp1Flag for United States of America

asked on

Crystal Reports Exclude

I've creating a report in Crystal Reports 10.  I need to create a formula to exclude some line items from the report.  This is what I need to do:
"Total for line items that do not have CostType_CD = 'Expense'.  then a Total for line items that do have CostType_CD = 'Expense'.  (I assume is one forumula)

Next formula would be:

Sum of ReserveAmount1 for all reserves where ReserveType1_CD in ('Bodily Injury', 'Expense', 'Pulmonary Disease')

Do I need to create groups?

I need very explicit instructions, I've only attended a two day Intro class on Crystal.  Therefore, if any of this sounds strange, tell me so, I'm learning.

Thanks in advance
Avatar of Mike McCracken
Mike McCracken

Try this

Build 3 running totals
Display the field insertion popup
Click the Running Total tab
Click NEW (may have to right click)

First one
Name - Total_NoExpense
Type - Sum
Field - CostField
Reset - Never
Execute - Use formula
Formula -
  {CotType_CD} <> 'Expense'

Similarly for the other one
Name - Total_Expense
Type - Sum
Field - CostField
Reset - Never
Execute - Use formula
Formula -
  {CotType_CD} = 'Expense'

Third
Name - Total_Reserve
Type - Sum
Field - ReserveAmount1
Reset - Never
Execute - Use formula
Formula -
  {ReserveType1_CD} in ('Bodily Injury', 'Expense', 'Pulmonary Disease')

mlmcc
Avatar of yyyafp1

ASKER

According to Expert Wykabrian, "A union will only display the structure of the first select statement but the table will contain the combination of both tables in the Record set."

Therefore, when I create thie third suggested running total, it should look like this:  
Name - Total_Reserve
Type - Sum
Field - Command.LineItemAmount
Reset - Never
Execute - Use formula
Formula -
  {Command.CostType_CD} in ('Bodily Injury', 'Expense', 'Pulmonary Disease'

When I do this, I receive the error message:  ')' is missing.  
The formula needs a ) at the end

  {Command.CostType_CD} in ('Bodily Injury', 'Expense', 'Pulmonary Disease' )

mlmcc
Avatar of yyyafp1

ASKER

Although there isn't a ')'  in the example, there is one in the formula that still isn't working.  

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
Glad i could help

mlmcc