简体   繁体   English

TM1层次结构到sql或csv

[英]TM1 hierarchy to sql or csv

I need to integrate some parent-child unbalanced dimensions from TM1 to SQL server. 我需要集成一些从TM1到SQL Server的父子不平衡维度。 Is there any possibility to export the relation between levels from tm1 dimension in a csv file ? 是否有可能从csv文件的tm1维度导出级别之间的关系?

It depends on a couple of things: 这取决于两点:

  • Whether your dimension has multiple hierarchies; 您的维度是否具有多个层次结构; and
  • What format you envisage the "relation between levels" to be. 您设想“级别之间的关系”是什么格式。

Looking at the simplest scenario, which would be where: 查看最简单的场景,该场景在哪里:

  • There is only a single hierarchy; 只有一个层次结构。 and
  • You want to show the output as two columns consisting of Child in one column and Immediate_Parent in the second one (or the other way around), 您希望将输出显示为两列,其中一列为Child,第二列为Instant_Parent(或者相反),

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. 您可以通过将数据源定义为要导出的维度的“全部”子集来在TI中执行此操作。 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. 在“数据”选项卡上,使用规则ELPAR函数获取当前元素的直接父级并将其存储在变量中。 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. 如果您具有多个层次结构,那么事情可能会变得更加复杂,因为您可能需要分别浏览每个层次结构,这意味着递归调用TI。 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. 确实,您会发现在StackOverflow上通常不会很好地接受“我该怎么办”类型的问题(特别是在没有迹象表明您尝试过的问题时),并且这个问题可能会引起一些反对意见和/或被提出来。并不是因为几乎没有人在这里看到TM1问题。 (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. (从少数视图中可以看到,大多数TM1问题都得到解决。)如果我还没有回答您的问题,我建议您将其扩展为更详细的内容,并至少使用上面的建议来加以解决。一个起点。 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. 如果仍然无法到达所需的位置,则发布您想出的代码将有助于某人帮助您。

From my research I found that there is a library in TM1 for a process called Bedrock... This Bedrock TM1 TI will export the members of a subset to a file with some relationship beteween level. 从我的研究中,我发现TM1中有一个名为Bedrock的进程的库... Bedrock TM1 TI将把子集的成员导出到文件之间,并且它们之间存在某种关系。 There is a logic behind that file and with some transformation in SQL you can have the hierarchical way... The link to the process is attached below. 该文件背后有逻辑,并且可以通过SQL进行一些转换,从而采用分层的方式。

BedrockDimSubExportToFile BedrockDimSubExportToFile

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM