Skip to main content

Comments

3 comments

  • David Paras

    If you want to update a target column with value 'Duplicate'. You can use When condition on the basis of which you can check the Duplicate records and can map a value for it.

    For updating a target column(Comments) with value = 'Duplicate' whenever a Duplicate value arrives at source side. You can use the below condition in the textual rule on the field (Comments) of the target side:

    "WHEN CONDITION{$Input_Source_Schema/Root/Record/Record1= preceding::$Input_Source_Schema/Root/Record/Record1 } VALUE=['Duplicate' ] OTHERWISE VALUE=['Unique' ]"

    0
  • David Paras

    We have implemented the same.

    We wanted to filter out non-duplicates to one stream and duplicate to another stream.

    Primary key – material id +file_ops_id

    Here is the for each condition

    Non-duplicates

    $Input_bhi_inv_dc_9999_src_schema/Root/Record[(not( preceding:: Material_ID = Material_ID ) and not(preceding:: Field_Ops_ID = Field_Ops_ID )) and (not( following:: Material_ID = Material_ID) and not( following:: Field_Ops_ID = Field_Ops_ID ))]

    Duplicates

    $Input_bhi_inv_dc_9999_src_schema/Root/Record[( preceding:: Material_ID = Material_ID ) and (preceding:: Field_Ops_ID = Field_Ops_ID ) or ( following:: Material_ID = Material_ID) and ( following:: Field_Ops_ID = Field_Ops_ID )]

    Issue

    A record which is non-duplicate is not in the target Record.

    0
  • David Paras

    We found that the ForEach condition for non-duplicates:
    "$Input_bhi_inv_dc_9999_src_schema/Root/Record[(not( preceding:: Material_ID = Material_ID ) and not(preceding:: Field_Ops_ID = Field_Ops_ID )) and not( following:: Field_Ops_ID = Field_Ops_ID ))]" checks the duplicates for both the columns(Material_ID and Field_Ops_ID) and if there are duplicates values in both columns then only it filters the value in the target side.

    So for filtering the Duplicate value based on either of the columns and for getting all the Non-Duplicates records on the target record apply the below ForEach condition for Non-duplicates:

    "$Input_bhi_inv_dc_9999_src_schema/Root/Record[(not( preceding:: Material_ID = Material_ID ) or not(preceding:: Field_Ops_ID = Field_Ops_ID )) and (not( following:: Material_ID = Material_ID) or not( following:: Field_Ops_ID = Field_Ops_ID ))]"

    0

Post is closed for comments.