Assigning the EntityDefault when value is not in the constraint during a transformation process

OliBolli
New Contributor

Hi,

Data quality is unfortunately not there in all fields. I would like to be able to remap an existing code to the defined EntityDefault member when the code is not included in the constraints. Without having to define each exception on by one - (this I can do).

For instance, an entity must have only American customers (my constraint), unfortunately, in the source file I have records with customers from other part of the world. When this is the case, I just want to get them replaced by the EntityDefault member (that I know is part of my constraint).

Any clever idea before jumping into writing a BR?

PS. I hate writing code in tools that are meant to be no or low code.

1 ACCEPTED SOLUTION

I have just come across a Conditional Rule I wrote a few years back. It queries the Constraint member for the Flow on the Account dimension. It's not exactly what you want but it might get you started. These are the key lines:

 

Dim AccountMbr As Member = BRApi.Finance.Members.GetMember(si, dimTypeId.Account, Account)
Dim ConstraintFlowMbr As Member = BRApi.Finance.Account.GetConstraintMemberForDimType(si, AccountMbr.MemberId, dimTypeid.Flow, Cubetype.Standard.Id)
ACQFlow = BRApi.Finance.Flow.Text(si, ConstraintFlowMbr.MemberId, 1, BRApi.Workflow.General.GetScenarioTypeId(si, si.WorkflowClusterPk), si.WorkflowClusterPk.TimeKey)

 

View solution in original post

4 REPLIES 4

MarcusH
Contributor III

The simple answer (which is also time-consuming) is have separate transformation rules for each entity. Only create maps for customers valid for the entity and then have a catch all mask that maps to the entity default. It's a manual process rather than automatic and assumes that the transformation rules are managed centrally.

If you want automatic, then a TransformationEventHandler BR can be used to examine and update the Transformation Rules before they are applied.

I have just come across a Conditional Rule I wrote a few years back. It queries the Constraint member for the Flow on the Account dimension. It's not exactly what you want but it might get you started. These are the key lines:

 

Dim AccountMbr As Member = BRApi.Finance.Members.GetMember(si, dimTypeId.Account, Account)
Dim ConstraintFlowMbr As Member = BRApi.Finance.Account.GetConstraintMemberForDimType(si, AccountMbr.MemberId, dimTypeid.Flow, Cubetype.Standard.Id)
ACQFlow = BRApi.Finance.Flow.Text(si, ConstraintFlowMbr.MemberId, 1, BRApi.Workflow.General.GetScenarioTypeId(si, si.WorkflowClusterPk), si.WorkflowClusterPk.TimeKey)

 

Hi, thank you for both hints, I will leverage on the second option first, i.e., to create a conditional rule that validates the members against the Constraint.

I would make the Conditional Rule generic ie pick up the country code for the workflow somehow. If the maps are maintained by the users, I would add the Conditional rule to its own Group (Mask type source value *) and then add this Group to each of the profiles as the first Entity Transformation Group. Set security so that users do not have permission to change it. That would give you a single map to maintain that the users can't change or interfere with.