Hi-
I have a dataset that has many "Supplier_part_number" combinations. I want to make a new table for each subset of these combinations. I want to only make one for each "Supplier_part_number" combination so i created a "FLAG_keep" column which is just an if statement that says if "Supplier_part_number" ==Lag("Supplier_part_number" ,1) then "FLAG_keep"=1 otherwise it equals 0 . Gives me a table for i=1. Then seems to just stop. i=2 and 3 have :FLAG_keep[i] ==1 so i expect not to get anything. but then i=4 has :FLAG_keep[i] ==0 and i don't get anything.
I tried mimicking the work here https://community.jmp.com/t5/Discussions/Break-Continue-a-nested-outer-for-loop/td-p/8885 but still seem to be doing something wrong. Grateful for any help. Thanks!
dt= data table("master_dataset for regressions");
for(i=1,i<=10,i++,
if(:FLAG_keep[i] ==1, Break());
dt<<Select Where( :Supplier_part_number ==:Supplier_part_number[i]);
part_of_interest_1 = :Supplier_part_number[i];
selRows = N row( dt << Get Selected Rows );
dtsub = dt << Subset( output table name("JoinedSubset"|| char(i)));
);
w= new window("done");