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

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

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
0
yyyafp1
Asked:
yyyafp1
  • 4
  • 2
1 Solution
 
mlmccCommented:
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
 
yyyafp1Author 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
 
mlmccCommented:
The formula needs a ) at the end

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

mlmcc
0
New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

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

0
 
mlmccCommented:
Try changing the ( ) to [ ]

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

mlmcc
0
 
mlmccCommented:
Glad i could help

mlmcc
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now