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

Custom Running Sum Field

Status
Not open for further replies.

putts

Programmer
Dec 13, 2002
93
US
Occassionally when I'm building a report and try to through a field into a "grouped" section like this:

Sum ({TimeLog.Hours},{EMPLOYEES.USERID})

I get an error that says:

"The Summary/Running total field could not be created"

However I have other reports that are doing the same exact thing that work fine.

Is there some "magical trick" that has to be present for sums to work?

TIA
 
A formula cannot be summarized if it:

1) Is itself a summary field such as Sum() or Maximum()
2) Uses the Next() or Previous() functions
3) Uses a variables that is shared with subreports
4) Starts with the function WhilePrintingRecords
5) Uses another formula that contains 1 thru 4 above.



Software Sales, Training, Implementation and Support for Exact Macola, eSynergy, and Crystal Reports
dgilsdorf@trianglepartners.com
 
Neither one of the fields in my example fit any of those exceptions.

Is there anything else I should be looking for?
 
Well, I'm on to something - I guess.

If I took my timeLog table and my Employees table and created a view via SQL Server, then it allowed me to create a running sum but only by using two fields that were both on the timeLog table originally.

I went back to the report that manually joined the two tables and tried to build this same sum (using two fields from the timeLog table) and it still didn't work.

So, where I'm at now is:
1. You cant do a running sum if the report is based off two different tables
2. You cant do a running sum on two fields that are both part of the same view but not the same table

Where I need to be is:
Create a running sum using two different fields from different tables.

Any ideas on this?
 
Nevermind.

Found a way to make the sum field by using two fields from the one table.

Still kinda confused by the logic behind the whole conditional field cant be a part of a different table thing, but oh well.
 
Okay, this time I've got it.

Your conditionfield on a Sum() function MUST BE THE ITEM YOU'RE GROUPING BY!!!!

Even if there is a different field that is distinct when the grouped field is distinct, that field wont work - it has to be the group by field.

So, it's not table based, it just happened that the report I made based off the view was grouped by a different field from the other report.

Soooo, they you have it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top