a month ago - last edited a month ago
Hi,
Here is the scenario. There are three different model as Model A, Model B and Model C. Model A has dimension called Region and it has no hierarchy. Model B also has the same dimension as Region but has a parent child hierarchy. Model C has a dimension as Region and it has no hierarchy. Region dimension is private dimension across three different model.
My requirement is to read the values from Model A. Based on these values, I have to copy the data from Model B to Model C. Values that I read from Model A are always the leaf members of the hierarchy in Model B.
I have written the script logic to read the values from Model 'A' and even pass these values as parameters in the cross model copy data action to copy from Model 'B' to Model 'C' but I'm getting validation error message when I'm executing the script. Below is script logic I'm using in my story.
var A = Atable.getDataSource.getMembers("Region",100);
var key = Array.Utils.create(Type.String);
for (var i = 0 ; i <A.length ; i++)
{
key.push(A[i].id);
}
DataAction.setParameterValue("Region",key); //This line doesn't give me any error but I can see the validation issue on the data action job monitor. SAC is not exactly specifying the reason behind this validation error.
DataAction.setParameterValue("Region",["[Region].[H1].&["+ key[1]+"]" , "[Region].[H1].&["+ key[2]+"]" ]); // When I'm executing this script, it is working fine as I'm able to pass single/ multiple values using this syntax.
The highlighted script above is hard coded and it runs without any validation errors. Is there a way that I can pass multiple values for this parameter which has a hierarchy defined. Anyone who has faced this similar issue or knows the workaround in this case. Their comments would be deeply appreciated.
Thanks
Request clarification before answering.
Hi,
In your case validation error is due to the reason that you push to DA Region ID without hierarchy.
Rewrite your script:
for (var i = 0 ; i <A.length ; i++)
{
key.push("[Region].[H1].&[" + A[i].id + "]");
}
Your array will contain members with hierarchy.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
89 | |
11 | |
9 | |
8 | |
7 | |
5 | |
4 | |
4 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.