Report Design
 Crystal Reports Forum : Crystal Reports for Visual Studio 2005 and Newer : Report Design
Message Icon Topic: Combining database group data Post Reply Post New Topic
Author Message
SPackard
Newbie
Newbie


Joined: 03 Feb 2011
Location: United States
Online Status: Offline
Posts: 3
Quote SPackard Replybullet Topic: Combining database group data
    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.
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet 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
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.031 seconds.