cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

SAC Data action script loop issues

former_member767054
Participant
0 Likes
1,240

Hi all.

Into a SAC planning model built to manage loan topics I have to prepare postings to several accounts

(interests posted on a "65" account, "annual payments on a "55" and so on ... to populate a planned P&L)

Some loans are very long (like > 40 years).

I've written something which is working as expected, but not "clean" from my point of view.

For some undetermined reasons all my attemps using FOR or FOREACH instruction have failed. (I'm probably missing something)

Just copy-pasting the same piece of script into many steps, changing only the time scope (with a "NEXT") works.

Please check below :

Several of my calculations are referrencing the previous year -> is there a possibility that calculated records are commited only when the script switch to next step of the advanced formula ?

(that would explain why my "not clean" solution works and the FOREACH usage don't)

(Before SAC I was using BPC and a *COMMIT was making available the result of a calculation for the next loop)

Thanks in advance for advices and thoughts.

Rgds.

Guillaume P.

View Entire Topic
William_Yu1
Product and Topic Expert
Product and Topic Expert
0 Likes

Hi guillaume_petiaux,

You could try to have FOR loop for date dimension as below.

INTEGOR @COUNT

FOR @COUNT = 0 TO 39 STEP 1
   IF RESULTLOOKUP([d/Date] = Next(@COUNT, "YEAR', %date_dec%)) ...  THEN
      ...
   ELSE
      ... 
   ENDIF
ENDFOR

Best regards, Willaim