2025 Mar 25 6:38 PM - edited 2025 Mar 25 6:45 PM
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.
The setParameterValue method of DataAction accepts string or array of string as parameter value. So if you want to pass multiple values you can just pass the array of strings rather multiple single values.
setParameterValue(id: string, value: string | string[] | DataActionParameterValue JSON | number): void
Just create an array where the members are stored with Hierarchy information. Or try changing the Region parameter of this DA to Hierrachy "any" and see if it works.
Hope 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 |
---|---|
84 | |
12 | |
9 | |
8 | |
8 | |
5 | |
4 | |
4 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.