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

calculate balances outside selection parameters

Status
Not open for further replies.

robmason10

Technical User
Apr 9, 2002
68
GB
Solution required for calculating opening balances - would appreciate your innovative solutions.

I have a report that queries a very large transaction file called LEDGER. The report currently uses parameter fields to restrict the date range of transactions displayed. Problem is I need the report to show openeing and closing balances - the DB does not store balances so the opening balance can only be calculated by Sum(BK_Sum) where Val_date < Start_date_param

How do I implement this - probably a simple solution but can't get my head round it....

Ta in advance
 
Do your parameters limit what is selected (report selection) or just what is shown?

Is this one balance, or a large number of balances?

Which version of Crystal?

Your best solution would be a running total, that includes records that are not displayed. You can select but not display by suppressing sections with unwanted values, using right-click, Format Section and use the selection formula.

Sub-reports are another method, but are slow. Avoid if possible.

Madawc Williams
East Anglia, Great Britain
 
Do your parameters limit what is selected (report selection) or just what is shown? - Limit what is selected but I appreciate this will have to change

Is this one balance, or a large number of balances? One balance per group

Which version of Crystal? 8.5

Your best solution would be a running total, that includes records that are not displayed. You can select but not display by suppressing sections with unwanted values, using right-click, Format Section and use the selection formula. Will see what it look like - thanks for the help

Sub-reports are another method, but are slow. Avoid if possible.
 
I've created P&L reports for various investment banks, who all went with the same approach.

The date parameters were used in the main report to limit the data selection. A subreport in the main report header was driving off've the start date, extracting everything earlier in order to derive the opening balance. Being as the subreport executes once, it's no slower than if you run the main report with no date criteria, and a straight sum of transactions is usually fine, as opposed to worrying about populating the details section and having running totals.

Naith
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top