Forum Discussion
As long as the UD1 member is *.*, maybe try the code below on the Data Source UD2 field (which references the UD1 column in the data file). I didn't notice a big increase in processing times with this. Just update the UD1 dimension name in the GetDimPk on line 8.
Namespace OneStream.BusinessRule.Parser.ParentMap
Public Class MainClass
Public Function Main(ByVal si As SessionInfo, ByVal globals As BRGlobals, ByVal api As ParserDimension, ByVal args As ParserArgs) As Object
Try
Dim returnstring As String = ""DefaultValue""
Dim ud1Id As Integer = BRapi.Finance.Members.GetMemberId(si, DimType.UD1.Id, args.value)
If ud1Id > 0 Then
Dim parentlist As List(Of Member) = BRapi.Finance.Members.GetParents(si, BRapi.Finance.Dim.GetDimPk(si, ""YourUD1DimName""), ud1Id, True)
If parentList IsNot Nothing AndAlso parentList.Count > 0 Then
Dim parentUD1 As Member = parentlist.First
returnstring = parentUD1.Name
End If
End If
Return returnstring
Catch ex As Exception
Throw ErrorHandler.LogWrite(si, New XFException(si, ex))
End Try
End Function
End Class
End Namespace
Related Content
- 10 months ago
- 12 months ago