on 2024 Sep 04 9:56 PM
Hi Experts
I am new to data actions (script and visual) in SAC. I am tasked with a swing calculations. In simple terms, there are overdraft and cash accounts. The calculation needs to look at the overdraft accounts and check if the sum value in those accounts is positive, it needs to be moved to the cash accounts, and if its negative it stays in the overdraft accounts. Can I get some advice on how to begin this calc? The SAC model is a week model (goes down from Year>>>Quarter>>>Month>>>Week.
Example (YTD values that have been rounded to the nearest 1000
OD500 = 1000
OD600 = -42
The calculation needs to move the 1000 in OD500 to account CASH500 and the -42 needs to stay in the OD600.
Thank you in advance, experts.
Hi Thandeka,
something like that:
VARIABLEMEMBER #1 OF [d/Dimension1]
// Calculate sum over other dimensions (here: Dimension1)
DATA([d/Dimension1] = #1, [/dAccount] = "OD500") = RESULTLOOKUP([/dAccount] = "OD500")
// Check if sum is positive
IF RESULTLOOKUP([d/Dimension1] = #1, [/dAccount] = "OD500") > 0 THEN
// Do the swing
DATA([d/Dimension1] = "#", [/dAccount] = "CASH500") =
RESULTLOOKUP([d/Dimension1] = #1, [/dAccount] = "OD500")
// Delete old value
DELETE([/dAccount] = "OD500")
ENDIF
You also may check out this blog https://community.sap.com/t5/technology-blogs-by-sap/advanced-formulas-how-they-work/ba-p/13519758 that explains the steps like aggregation and IF with RESULTLOOKUP.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@hartmut_koerner
Thank you for your suggestion. I will try it and hope it works. Will let you know. Thanks again 🙂
User | Count |
---|---|
82 | |
12 | |
10 | |
10 | |
10 | |
9 | |
8 | |
7 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.