Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Identify matching values in script based on certain criteria

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!

1 Solution

Accepted Solutions
tamilarasu
Champion
Champion

Hello,

Have a look at the attached file. Is this your requirement?

Capture.PNG

View solution in original post

11 Replies
Anil_Babu_Samineni

Would you provide Sample data set?

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
tamilarasu
Champion
Champion

Hello,

Have a look at the attached file. Is this your requirement?

Capture.PNG

Anonymous
Not applicable
Author

sure. Here you go

Anonymous
Not applicable
Author

perfect. Thank you Tamil!

tamilarasu
Champion
Champion

You are welcome First Name .

Anonymous
Not applicable
Author

did a mistake upon my registration - cannot change my personal info anymore.

have a good day!

felipe

prieper
Master II
Master II

would would be the sorting-order?

If already in the above order, do you need to validate with "S" and "H" or would it be enough to check whether the previous value = current value * (-1)?

Peter

Anonymous
Not applicable
Author

hi Tamil, could you please let me know why you are dropping Tempidentity field?

Anonymous
Not applicable
Author

Hi Peter,

unfortunately not. My data set contains about 100 million entries and I have found examples where there are entries which may not be related to each other based on this assumption. I therefore needed this scripting logic. I knew it was something about "peek" but did not know how to apply it to this example.

regards,

felipe