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
item | return_qty | value | failure |
---|---|---|---|
stool | 1 | 45.00 | Product |
book | 5 | 32.99 | Cust issue |
laptop | 1 | 439.99 | Product |
dinner | 1 | 12.99 | Cust issue |
clock | 3 | 24.00 | Broken 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
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).
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 =
item | return_qty | value | failure |
---|---|---|---|
stool | 1 | 45.00 | Product |
book | 5 | 32.99 | Cust issue |
laptop | 1 | 439.99 | Product |
dinner | 1 | 12.99 | Cust issue |
clock | 3 | 24.00 | Broken 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
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.
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).