cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
JMP is taking Discovery online, April 16 and 18. Register today and join us for interactive sessions featuring popular presentation topics, networking, and discussions with the experts.
Choose Language Hide Translation Bar
loysius
Level II

Make new data table including only certain :column values

This is probably super easy but I'm stumped. I could just query the database again and filter out what I need and build my data table with that but I'd rather save bandwidth and query my table or filter it somehow.

Basically I have a table like so

itemreturn_qtyvaluefailure

stool

145.00Product
book532.99Cust issue
laptop1439.99Product
dinner112.99Cust issue
clock324.00Broken by shipping

I want to create a new table that only includes items with :failure = "Product"

I've tried using the data filter to highlight :failure = "Product" and then using subset to make a new table with the highlighted. I didn't get it to work but I don't think it will be very scale-able in case I need to add more to this later on. If anyone has a solution or idea I'd very much appreciate any sort of help.

Happy 4th of July to everyone and thank you for your time!

Sincerely,
Loysius

1 ACCEPTED SOLUTION

Accepted Solutions
gail_massari
Community Manager Community Manager

Re: Make new data table including only certain :column values

Here is an easy way to do this graphically after you have the full table.  Run Distribution on the Failure Column.  Then highlight, in the graph, the Product bar. Right click and create subset to get a subset that is linked to the original table.  You can save the subset (with a new name is best).9204_Subset_from_Distribution_highlighted_Product_Failure_.JPG

9205_Subset_You_Can_Save.JPG

View solution in original post

3 REPLIES 3
loysius
Level II

Re: Make new data table including only certain :column values

Right now I found a solution but if anyone knows a better way I would be the happiest person ever!

This is what I've found to work.

I have original table,

dt_RMAs =

itemreturn_qtyvaluefailure

stool

145.00Product
book532.99Cust issue
laptop1439.99Product
dinner112.99Cust issue
clock324.00Broken by shipping

I make a temp data table like so,

dt_Temp =

Product
failure

Now I run this after those two tables are assigned to their variables,

dt_SubsetOfRMAsBy_ProductFailure = dt_RMAs << Join(

     With( dt_Temp ),

     By Matching Columns( :failure = :failure ),

     Drop multiples( 0,0 ),

     Name( "Include non-matches" ) ( 0,0 ),

     Preserve main table order( 1 ),

     Output Table( "RMAs because of PRODUCT FAILURE" )

     );

Now I have an immediate issue with the name of the failure column.

Does anyone know a better way?

Thanks everyone,

Sincerely,

Loysius

chungwei
Staff (Retired)

Re: Make new data table including only certain :column values

You probably do not want the column "failure" from the second table.

To do that, add the statement

  Select(all)

to your script.

Then only all the columns from the main table will be added to the output table, and nothing from the second table.

gail_massari
Community Manager Community Manager

Re: Make new data table including only certain :column values

Here is an easy way to do this graphically after you have the full table.  Run Distribution on the Failure Column.  Then highlight, in the graph, the Product bar. Right click and create subset to get a subset that is linked to the original table.  You can save the subset (with a new name is best).9204_Subset_from_Distribution_highlighted_Product_Failure_.JPG

9205_Subset_You_Can_Save.JPG