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

Dynamic Data copy script is not working

praveen_kumar334
Participant
0 Likes
1,399

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.

View Entire Topic
N1kh1l
Active Contributor

praveen.kumar334

You can try setting up the Standard Copy step to achieve the same. If you want to filter few measures to be copied you can add them to the filter as shown below

Define the From Period, To Period and Target version as prompts as below example for from period

When you run the Data Action, you will be prompted to selected the Target version, From period and To Period.

Hope this helps. Please upvote/accept if this helps.

Nikhil

praveen_kumar334
Participant
0 Likes

Hi Nikhil,

Thanks for the info. But I want to achieve this through script. PFB screenshot of psuedo code, but it looks like it is missing something.

I am able to achieve the same functionality by hardcoding the year as shown below:

DATA([d/date] = "202201") = DATA([d/date] = "202112")

But I don't want to hardcode the year.

N1kh1l
Active Contributor
0 Likes
praveen.kumar334

Using Script to copy is easier if you want to copy last year actuals to current year plan/budget etc. With Script the challenge will be to get the destination time member dynamically. This is only feasible if we know the lookback/look forward period before hand. So the user parameter have to be change and instead of asking the ToYear, you have to use the look forward period . For e.g 3, This will copy Actual from From Year to Plan of From Year +3. Both DATA() and RESULTLOOKUP only support leaf members in syntax which will make it difficult for dynamic handling. Any reason you don't want to use the standard copy step as its designed to precisely handle these scenarios

Nikhil

praveen_kumar334
Participant
0 Likes

Thanks for the info Nikhil. So you mean to say that we can use the parameter for source(base level) and use the lookback/look forward for the target year ? In that is the case, I am unable to get the parameter even for the target also. PFB screenshot where the parameter tab is in disabled mode.

Please let me know if i am missing anything.

Thanks.

N1kh1l
Active Contributor
0 Likes

praveen.kumar334

As I said earlier. Both DATA() and RESULTLOOKUP() can only take single leaf members for dimensions as parameters. So your parameters have to be of type leaf and cardinality one. Once you do that you can use them in your script.

Nikhil