Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Report Design
Message Icon Topic: Summing Issue Post Reply Post New Topic
Author Message
Shelleo71
Newbie
Newbie
Avatar

Joined: 10 Aug 2009
Location: United States
Online Status: Offline
Posts: 8
Quote Shelleo71 Replybullet Topic: Summing Issue
    Posted: 10 Aug 2009 at 7:14am

My report consists of (5) summing columns.  IE:  contract amount, change orders, revised contract etc.

This report is sorted by Job Number.  With that said, there are times where (1) Job Number will have (2) customers attached to it, in turn having (2) rows printed.  The 2nd line is exact duplicate of the first, only difference is the customer name.  I've successfully written a formula to only have one row printed to show the contract, change orders, revised contract etc. 
 
My dilema is that because of the jobs with (2) customers the grand totals at the bottom of the page now have duplicate contract, chang order etc. amounts in them.
 
How do I only Sum just what is printed???
 
Thanks in advance for any help!!! 
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 10 Aug 2009 at 7:21am
write a formula with a shared variable to track the values that displayed.  Probably can be added onto the formula that suppresses the duplicated value.
 
Running totals might be a solution, but DBlank is the master of those.  I use shared variables for all my 'running' totals.
 
HTH
IP IP Logged
Shelleo71
Newbie
Newbie
Avatar

Joined: 10 Aug 2009
Location: United States
Online Status: Offline
Posts: 8
Quote Shelleo71 Replybullet Posted: 10 Aug 2009 at 7:28am

Shared Variable in a formula???  A little more assistance.  Not exactly sure what you mean.  I'm not new to Crystal but when it comes to formulas I'm a novice I use very basic ones.  Thank you.

IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 10 Aug 2009 at 8:43am
Try using a Running Total (RT).
Make sure you are sorting so that the duplicate rows are one after each other.
Test it for 1 first befor creating all 5.
Right click on the RT Fields and select NEW.
Name it "Contract Amount"
Field to summarize= table.contract_amount_field
Type of Summary= SUM (I am assuming you are adding the field up here)
Evaulate - change to "On Change of field" - select table.Job_Number
Reset as "Never"
Place this RT field in your report footer (RTs do not work in headers).
If I understood your post correctly this should give you the correct value.
If it does, repeat the process per SUM you want changing the field to evaluate as the field you want summed.


Edited by DBlank - 10 Aug 2009 at 8:44am
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 10 Aug 2009 at 8:53am
If you are comfortable with running totals, by all means, follow DBlank's post.
 
shared variables are a means for you keep counts/values and use them as you will in the report, independent of detail/groups that you have created. I use them like running totals for the most part, but you can use the variable to insert page breaks or conditional suppress fields based on the value of the variable you are tracking.
 
you can create/track numbers, dates, strings, booleans, and shared variables are the only way to get a value in a subreport back to the main report to be used in further calculations.
 
They are really easy to use, and basically, once declared are available.  Typically 3 formulas are required. 1 to reset the variable, 1 to increment, and 1 to display.
 
Take a look at the help file, it is fairly helpful, it is how I learned.
 
If you need further assistance.... well that's what we are here for.
IP IP Logged
Shelleo71
Newbie
Newbie
Avatar

Joined: 10 Aug 2009
Location: United States
Online Status: Offline
Posts: 8
Quote Shelleo71 Replybullet Posted: 10 Aug 2009 at 9:06am
THANK YOU THANK YOU THANK YOU!!!
 
I used the running total and it worked.  Glad I decided to ask for assistance!  I'll finish now doing RT's for the remaining columns and the report should be complete! 
 
Again thanks for the responses.  I will be looking into the Shared Variables also. 
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 10 Aug 2009 at 9:06am
Sorry Lockwelle, didn't mean to intrude but I guessed that using RTs might expidite the process in this instance Embarrassed
 
That being said...
Shelleo,
long term you will definately want to learn about variables. The Help files are good but if you read posts on this forum (particularly answered by Lockwelle) you will learn quite a bit about how to write and use them.
IP IP Logged
Shelleo71
Newbie
Newbie
Avatar

Joined: 10 Aug 2009
Location: United States
Online Status: Offline
Posts: 8
Quote Shelleo71 Replybullet Posted: 10 Aug 2009 at 9:15am
Appreciate that.  Most of my reports that I work with, tend to be canned reports from our accounting software that I tweak to fit our company's needs.  I've pretty much taught myself Crystal and am a novice for the most part. 
 
Glad I found this forum, will definitely be checking in and reviewing as needed. 
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 10 Aug 2009 at 1:27pm
No problem.  It seems that most people are more comfortable with Running Totals, and that is your forte...and I did mention that they might work, and you are the one to turn to for them.  So you weren't intruding.  There is more than 1 way to skin a cat, and my way is but one of them.
 
Really, I don't get running totals...It is something that I need to learn :)
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.