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

Problem SUMming a Computed SUMmed group field

Status
Not open for further replies.

pullesj

Programmer
Sep 2, 2003
21
US
This is going to sound weird.

Anyone have any idea why summing a computed field in a group and then summing this summed computed field in the summary band in a datawindow results in a incorrect total? Any workarounds? It's behaving the same way in PB 7 and PB 9. Is it a problem with how my group is defined?

Example:

Detail rows are columns from SQL Server DB

Grp 1 credit column is a computed field summing debit column from detail - Grp 1 consists of ACCT and C-CTR columns

Grand Total xxxx debit is just a computed field summed detail column debit
xxxxy credit is a computed field summed of the group 1 summed computed field credit


ACCT C-CTR DEBIT CREDIT
1234 12345 12341 ______ (detail)
1234 23456 23451 ______ (detail)
1234 _____ _____ _35792 (grp 1)

...
...
...
...

TOTL _____ xxxxx xxxxxy (summary)


xxxxx for debit is correct
xxxxxy for credit is incorrect
 
Would summing the 'xxxxxy' column for the entire dw (forget about the group sums) work?
 
I was wondering if anyone would respond with that answer :)

It is a little more involved than that since I was having to do reversing entries based on whether the debit/credit was negative or not. I did not include it in my example in trying to keep the example simple, but I digress.

Turned out that my SQL Grouping and ordering and the definition of my group was not correct. I could not see the forrest for the trees in my problem. I will endeavor to be more thorough in my analysis before jumping ship!

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top