sqlsql-serverhierarchical-datadimensional-modelingcognos-tm1

TM1 hierarchy to sql or csv


I need to integrate some parent-child unbalanced dimensions from TM1 to SQL server. Is there any possibility to export the relation between levels from tm1 dimension in a csv file ?


Solution

  • It depends on a couple of things:

    Looking at the simplest scenario, which would be where:

    you would be able to do this in TI by defining the data source as the All subset for the dimension that you want to export. Change the contents of the resulting Variable from Ignore to Other.

    On the Data tab, use the rules ELPAR function to obtain the current element's immediate parent and store that in a variable. Now you have the element name from the data source, and its parent. It's therefore possible to output the pair to a text file showing an element,parent relationship.

    If you have multiple hierarchies things may get a touch more complex in that you would probably need to step through each hierarchy separately, and that would mean recursive calls to TIs. Similarly you would probably need to go down a recursive call path if you don't want just the parent/child relationship, but rather the whole ancestry of each element.

    If you had a different outcome in mind you'd need to modify your question to be be more specific. Indeed you'll find that "how do I" type questions aren't generally well received on StackOverflow (especially when there's no indication of what you've tried), and this one probably would have attracted some downvotes and/or been put on hold had it not been for the fact that hardly anyone looks at TM1 questions here. (As you can see from the small number of views that most TM1 questions get.) If I haven't answered your question, I do recommend expanding it to something more detailed, and at least having a crack at it using the suggestions above as a starting point. If you still can't get to where you need to go, posting the code that you come up with will help someone to help you with it.