Presentation is loading. Please wait.

Presentation is loading. Please wait.

Using Key function in Mapper

Similar presentations


Presentation on theme: "Using Key function in Mapper"— Presentation transcript:

1 Using Key function in Mapper
Key function helps map Header and multiple Detail records into any output format. Need for this function arises when we want to consolidate or aggregate all related Source records as one set based on a common key.

2 Mapping – Step 1: Create Local Variable on Target Record node
4 Source Header data schema In the output file, for each header record there will be multiple Employee Detail records based on a common key that joins the two Source data files. Source Detail data schema 2 3 Prerequisite: Create source header and details data schemas. Also create the target data schema using the Schema service. Click on Target schema root node EMPDATA and select Local Variables and create a variable called varEmpID, hit return and now double click on the source field EmpID of the header schema. The complete field with its xpath will appear in the value box. SAVE variable by clicking on orange save icon located above variable name field. This step is creating a local variable which we will use in the subsequent steps.

3 Mapping – Step 2: Create a For-Each at the Target Record node
1 3 2 Place your cursor in the For Each box and then double click on the Source Header record node 4 Select Target Record Node, go to Properties panel and place your cursor in the For Each box. Now go to Source Header Record node and double-click on it. This will put the xpath of the source header record node in the for-each box. Click on Save Properties button. In this step we are telling the application to read each header record from the Header data file.

4 Mapping – Step 3: Create a Key Function
2 6 1 3 4 5 - Give any Key name (no spaces or special characters) - Key match “/Root/Record” is the path of the Details schema Record node Key Use is the common key of the Details schema which will be matched with the header record This step is creating a relationship between source Header and Detail files using a common key EmpID.

5 Mapping – Step 4: Create a For Each at Target Details Root node
1 3 2 4 Select Details Root node of the Target and then go to Properties and in the For Each box, double click on the Root node of the source EmpDetails node. This steps is telling the application that it needs to read this file.

6 Mapping – Step 5: Create a Local Variable at Target Details Root node
1 2 3 4 Enter the following in the Variable Value box: key('keyEmpID' , $varEmpID) Save the variable. This variable joins the empID of the Header and the empID of the Details.

7 Mapping – Step 6: Create a For Each at Target Details Record node
1 2 3 4 This For-each will look for each record in the source Details file that has a common empID value.

8 Mapping – Step 7: Map Source Details fields with Target Details fields
Use Textual Rules tab and then for each of the Target element type in the related source Details field name. Thus BenefitType target element is mapped to BenefitType For empid it is EmpID For electioncode it is BElectionCode For type it is Type For payor it is Payor SAVE mapping and test results.


Download ppt "Using Key function in Mapper"

Similar presentations


Ads by Google