Thanks. I missed pasting the code , here is the snippet for reference ; reading the input list values via a window and then following :
// Directory path
pathDir = "J:\jmp-data\raw_data";
fileList = Files In Directory(pathDir);
Show(fileList);
selectedValues = {};
For(i = 1, i <= N Items(fileList), i++,
For(j = 1, j <= N Items(targetSource), j++,
If(Contains(fileList[i], targetSource[j]),
Insert Into(selectedValues, targetSource[j]);
Break();
);
);
);
countValues = N Items(selectedValues);
Show(selectedValues);
FilterByValueList = Function({sourceTbl, valueList, outName},
tempTbl = sourceTbl << Duplicate Window();
tempTbl << Clear Row States;
For(i = 1, i <= N Items(valueList), i++,
val = valueList[i];
tempTbl << Row Selection(
Select Where(:Batch Number == val, Current Selection("Extend"))
);
);
resultTbl = tempTbl << Subset(
Selected Rows(1),
Output Table Name(outName),
Invisible
);
Return(resultTbl);
);
// Example usage:
RunDataSubset = FilterByValueList(DataRuns, SelectedValues, "RunDataSubset");
MetaSubset = FilterByValueList(MetaRuns, SelectedValues, "MetaSubset");
I also found the window that is being created to take user input, has global variables and that could be the reason for old data to show up:
SelectedValuestext = Select_Values_test0 <<get text;
SelectedValuesText0 = {};
i=1;
SelectedValuesText0 = {}; - still has nothing so whenever I run the code again it should take new user input values if they are diff.