Check if wafer from an input string is contained within a data tableI have an input string from below:
For( i = 1, i <= N Rows( dtWaferIDList ), i++,
tempi = Column( dtWaferIDList, 1 )[i];
InputString = If( i == 1, "'", "" ) || InputString || tempi || If( i < N Rows( dtWaferIDList ), "','", "'" );
);
And a table1 that I pull from a database. I would like to check to see if (in the Wafer column of table 1) all the wafers from the input string are contained in that column.
- if all wafers have data: display message = "data for all wafers available".
- if not: display message = "no data available".
Thank you!
Data TableScriptingRe: Check if wafer from an input string is contained within a data tableYou could most likely use Associative Array for this comparison Applications for Associative Arrays . Check out the part Compare Columns in Two Different Data Tables
Re: Check if wafer from an input string is contained within a data tableHello Nelson,
I appreciate the help! I am a bit new to JMP still and haven't used Associative Arrays at all yet. I have read up on it on the scripting guide and index; but am still having some confusion. Here is where I am at in my code: (directly after opening the table WaferRgDt from a database)
unique wafers = Associative Array( WaferRgDt:Wafer );
given wafers = Associative Array( dtWaferIDList:WaferList );
intersection = unique wafers; intersection << Intersect( given wafers); //intersection between arrays
//uncommmon2 represents wafers that have no data associated with it.
uncommon2 = given wafers; uncommon2 <<REMOVE></REMOVE>
When I run this I get an empty messagebox with a period... so something seems wrong still. Wondering if its a logic issue or syntax. I have had some trouble finding how to write keys in a messagebox if its even possible to do. Hope that was clear enough. Thanks again!
Re: Check if wafer from an input string is contained within a data tableTo convert a list of strings into a string you can use Concat Items()
Names Default To Here(1);
aa = Associative Array({"bun",
"shoe",
"tree",
"door"}
);
uniqKeys = aa << get keys;
Show(uniqKeys);
Show(Concat Items(uniqKeys, ", "));
Re: Check if wafer from an input string is contained within a data tableAlso used this discussion post to aid in writing the code aboveRe: Quick way to compare two lists (uncommon elements)?