Business Rule | One-to-One Transformation - E# Parent to its first E# Base
We need your help to Import flat files:
1. > 100k Rows by 1,000s of E# Parent Members
3. E# is extended
We've been fortunate to be advised to build a BR to generate a one-to-one Transformation Rule file.
- E# Parent to its first E# Base
Is it possible for you to be generous enough to share with us/Community:
- a sample BR to look up its first E# Base Member of an E# Parent Member
- how to call that BR in an Import Workflow
Thank you, OS SMEs.
I believe something like this should work within a complex expression on a transformation rule (did not test). The dimension name logic may need some tinkering and I am not sure about the order of the base members being returned. If that's an issue you could tag the base member you want within a Text field and then include a where clause in the member filter so it will only return the member you want data loaded to. If no base members are returned it defaults to the source value. You might also need error handling if the source value isn't a valid member.
Dim DimensionToken As String = "E#" Dim ParentMem As String = args.GetSource(DimensionToken) If String.IsNullOrEmpty(ParentMem) Then Return Nothing ' Hardcode or replace with your logic to determine the dimension name Dim DimensionName As String = "Entity" ' <<< set appropriately ' Get base members under the parent (metadata order) Dim BaseMems As List(Of MemberInfo) = BRApi.Finance.Metadata.GetMembersUsingFilter( _ si, DimensionName, DimensionToken & ParentMem & ".base", True) If BaseMems IsNot Nothing AndAlso BaseMems.Count > 0 Then For Each mi As MemberInfo In BaseMems If mi IsNot Nothing AndAlso mi.Member IsNot Nothing Then ' Return the first base member name Return mi.Member.Name End If Next End If ' If no base descendants, return the parent itself Return ParentMem