cancel
Showing results for 
Search instead for 
Did you mean: 

Data Action to swing account values

Thandeka
Explorer
0 Kudos
323

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.

 

View Entire Topic
hartmut_koerner
Product and Topic Expert
Product and Topic Expert
0 Kudos

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.

Thandeka
Explorer
0 Kudos

@hartmut_koerner

Thank you for your suggestion. I will try it and hope it works. Will let you know. Thanks again 🙂

Thandeka
Explorer
0 Kudos
Hi Hartmut
Thandeka
Explorer
0 Kudos
Hi I was not able to implement this. But thank you so much for replying. I will still look into this!