Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to SUM from a SYS field

Status
Not open for further replies.

CappsRLO

Vendor
Apr 18, 2007
31
US
Using Crystal 8.5
I have a Summary report showing multiple records with details for each record.
I have a SYS.Total field which calculates the sum of a field in a group header + a field in a group footer.
Now I am trying to get a Grand Total but it won't let me create a Sum of the SYS.Total field to put in the report footer.
Any suggestions?
 
How does the {sys.total} field display if placed in the detail section? Place that and the field in the group footer (what is it) that you are adding to it in the detail section and show us a sample of records from the detail section. What we need to know here is whether the "fields" in the GH And GF are actually database fields, and whether they have the same value in every detail section, or whether you are really referring to summary fields (either inserted or formulas).

-LB
 
In the GH2 I have an actual Database Field called OriginalValue
In GF2 I have a Summary field that Sums up a Database field in the Details section called ApprovedAmount
In GF1 I have a SYS.Total field as follows:
(Sum ({Prime Contract Change Orders.PrimeContractCO~ApprovedAmount}, {@sys.ContractNumberGroup}) + {Prime Contract Change Orders.Contracts~OrigValue});

As you can tell in GH2 my grouping is based off the sys.ContractNumberGroup so each different Contract Number will have a SYS.Total at the bottom of the record.

Now at the bottom of the Report I want a GrandTotal which sums up all of the SYS.Total

Let me know if you need any further info.
 
Okay, well, that is a formula, not a field, which was what was confusing me. You can use two formulas to summarize this:

//{@accum} to be placed in GF#1:
whileprintingrecords;
numbervar gt := gt + {@SysTotal};//your formula name

//{@display} to be placed in the report footer:
whileprintingrecords;
numbervar gt;

-LB
 
Sorry if I sound like an idiot so please bear with me.
When using your Forumla provided Crystal gives me an error:
'A number is required here' at the 'gt' part

I do not see how the formula you provided Sums up the amounts from my sys.Total. From what I can tell it is only providing some sort of Shared Variable.

I have attached a Word Doc that has a print screen of some sample data as well as a print screen of the section of the report in Crystal. Per the sample data I need to total up the @sys.RevisedContractAmount of $240,727 + $41,233 into a Grand Total field.
 
 http://www.savefile.com/files/1559134
If sys.total is a currency, then change the formulas to use currencyvar instead of numbervar. And yes, the formula does sum the amount.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top