I cannot be 100% sure how you want to do the matching, but I can guess that you will match with match in Defects (last word) based on Bin values. There are many ways to solve this, here are two possible ideas:
Here is one a bit more interactive solution:
- Create new column to Table1 with only the last word of Defects column
- Join Table1 with priority_table using the new column from Table1 and Bin from priority_table
- Use Col Min formula to get highest priority for Part No (change Priority to numeric first)
- From here you could join priority table again with the new formula column and priority from priority_table to get the final bin (except for missing ones)
- Create final formula to calculate the missing value
You should get all scripts required for these steps from JMP (table scripts (and enhanced log if using JMP16))
Or if you are familiar with SQL, you could try using it directly. Below is some sort of query:
Names Default To Here(1);
dt_table1 = Open("Table1.jmp", Invisible);
dt_priority = Open("priority_table.jmp", Invisible);
dt_result = Query(
Table(dt_table1, "t1"),
Table(dt_priority, "p"),
"\[
with min_prio as (SELECT t1."Part No", min(p.priority) as priority
FROM t1
LEFT OUTER JOIN p
ON SUBSTR(t1.Defects, LOCATE(" ", t1.defects) + 1) = p.Bin
group by t1."Part No"
)
select t1."Part No", t1.Yield, t1.Defects, mp.priority,
case when p.Bin is NULL and t1.yield < 60 then "less than 60%" else p.Bin end as Bin
FROM t1
LEFT OUTER JOIN min_prio mp on mp."Part No" = t1."Part No"
left outer join p on mp.priority = p.priority
]\"
);
dt_result << Set Name("SQL_RESULT");
-Jarmo