Hi experts,
I'm working on a requirement to copy values from one model to another and aggregate to values.
Basically my script looks like that:
...
*LOOPUP OTHER_MODEL
*DIM VERSION = VERSION
*DIM TIME = TIME
*FOR %LOOP_CST% = %COSTCENTER_SET%
*DIM CST_%LOOP_CST%: COSTCENTER = %LOOP_CST%
*NEXT
*ENDLOOKUP
*FOR %SEL_CST% = %COSTCENTER_SET%
*WHEN COSTCENTER
*IS = %SEL_KST%
*WHEN COST_TYPE
*IS = "CST_NA"
*REC(EXPRESSION = LOOKUP(%SEL_CST%), COSTCENTER = [COSTCENTER].AGGR_LEVEL, CURRENCY = "CURR_NA")
*ELSE
*REC(EXPRESSION = LOOKUP(%SEL_CST%), COSTCENTER = [COSTCENTER].AGGR_LEVEL, CURRENCY = "EUR")
*ENDWHEN
*ENDWHEN
*NEXT
*COMMIT
Unfortunately, this is not working.
If I include the for-loop inside the when-loop it is working. However, the values are multiplied based on the number of records.
Is there another possibility to solve this issue?
Thanks in advance,
Benjamin