Thank you so much Lbass and Dgillz for responding. The max does work on either positive or negative. My problem actually was my one to many databases. For some reason it is not picking up the negative balances.
I have 3 databases : a master file and the actual and budget files. The master file has all the records. The actuals has the current and previous years' balances and the budget file has the budget and forecast balances.
Master file keys: Company, Accounting Unit, Account, SubAccount
Actuals key: Company, Fiscal Year, Accounting Unit, Account, SubAccount
Budget key: Company, Fiscal Year, Budget Number, Accounting Unit, Account and SubAccount.
I link the master to the actuals via the 4 keys, joined as inner, then I link the forecast to the budget via the 4 keys (no fiscal year or budget number) with right outer.
The report should show the balances for all of the previous years, all of the budget for the current year, all of the forecast for the current year and all actuals for the current year.
My parameters are as follows:
{master.chartname} = "CHART1"
and
actuals.fiscalyear} = {@Current Year} or
{actuals.fiscalyear} = ({@Current Year} - 1))
and
amster.company = {?Company} and
master.accountingunit = {?Accounting Unit})
It's picking up an inordinate number of data which affects performance and somehow it is not picking up the data from the budget file if the actuals is from the previous year.
I think my problem lies in the linking and the data selection but I have tried many ways of linking and nothing seems to work. That's why I thought about a subreport for the budget and forecast numbers but I hit a snag in totalling for the grouping in the (previous threads).
I am at a loss..please point me in the right direction..