on ‎2022 Oct 16 1:12 PM
Hi Team,
I am trying to create a dynamic copy Data Action. The Data Action should Copy Actual data from the FromYear to the ToYear of the chosen Plan Version.
I have parameters for TargetVersion, FromYear and ToYear that I want to use for a dynamic copy. Could you please help me with the script code.
Request clarification before answering.
praveen.kumar334
I would still prefer the Standard Data Copy Action for any Dynamic copying of records but If you really want to use the script to achieve it you can try the below approach.Adjust the Parameter ToYear to only select leaf member and cardinality one.
Now you can use below script to copy the data. I am just copying one measure "QUANTITY" for example.
MEMBERSET [d/MEASURES] = "QUANTITY"
MEMBERSET [d/Date] = BASEMEMBER([d/Date] ,%FromYear% )
INTEGER @PERIOD
//-----------------------------------------------------------------------------------
//Calculation and Data Writing
//-----------------------------------------------------------------------------------
FOREACH [d/Date]
@PERIOD=YEAR(%ToYear%)-YEAR([d/Date])
DATA([d/Date]=NEXT(@PERIOD,"YEAR",[d/Date]))=RESULTLOOKUP([d/Version]="public.Actual")
ENDFOR
Data Action Prompts for run. For ToYear, any month of the destination Year has to be selected.

Output

Hope this helps !!
Please upvote/accept if this helps.
Nikhil
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 9 | |
| 7 | |
| 6 | |
| 4 | |
| 3 | |
| 3 | |
| 3 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.