Forum Discussion

pranil2k2's avatar
pranil2k2
Contributor
5 years ago
Solved

IF else Condition in Mapper

Hi ,
I have a requirement to write multiple IF/ELSE conditions and generate an output column. but i am getting syntax error, please someone correct me

$section == “Presentation” && $action_field == “Product Short Name” ? $EMA_PRODUCTSHORTNAME:
$section == “Presentation” && $action_field == “Product INN/Common Name” ? $EMA_PRODUCTGENERICNAME:
$section == “Presentation” && $action_field == “Product Strength Name” ? $EMA_PRODUCTSTRENGTH:
$section == “Presentation” && $action_field == “Full Presentation Name” ? $EMA_PRODUCTNAME:
$section == “Presentation” && $action_field == “Product Form Name” ? $EMA_PRODUCTFORM:
$section == “Authorisation” && $action_field == “Orphan Drug” ? $ORPHANDRUG:
$section == “Authorisation” && $action_field == “Authorisation Number” ? $EMA_AUTHORISATIONNUMBER:
$section == “Presentation” && $action_field == “Product Company Name” ? $EMA_PRODUCTCOMPANYNAME: null

Thannks

6 Replies

  • dmiller's avatar
    dmiller
    Former Employee

    Is the data coming in flat or as an array?

    • bobyin's avatar
      bobyin
      New Contributor

      Hi, sorry to reply late, it’s like this(previewed results, will be more),

      New:

      Thanks.

  • aleung's avatar
    aleung
    Contributor III

    keep in mind it is compare the whole row btw New and Original. you will get 100% of the the New as modified if you don’t have identical columns.

    • pavan44's avatar
      pavan44
      New Contributor III

      Hi,
      I do have two tables and I am comparing them using Diff Snap.

      Table A (New):
      “EMP ID”: “00001”
      “EMP Name”: “Jackson, Micheal”
      “Position ID”: “00002”
      “Manager EMP ID”: “1002080”
      “Manager Position”: “00217”
      “Manager Name”: “ABC”
      “Manager Sup Org”: “XYZ”

      Table B (Original):
      “EMP ID”: “00001”
      “EMP Name”: “Jackson, Micheal”
      “Position ID”: “00002”
      “Manager EMP ID”: “1002080”
      “Manager Position”: “00217”
      “Manager Name”: “ABC”
      “Manager Sup Org”: “XYZ”

      “EMP ID”: “00001”
      “EMP Name”: “Jackson, Micheal”
      “Position ID”: “00002”
      “Manager EMP ID”: “1315186”
      “Manager Position”: “00591”
      “Manager Name”: “DEF.”
      “Manager Sup Org”: “LMN”

      Since, Both the tables has employee ID with different Managers under same position. Can we do the comparison still?. If yes, can you please explain.

      The reason is I am not seeing the second record from the Original table in the output of Diff Snap either as Modified or Insertion or deletion or unmodified. Any reason ?

      • aleung's avatar
        aleung
        Contributor III

        Were you able to figure it out?

        The diff snap expect your sort path to be unique but in your case your 2nd record in your sample have the same employee ID.