[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
• Status: Solved
• Priority: Medium
• Security: Public
• Views: 389

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.

0
yyyafp1
• 4
• 2
1 Solution

Commented:
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
0

Author Commented:
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.
0

Commented:
The formula needs a ) at the end

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

mlmcc
0

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

0

Commented:
Try changing the ( ) to [ ]

{Command.CostType_CD} in ['Bodily Injury', 'Expense', 'Pulmonary Disease' ]

mlmcc
0

Commented: