Subscribe Bookmark RSS Feed

How to remove 2 columns from a datatable, without changing it?

jan_solo

Community Trekker

Joined:

Feb 21, 2014

Hey everyone,

I have a datatable as input table.  I need to remove 2 columns if I want my script to work correctly.  The problem here is that I cannot change the input table.  So I need to do this some other way.  As far as I can see, this can be done 2 ways:

1.  Use a view.

I don't know if this exists in JMP (I haven't found it).  But if I could get a view from the datatable without those columns, I probably can get it to work.  I expect JMP must have something similar, since most programming and scripting languages support this and JMP works with datatables all the time.

2.  Copy the table to a new table, remove the columns.

If there is no such thing as a view, I could copy the table and remove the columns from the copied table.  Is there a fast way to do this?

Maybe I overlooked a solution.  So feel free to add your solution here as well...

Thank you,

Jan

1 ACCEPTED SOLUTION

Accepted Solutions
Solution

Here's how to create a subset minus two columns, using Big Class as an example.


dt = open("$sample_data\Big Class.jmp");

dt2 = dt << Subset( All rows, columns( :name, :age, :sex ) );

Seems like you could modify your script to deal with all columns except the two in question.  Post some more info, even your script and we'll help you figure it out.

2 REPLIES
Solution

Here's how to create a subset minus two columns, using Big Class as an example.


dt = open("$sample_data\Big Class.jmp");

dt2 = dt << Subset( All rows, columns( :name, :age, :sex ) );

Seems like you could modify your script to deal with all columns except the two in question.  Post some more info, even your script and we'll help you figure it out.

jan_solo

Community Trekker

Joined:

Feb 21, 2014

short version:

Basically, pulling limits (UCL, LCL, KSigma) from a table for a control chart ONLY works when the results table and the limits table have the same columns (except the first one) in the exact same order.  If one of the tables has an extra column, the limits are pulled from the limits-table until the column-order doesn't match anymore.  From that point on, the limits table is checked to see if there is a matching column (otherwise there is a message written in the log), but even if there is one matching (no message in the log), the limits are still calculated by JMP instead of taking them from the limits table.

I have 2 such columns in my result table (for which I don't need to create a control chart).  So to get around this bug (I presume?), I need to get rid of the interfering columns.