DavidEman Posted June 17, 2009 Posted June 17, 2009 I think this is a pretty basic question, but I just can't seem to figure it out. I am generating a report which has two summary fields - Addition (totaling numbers), Subtraction (totaling numbers) and a calcuation field Balance (Addition - Subtraction). I want the report to only show amounts wher Balance is greater than zero. I can't do a find on the summary field to exclude records, so how can I accomplish this. Thanks so much for your help. David
comment Posted June 17, 2009 Posted June 17, 2009 This is a kind of circular logic: summary fields summarize the found set. If you omit records from the found set, the summaries will recalculate. You cannot build a found set on the basis of expected results. What is the real issue that you're trying to solve here?
DavidEman Posted June 19, 2009 Author Posted June 19, 2009 Thanks for the response. That make sense. Basically what I am trying to do is this: Let's say I have an Invoice table with fields: Customer Invoice Amount Payment I summarize all Invoice Amounts and all Payments, grouped by Customer and then calc a balance by subtracting the Summary Payment from Summary Invoice Amount. On the report I want to exclude all Customers with a zero balance. I can not create a Balance (calc) field because I am importing the information from somewhere else and Invoice Amount and Payment are not in the same record. They are in different records, no one record has an Invoice Amount and a Payment. I can sort of accomplish what I want by creating a Customer record in a separate database, but I am trying to avoid this. I hope that makes sense. Thanks again for your help. David
comment Posted June 19, 2009 Posted June 19, 2009 After finding the records and sorting them by Customer, you need to loop and omit records where: GetSummary ( sTotalAmount ; Customer ) ≤ GetSummary ( sTotalPayment ; Customer ) If you have a large amount of records, you can make this faster by using Mikhail Edoshin's "FastSummaries" technique: basically, if the first record of the group meets the above condition, you omit the entire group at once using GetSummary ( sCount ; Customer ).
Recommended Posts
This topic is 5635 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now