11 Replies Latest reply: May 8, 2017 6:12 AM by Tamil Nagaraj RSS

    Identify matching values in script based on certain criteria

    First Name Last Name

      Hi everybody,

       

      I am currently trying to find out a way to identify matching entries based on certain criteria. This operation needs to be performed in the script.

       

      Please see the example below:

       

         

      BELNRAUGBLSHKZGDMBTRDMBTR.absoluteBLDATBUDATZFBDTAUGDTidentify
      00020283250061226790S-981.532981.53218.05.201518.05.201518.05.201519.05.2015
      00020413100061710887S-684.226684.22616.07.201516.07.201516.07.201520.07.2015
      00020225920060969774S-676.725676.72516.04.201516.04.201516.04.201520.04.2015
      00020481500061971806S-509.940509.94017.08.201517.08.201517.08.201524.08.2015
      00020546860062167773S-509.873509.87316.09.201516.09.201516.09.201517.09.2015
      00090010100062542784S-499.600499.60017.09.201517.09.201517.09.201530.10.2015x
      00090010102002628310H499.600499.60017.09.201517.09.201517.09.201517.09.2015x
      00020100160060441499S-487.373487.37316.02.201516.02.201516.02.201523.02.2015
      00020214620061322831S-450.264450.26413.04.201513.04.201513.04.201501.06.2015
      00130024680062972555S-386.349386.34922.12.201523.12.201522.12.201523.12.2015
      00020609870062671631S-382.279382.27916.10.201516.10.201516.10.201517.11.2015
      00020708650060118587S-375.106375.10601.12.201501.12.201501.12.201514.01.2016
      00020203020061322908S-357.500357.50007.04.201507.04.201507.04.201501.06.2015
      00020673790062749049S-356.369356.36916.11.201516.11.201516.11.201526.11.2015
      00020159930060692060S-353.232353.23216.03.201516.03.201516.03.201519.03.2015
      00090002562002448049H273.182273.18201.02.201501.02.201501.02.201502.02.2015x
      00130023970060056626S-273.182273.18202.01.201405.01.201502.01.201408.01.2015x
      000900006660056626H272.564272.56401.01.201501.01.201501.01.201508.01.2015

       

      The yellow highlighted entries are the matching entries I want to identify. The match is based on the fields DMBTR.absolute and SHKZ. The rule is: Find entries that have identical DMBTR.absolute and the previous entry needs to be a "S" if I am a "H" vs. the previous entry needs to be a "H" if I am a "S". Both entries should be market in a newly created field (identify) with an "x".

       

      Thanks a lot for your help!