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

field cannot be summarized

Status
Not open for further replies.

mathblaster

Technical User
Jun 29, 2005
9
US
Hello,
I'm unable to do something that should be straight forward...
I'm using CR 9 with SQL.

In my report I have 5 columns (2004, 2005, 2006, 2007, 2008). 04 and 05 are actual YTDAmount numbers from SQL data base. 06, 07, 08 are based on a formula (05*factor of %increase). In the group footer, I want to sum 06, 07, 08 - but I can't.
I get the message "This field cannot be summarized".

My fields are in the same group header, and I'm trying to create a 'summing' formula in the group footer. I also need to account for a beginning cash balance in each column which is in a different group header

06 example of formula is this Sum ({@YTDAmount}, {@Type})*{@factor2}

This is factor2 formula
if {@DEPT} = " 9" and LEFT(GroupName ({@Type}),2)= "08" then 1.45
else
if {@DEPT} = " 9" and LEFT(GroupName ({@Type}),2)= "09" then 1.02
else
if {@DEPT} = "000" and LEFT(GroupName ({@Type}),2)= "20" then 1.03
else
if {@DEPT} = "000" and LEFT(GroupName ({@Type}),2)= "21" then 1.03
else

I reset each year

How else can I do this??


 
The field is already summarized by using the function SUM. Try building a running total off of them.
 
If I understand this right, it is actually summarizing the prior year's data with this command Sum ({@YTDAmount}, {@Type})*{@factor2}. The YTDAmount is in reference to 2005 actuals. When I try to build a running total, there are no tables or fields that match up to the 2006 calculated data.

What other formulas or data can I provide to better explain the problem.


 
The problem isn't really clear. What is the report structure? What are your groups? What are the contents of the nested formulas? Can't really tell what you are trying to sum for sure.

Without knowing any of the above, if your current (summary) formulas are displaying correctly and you want to then sum each formula across types, then you can use variables:

//{@accum} to be placed in the section containing your summary formula:
whileprintingrecords;
numbervar sum06 := sum06 + {@your06formula}:

Then in the report footer (or higher order group footer), use:

//{@displaysum06}:
whileprintingrecords;
numbervar sum06;

If your formula's result is a currency, change the numbervar to currencyvar in both formulas.

If you are trying to summarize at a higher order group level, then you need a reset formula placed in the higher group header:

whileprintingrecords;
numbervar sum06 := 0;

-LB
 
Sorry- Report Structure looks like this:

Year 2004 2005 2006 2007 2008
(GH1a) 100.00 250.00 515.00 XXXXX XXXX

Revenue

(GH3) 100 125.00 137.50 150 180.00
(GH3) 1,000 1100 1200 1300 1300.00

(GF2) 1200.00 1475.00 XXXXX XXXXX XXXXX

Expense

(GH3) 900.00 910.00 1000.00 1100.00 1100.00
(GH3) 50.00 50.00 100.00 110.00 120.00

(GF2) 950.00 960.00 1100.00 1210.00 1220.00

(GF1a) 250.00 515.00 XXXXX XXXXXX XXXXX

Trying to sum GF1a. Starting with GH1a all the way down.
Does that explain it better?
 
You didn't really answer most of my questions, but if you mean that you want to sum a formula that is GF1a across ALL GF1a instances, then try my formulas above. You could create a separate variable for each formula you want to sum within {@accum}. Then you would need a separate display formula for each total to be placed in the report footer like {@displaysum06}.

-LB
 
Sorry. Guess I missed a few answers, was a long day.

(PH) 2006

(GH1a) @estTotal whileprintingrecords;
//Sum ({@YTDAmount}, {@fund})
{@Yr1Total}

(GH2) @reset whileprintingrecords;
numbervar estimate:=0

(GH3) @estimate Sum ({@YTDAmount}, {@Type})*{@factor2}

(details)@estimate Sum ({@YTDAmount}, {@Type})*{@factor2}

(GF2) @display whileprintingrecords;
numbervar estimate;
estimate

(GF1a) @Yr2Total EvaluateAfter ({@estTotal});
Sum ({@Last YTDAmount}, {@FUND})+ {@estTotal}

I get an answer, but the math is incorrect. I tried your formulas and they to render incorrect math. I want to add GH1a plus GF2's and place the answer in GF1a

Hope that makes it more clear.
 
My formulas are just summing your numbers. Is the estimate variable your attempt to implement my earlier suggestion?

Please also state the names of your groups.

Try this (in case I'm guessing correctly):

Leave {@reset} where it is.

Add another formula {@resetgrp1} to be placed in GH1:
whileprintingrecords;
numbervar gr1tot := 0;

Change {@estimate} to the following and place it ONLY in GH3:

whileprintingrecords;
numbervar estimate := estimate + Sum ({@YTDAmount}, {@Type})*{@factor2};
numbervar gr1tot := gr1tot + Sum ({@YTDAmount}, {@Type})*{@factor2};

Leave {@display} where it is and add this formula in GF1:

whileprintingrecords;
numbervar gr1tot;
gr1tot + {@estTotal}

-LB
 
estimate was not an attempt to implement your earlier suggestion?

estimate is the percentage adjustment to the prior years actuals.

Group #1 Name: @fund
Group #2 Name: @DEPT
Group #3 Name: @type
Group #4 Name: @CRECode

When I modified the estimate variable with your formula, it changed the numbers dramatically. I think the original formula is correct. We are close I think, I did see at one point the correct number in the GF1, however GF2 was off as was GH3
 
I can't really help you as you are not providing the necessary information. Sorry.

-LB
 
It's not that I am not providing the necessary information, I would gladly share all of the information.

I guess I don't quite understand what it is you need to see in order to help. I am real new at this, so I appologize for my lack of understanding.

-Sorry you gave up on this.

Anyone else out there able to help on this?

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top