Hi,
the basic requirement:
we have a number of groups of accounts. For each group we need to check the total value and if the total value is negative, we need to adjust the accounts in that group and post their values to other accounts.
Let me build an example:
account | account.netacc | group | amount | adjustment to be made |
---|---|---|---|---|
acc1 | acc7 | GRP01 | -100 | |
acc2 | acc8 | GRP01 | 50 | |
acc3 | acc9 | GRP01 | 75 | |
acc4 | acc10 | GRP02 | 25 | -25 |
acc5 | acc11 | GRP02 | -50 | 50 |
acc6 | acc12 | GRP02 | -50 | 50 |
acc7 | ||||
acc8 | ||||
acc9 | ||||
acc10 | -25 | |||
acc11 | 50 | |||
acc12 | 50 | |||
WK_01 | 25 (generated by BR) | |||
WK_02 | -75 (generated by BR) |
acc1, acc2 and acc3 are the first group and acc4,acc5,acc6 are the second group. At the moment I do not have hierarchy nodes for the group totals but I could add those in an additional hierarchy.
As the total for the accounts in GRP01 is positive (25) no adjustments need to be made on these accounts.
As the total for the accounts in GRP02 is negative (-75) the adjustments shown above need to be made on a separate datasource. The adjustment on each source account needs to be offset by an adjutsment on the account given in the netacc property for the source account.
My current attempt at a solution:
I use the account based calculation business rule to work out the total for each group and store it on an account but only on I_NONE so I only have one value.
I then tried this script
*SELECT(%WK_01%,[ID],"ACCOUNT","[DIMLIST_WK] = 'WK_01'")
*WHEN ACCOUNT *IS WK_01
*FOR %A% = %WK_01%
*WHEN ACCTDETAIL
*IS F_CHKSUM
*REC(EXPRESSION = ([ACCOUNT].[WK_01],[ACCTDETAIL].[F_CHKSUM]),ACCOUNT = %A%,ACCTDETAIL=F_CHKSUM,DATASRC=INPUT_WK)
*ENDWHEN
*NEXT
*ENDWHEN
However, that does not give me the result I am looking for, in fact, it doesn't seem to be doing anything. Can anyone help me?
Thanks
Arnold