vbscript HFM元数据的帐户层次结构

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了vbscript HFM元数据的帐户层次结构相关的知识,希望对你有一定的参考价值。

Sub BuildHierarchyAccount()
    ' Usage: at column 100 and following there are the values to use
    ' ParentCode, Code, IsBaseAccount, Name, ParentType, Type, InScope
    ' when ParentType and Type are different then the sign must be minus (-)
    ' when InScope is empty that account is not meaningful for that branch (AG, CE, CV, etc)
    Dim RowId As Long
    Dim ColId As Long
    Dim ColLevel As Long
    Dim ColIsBase As Long
    Dim ColOffset As Long
    Dim ColOffsetName As Long
    Dim ColOffsetInScope As Long
    Dim ColOffsetType As Long
    Dim ParentCode(64) As String
    Dim ParentType(64) As String
    ColOffsetName = 81
    ' Column A contains the account level in hierarchy
    ColLevel = 1
    ' Column B identifies if the account is base  / leaf in hierarchy
    ColIsBase = 2
    ' Column D is the first containing account codes
    ColOffset = 4
    ' Column AB (28) means the account is in scope for Layer2-AG if contains X
    ' Column AF (32) means the account is in scope for Layer2-CE if contains X
    ' !!! NOTE !!! as of 24.05.2019 AG and CE are identical
    ColOffsetInScope = 32
    ' Column AU contains the type of account: expense or revenue
    ColOffsetType = 42
    ' ColId = ActiveCell.Column
    ' For RowId = ActiveCell.Row To Rows.Count
    ' For RowId = 1490 To 2238 gerarchia con STA1000
    ' For RowId = 8 To 762 gerarchia con UIA025
    For RowId = 1490 To 2238
        ColId = ColOffset + Cells(RowId, ColLevel).Value
        ' Cells(RowId, ColId).Select
        ParentCode(ColId) = Cells(RowId, ColId).Value
        ParentType(ColId) = Cells(RowId, ColOffsetType).Value
        Cells(RowId, 100).Value = RowId
        Cells(RowId, 101).Value = ParentCode(ColId - 1)
        Cells(RowId, 102).Value = Cells(RowId, ColId)
        Cells(RowId, 103).Value = Cells(RowId, ColOffsetName)
        Cells(RowId, 104).Value = ParentType(ColId - 1)
        Cells(RowId, 105).Value = Cells(RowId, ColOffsetType)
        Cells(RowId, 106).Value = Cells(RowId, ColOffsetInScope)
        ' Cells(RowId, nnn).Value = Cells(RowId, ColIsBase) in new file version with financial this info is no more good
        'If Not IsEmpty(Cells(RowId, ColId).Value) Then
        '    Cells(RowId, ColId).Font.Color = vbGreen
        'End If
    Next RowId
End Sub

以上是关于vbscript HFM元数据的帐户层次结构的主要内容,如果未能解决你的问题,请参考以下文章

vbscript HFM元数据的市场层次结构

vbscript 来自HFM元数据的实体NO层次结构

MDX 计算成员不允许多个层次结构元组

vbscript 以安全的方式从页面获取属性或元数据(因此,如果元数据不存在,则不会丢失)。在这个例子中,我们是替换

需要VBScript列出已禁用的帐户

Swift ios 重置视图控制器层次结构