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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

need help in summing fields

Status
Not open for further replies.

LearningCrystal2010

Technical User
Jan 4, 2010
6
US
I have a report that summarizes by date, which works fine, but I now need it to sum by "county-(where the goods came from)" before summing by date and need to figure out how to do that

In the detail line I have the following formula field "PADEP_MUN"
if {IPDETAIL.WCLASS} = '01' then Round({@Tons},4) else 0

In my group footer, I have the following formula field "L_PADEP_TOT_MUN"
ROUND(SUM({@PADEP_MUN}, {INBOUND.DATE},"monthly"), 1)

There is already an existing group header of INBOUND.DATE
 
We don't know how the formulas you mention relate to the initial problem you describe. What field identifies the county? What is the result you are looking for? Do you want the sum by county WITHIN each monthly date group? Or are you looking for a sum by county regardless of (across) the monthly date group?

-LB
 
You could alwasy add a grouping for the county, above the date, making the county group 1, and the date group 2. Showing the county and then the dates below it.
 
What field identifies the county? The field that identifies the county is {IPDETAIL.ORIGIN}

What is the result you are looking for? I am needing the report just to list the the sum of the all origins "counties" totaled together for the month. On the report, it just has one spot for the total of all counties for the month and does not list the counties out individually.

Do you want the sum by county WITHIN each monthly date group? Or are you looking for a sum by county regardless of (across) the monthly date group?Yes, I want to get the sum of all counties within the monthly group

 
If you are not showing the sums by county, why do you need to sum by county first? Why wouldn't the sum by date give the correct result since it would include all counties? It might be easier to explain the problem if you showed us a sample of mock data at the detail level and then showed the sum you are trying to get.

-LB
 
The issue is being caused by rounding otherwise going by date would work perfectly

The report currently lists the total as 36561.6 for the month which they need it to state 36561.8 instead


County[tab]Total by Month[tab]Rounded
CH[tab][tab][tab] 745.3900[tab][tab][tab]745.4
NW[tab][tab][tab]2188.4500[tab][tab][tab]2188.5
LM[tab][tab][tab]1290.9500[tab][tab][tab]1291.0
MT[tab][tab][tab] 2.9500[tab][tab][tab] 3.0
LF[tab][tab][tab] 2312.9000[tab][tab][tab]2312.9
FG[tab][tab][tab]24871.5700[tab][tab][tab]24871.6
MD[tab][tab][tab]5149.3800[tab][tab][tab]5149.4
[tab][tab]36561.5900[tab][tab][tab]36561.8000

Rounded 36561.6 36561.8
 
Create a formula like this for the county group section:

whileprintingrecords;
numbervar sumcnty := sumcnty + ROUND(SUM({@PADEP_MUN}, {INBOUND.DATE},"monthly"), 1);

In the Date group header, add this formula:

whileprintingrecords;
numbervar sumcnty;
if not inrepeatedgroupheader then
sumcnty := 0;

In the Date group footer, use this formula to display the result:

whileprintingrecords;
numbervar sumcnty;

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top