Print Page | Close Window

Combining database group data

Printed From: Crystal Reports Book
Category: Crystal Reports for Visual Studio 2005 and Newer
Forum Name: Report Design
Forum Discription: The best way to design a report and problems you have encountered
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=12221
Printed Date: 21 Apr 2025 at 1:17am


Topic: Combining database group data
Posted By: SPackard
Subject: Combining database group data
Date Posted: 03 Feb 2011 at 6:27am
Hi -
 
I'm very sorry if this has already been asked but I've looked through this and other forums and used search engines without finding anything addressing what I'm trying to do, although a couple came close.   Also, I'm just really getting my feet wet into Crystal Reports coding, though I've gotten pretty well into a couple of books.
 
 
Here's basically what I'm trying to do: 
 
My company tracks sales within an SQL database where they are assigned by what type of sales customer they are.   These are things like "Standard Wholesale" "High Volume Wholesale" "Retail walk in" "Local Retail Delivery" "Out of state shipment" "Non Profit Sale"  "Corporate" "Employee Discount" etc.
 
So we have a sales report that breaks down all the sales into these catagories.
 
The issue is that there are a real lot of catagories and we really would rather consolidate them in the report.   We need all these different catagories because they have different prices and sales rules.
 
I'd like to get rid of "High volume wholesale" and just have "Wholesale" by making it put these two records into one, combining the totals.   I'd also like to get rid of "employee discount" and just count those as retail.  Also, I'd like to just count the "local delivery" as retail.
 
THe thing is that the reports are already written, as they came with the software we use (Counterpoint SQL) and I'd rather not have to completely re-write the reports to do this.



Replies:
Posted By: lockwelle
Date Posted: 04 Feb 2011 at 3:11am
create a formula, where you 'convert' the values in the database to the values you want, then change the grouping field from the database field to the formula.
 
The formula would look something like:
if {table.field} = 'Employee Discount' Then
  'Retail'
else
  if {table.field} = 'High Volumne Wholesale' Then
     'Wholesale'
  else
     {table.field}
 
of course there will be more cases, but you get the idea.
 
HTH



Print Page | Close Window