I'm trying to get a running sum working with two calculated fields.
The Dsum is nested within an IIF statement, to detect if it's the first starting year and provide the initial balance value.
In subsequent years, I would like to have a sum of the previous Interest and previous Contribution calculated fields added RunningBalance (taking into account the base year IIF statement).
My RunningBalance code is the following:
My results is the following:
Can anyone point out what Im doing wrong with my dsum statement?
It should read 404585,488098,519307,405530
What I am getting at, is there a way to define the base value of a dsum function?
When I try the following, to make the Interest and Contribution field be zero if there is no previous records, I get the #error value.
The Dsum is nested within an IIF statement, to detect if it's the first starting year and provide the initial balance value.
In subsequent years, I would like to have a sum of the previous Interest and previous Contribution calculated fields added RunningBalance (taking into account the base year IIF statement).
My RunningBalance code is the following:
Code:
RunningBalance: IIf([StudyYears]=[ReserveParameters]![StartingBalanceYear],[ReserveParameters]![StartingBalance],Val(Nz((DSum("[Interest]+[Contribution]","Query1","StudyYears <=" & [StudyYears])),0)))
My results is the following:
Can anyone point out what Im doing wrong with my dsum statement?
It should read 404585,488098,519307,405530
What I am getting at, is there a way to define the base value of a dsum function?
When I try the following, to make the Interest and Contribution field be zero if there is no previous records, I get the #error value.
Code:
RunningBalance: Val((DSum("Nz([Interest],0)+Nz([Contribution],0)+[StartingBalance]","Query1","StudyYears <=" & [StudyYears])))
Last edited: