-
Got it to work!!!!!! I have one Query, InventoryQuery whose results are the field YearKey and Inv (inventory calculated using recursion)
Inv:IIF([Procurement]![YearKey] = [StartYear]; [Procurement]![Acq]; [Procurement]![Acq] + [AttritionRate]*DLookUp("[Inv]", "InventoryQuery", "[Procurement]![YearKey]="&[Procurement]![YearKey]-1))
-
Why the IIF? Is that an expression for an alias within your query?
-
IIF is an if/else statement. In recursion you need a base case/termination case. So, I say "if the year is the first year of the program then inventory is just that year's acquisition, else inventory is that year's acquisition + previous year's inventory*attrition"
The expression in the IIF statement asks weither the record is my base case
Does that answer your question?
-
Yes it does, thank you. Glad you were able to get it all in one expression. Nice
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules