How to match values for two columns while order could be differentSay I measured defect for a wafer twice, and have X, Y axis data for each defect.
Some defects are repeat defect, they have very similar axis data (although not exact the same), so I would put "repeat" tag for them, while some defect do not have match, so I would put "new" tag for them.
How do I write a formula to automatically do this? (ie: formula to auto make column "judge base on after")
(Note that for same defect, values are not exact the same, just very close. And same defect could be in different row for before & after)
| X-Before | Y-Before | X-After | Y-After | judge base on after |
| -446659 | 888856 | -446649 | 888852 | Repeat |
| -445908 | 630775 | -445899 | 630772 | Repeat |
| -447462 | 301534 | -446122 | 588199 | new |
| -140914 | 508425 | -447456 | 301532 | Repeat |
| | | -140907 | 508433 | Repeat |
AnalyticsData TableRe: How to match values for two columns while order could be differentHere is one approach. I determines the difference between the two points, and then applies the New/Repeat logic to the difference. I believe you have an error in your data table, that shows up in the new calculation
Names Default To Here( 1 );
dt = Current Data Table();
xFudge = Abs( Min( Col Min( :"x-before"n ), Col Min( :"x-after"n ) ) );
yFudge = Abs( Min( Col Min( :"y-before"n ), Col Min( :"y-after"n ) ) );
//dt << New Column( "diff" );
dt << New Column( "Repeat_New", character );
For Each Row(
diff = Sqrt(
((xFudge + :"x-before"n) - (xFudge + :"x-after"n)) ^ 2 + ((yFudge + :"y-before"n) - (yFudge +
:"y-after"n)) ^ 2
);
If( diff < 100 | isMissing(diff)
,
:Repeat_New = "Repeat";
,
:Repeat_New = "New"
);
);
Re: How to match values for two columns while order could be differentHi txnelson,
Thank you for your reply, I tried your method. However, there is a problem.
It seems you only compare data at same the row.
The real situation is:
For before, there could be 500 defects, ie 500 rows. For after, there could be 1000 rows.
Same defect may locate at row 50# in before column, and locates in row 121 in after column, you won't know.
So it is necessary to compare all 1000 rows of after, with all 500 rows of before to match every repeat defect.
The match result may be: 490 among 500 could find a match, 10 were missing, and the other 500 are new adder