Forum Discussion

fellow_Ones's avatar
fellow_Ones
New Contributor III
7 hours ago

TransformationEventHandler - Adding new member to main and Alternate hierarchy

 
Is it possible to add members to both main and alternate hierarchies using EventHandler from source.
Was not able to achieve using existing code. Below code is being used to add new members from source to the Flow dimension which works for main hierarchy but not adding under Alternate hierarchy, any help is appreciated. The new member needs to get added under both parents below
 

 

Dim flowDimName As String = "Product_Attributes"

Dim flowMF As String = "F#TopProductAttributes.Base"

Dim flowLookup As Dictionary(Of String, MemberInfo) = Me.CreateMemberLookupUsingFilter(si, flowDimName, flowMF)

Dim ExistflowLookup As List(Of MemberInfo) = BRApi.Finance.Metadata.GetMembersUsingFilter(si, flowDimName, flowMF, True)

Dim flowAddedMembers As New Dictionary (Of String, String)

'Set the parent to add new FLOW Members under

      Dim tFlowColIndex As Integer = (objTransformer.TransformerDimensions(StageConstants.MasterDimensionNames.Flow).DataTableColumnIndex) + StageConstants.TransformationColumnIncrements.Target     

'****************Start adding new members*********************************************

      'Loop over all pages in the cache

        If objTransformer.DataCache.Pages.Count > 0 Then

        'Move to the first page

            objTransformer.DataCache.MoveFirstPage(si)

'BRAPI.ErrorLog.LogMessage(si,"Add member Yes: Line 223")

           'Process All pages in the data cache

            For intPageNo As Integer = 0 To objTransformer.DataCache.Pages.Count - 1

                'Set the current data page

               objTransformer.DataCache.ActivatePage(si, intPageNo)

              'Process each row in the data table on this page for each dimension we are checking

        For Each row As DataRow In objTransformer.DataCache.CurrentPage.PageDataTable.Rows 

' BRApi.ErrorLog.LogMessage(si, "Line 123")

        'Check the target Flow Value

        Dim targetFlow As String = row(tFlowColIndex)

    Dim flowDesc As String = "" '*** Product Attribute Description ***

Dim flowMember As String = row(tFlowColIndex)

'Determine Flow Parent member

Dim flowParent As String = "NA_RELEASE_STATUS"

'Determine Flow Parent member

Dim flowParent As String = "NA_RELEASE_STATUS"

If (Not row(tFlowColIndex) Is Nothing)  Then

If  flowMember.XFContainsIgnoreCase("NOT_RELEASED~AUTOMOTIVE") Or  flowMember.XFContainsIgnoreCase("NOTRELEASED~AUTOMOTIVE") Then

flowParent = "NOT_RELEASED"

ElseIF

flowMember.XFContainsIgnoreCase("NOT_RELEASED~AUTOMOTIVE") Or  flowMember.XFContainsIgnoreCase("NOT_RELEASED~AUTOMOTIVE") Then

flowParent = "AUTOMOTIVE"

End If

End If

 
 
 
 
 
 
 
 
 
No RepliesBe the first to reply