How do I concatenate subsets of tables? Seems simple but I'm stuck
Nov 5, 2018 9:11 AM
| Last Modified: Nov 5, 2018 10:28 AM(1847 views)
I need to do four things for all files in a directory:
Open a data table
Add a column
Take a subset of that data table
Concatenate that subset onto a different table
Seems so simple, but I get stuck on step 4. I can concatenate the original data table into the different table, but not the subset. How do I get jmp to work with this subset?
Each file is large enough that I need to take the subset before the concatenation operation. Concatenating all the whole original files leads to jmp crashing. I need to do this every week, so I am hoping for a script to do this.
Here's what I have.
FileNames=Files in Directory (Directory);
For (iFile=1, iFile<=N Items (FileNames), iFile++,
One Day Table=Open(File_Path);
New Column("Count Number",Character,Nominal,Formula(Right(:WaferId,2)));
One Day Table << Select Where((Count Number=="01" | Count Number=="08" | Count Number=="15" | Count Number=="22")& Is Missing(Name("SWR::WaferData::SWRNoLEHI1")));
One Day Table Part=One Day Table << Subset (Selected Rows);
FinalTable = Summary << Concatenate(One Day Table Part,OutputTable("Table C"));
close(One Day Table,No Save);
I'm not sure exactly what you're saying your problem is but I do notice that you're concatenating to the "Summary" table and creating a new data each time. If you're trying to accumulate the parts into a single data table you'll need to concatenate to that table each time. You can do that with the Append to First Table(1) option on the Concatenate message.
Summary = New Table( "Summary" );
One Day Table = Open( "$SAMPLE_DATA\Big Class.jmp" );
One Day Table << Select Where( (:Sex == "M") );
One Day Table Part = One Day Table << Subset( Selected Rows );
Summary << Concatenate( One Day Table Part, append to first table(1));
Another Day Table = Open("$SAMPLE_DATA\Fitness.jmp");
Another Day Table << Select Where( (:Sex == "M") );
Another Day Table Part = Another Day Table << Subset( Selected Rows );
Summary << Concatenate( Another Day Table Part, append to first table(1));