on 2023 Aug 22 5:41 PM
Hello!
I want to create a new member of a dimension with a parent-child hierarchy established. This new member should be on the top of the hierarchy, so have no parents (<root> as a parent ID).
I tried this code in the Analytics Designer script but got an error during the runtime. I guess "<root>" isn't the correct string for this code
var parent = "<root>";
PlanningModel.createMembers("Dimension", {id: Id, description: desc,
hierarchies:{H1: {parentId: parent,}
})
Please advise, how should I refer to the parent node
Thanks,
Yuri
Request clarification before answering.
ypinchuk
var parent =''; //should do the trick in your code. I generally follow the below approach to create the members
Create a Script variable of type Planning model member. I have created MemberId

MemberId = ({id: "testid", description: "Test", hierarchies: {Audit_Trail_Hierarchy: {parentId: ''}}, properties: {Row_Source: "SAC"}});
var result = PlanningModel_1.createMembers('AUDIT_TRAIL',MemberId);
if(result)
{
Application.showMessage(ApplicationMessageType.Success,"Member Successfully Created");
}
else
{
Application.showMessage(ApplicationMessageType.Error,'Failed to create Member');
}On execution it created the below member at root level

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 |
|---|---|
| 7 | |
| 5 | |
| 5 | |
| 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.