Hi I am trying to use a list of Names that populate a column to select the matching rows of another column (in another Table) in order to subset the table and generate several different subsets.
Getting the Names/Values from the first column is no problem but I cannot find the correct syntax for the loop.
dt4 = Current Data Table();
uniqueVals = {"2021_file1_T1", "2021_file1_T2"};
tableList= {};
For(i=1, i< N Items(uniqueVals), i++,
dt4 << select where( As Column("Type") == [i] ) );
dt4 << Select Columns (all);
newdt[i] = dt4 << Subset( Selected columns );
Insert Into(tableList, Data Table(newdt[i]));
dt4 << Clear Column Selection();
dt4 << Clear Select();
);// end of For
I think that my basic logic is OK since this code works very well
dt4 << select where( As Column("Type") =="2021_file1_T2");
dt4 << Select Columns(all);
dt4 << Subset (Selected columns);
But I cannot figure out how to pass [i] to the "Select Where". Attached is a simplified test table.
I will appreciate any hints/ solution/suggestions.