Page 1 of 1

Problem creating dimension hierarchy with TM1 REST Api

Posted: Fri Oct 09, 2015 8:29 am
by Alexander Jell
Hi,

I'm trying to import data from a MSSQL database into our TM1 database using a C# console application. The whole project already works pretty fine.
The struggle: Insert an element under a consolidation. The elements are under the root and under the consolidation resulting in strange behavior within rules and feeders. Can anyone help me solving this problem? I use the following code to insert the elements into the dimension:

Code: Select all


[POST] /api/v1/Dimensions('Version_TS')/Hierarchies('Version_TS')/Elements('Szenarien')/tm1.SetComponent

Post Body:
{
   "Element":{
        "Name":"testelement",
        "UniqueName":"[Szenarien].[testelement]"
    }
}

Result:
Dimension.PNG
Dimension.PNG (8.12 KiB) Viewed 3532 times
(The other elements within the dimension are added the same way)

Does anyone have an idea what im doing wrong? (Or idea how i can remove the root -> Element relation)

I'm thankful for every tipp or suggestion

Re: Problem creating dimension hierarchy with TM1 REST Api

Posted: Fri Oct 09, 2015 8:43 am
by David Usherwood
It's probably fine. Open the dimension in the subset editor and click Hierarchy Sort (on the right of the Z-A button). The default layout is often a bit random when loading from external data.
Much as I applaud more use of the REST API, you'd probably get the result quicker using SQL and ODBC.

Re: Problem creating dimension hierarchy with TM1 REST Api

Posted: Fri Oct 09, 2015 12:46 pm
by tomok
What issue with rules and feeders? All I see is a screen shot with what I assume is the default subset view. What are your settings in the SORTCOMPONENTSTYPE and SORTELEMENTSSENSE in the }DimensionProperties cube? When you add elements to a dimension programatically these settings control how the dimension is ordered. If these are blank the order is going to be quite random. The important thing is that the children are under the correct parents, which is true in your case. So, what exactly is the problem.

Re: Problem creating dimension hierarchy with TM1 REST Api

Posted: Mon Oct 12, 2015 10:20 am
by Alexander Jell
Thanks for the answer. The settings in SORTCOMPONENTSTYPE and SORTCOMPONENTSTYPE solved it!