Report Design
 Crystal Reports Forum : Crystal Reports for Visual Studio 2005 and Newer : Report Design
Message Icon Topic: Eliminating duplicates Post Reply Post New Topic
Author Message
9morty9
Newbie
Newbie


Joined: 06 Oct 2009
Location: Australia
Online Status: Offline
Posts: 3
Quote 9morty9 Replybullet Topic: Eliminating duplicates
    Posted: 03 Nov 2009 at 10:46pm
Hi,
 
I have a report that uses 3 tables.  1st table is the financial accounts master, 2nd table is the summary financial actual information by by year and period and the 3rd table is the summary financial budget information by by year and period.  I am linking the 1st and 2nd table by 'account index' and the 2nd and third tables by 'account index' and 'period id'.  I am trying to create columns for Month Actual, Month Budget, YTD Actual and YTD Budget.  My problem is that data stored in the 2nd and 3rd tables store the information by period and account.  I am grouping on the account number.  At the detail level I am getting duplicates on amounts by account (i assume because the accounts are duplicated for periods in the 2nd and third tables).  Can anyone suggest how I might remove the duplicates???   I have tried suppressing the duplicates at the field level but am unsure how or if I can suppress the duplicates when I sum at the group level. 
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 04 Nov 2009 at 6:41am

if you suppress values in the report, you will need to use either a formula or a running total.  I use formulas, DBlank uses running totals.  In the formula, you would add the values that are not suppressed and display them in the footer.

Typically, formulas for summing come in groups of three. 1 to reset usually in the group header, 1 to display usually in the group footer, and 1 to increment usually in the detail section.
 
HTH
IP IP Logged
9morty9
Newbie
Newbie


Joined: 06 Oct 2009
Location: Australia
Online Status: Offline
Posts: 3
Quote 9morty9 Replybullet Posted: 04 Nov 2009 at 1:37pm
Thanks for that information.  Are you able to give me an idea of what the formula might look like.  I am not sure how to include the supressed function in the formula. 
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 05 Nov 2009 at 6:08am
the formula for incrementing would look something like:
shared numbervar aVar;
 
if {table.fieldx} (not a duplicate logic) then
  aVar := aVar + {table.fieldy};
 
""//to hide the calculate so that you can place the formula anywhere on te report.
 
The hard part is defining the (not a duplicate logic)
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.012 seconds.