Not sure at which point you are having issues, but first get list of unique values from your column.
Use associative array (doesn't work with floats) and can be slow if you have lots of data (also re-orders your data)
Names Default To Here(1);
dt = open("$SAMPLE_DATA/Big Class.jmp");
uniq_age = Associative Array(Column(dt, "age")) << get keys;
Use summarize, will change numbers to strings which is good thing in this case
Names Default To Here(1);
dt = open("$SAMPLE_DATA/Big Class.jmp");
Summarize(dt, uniq_age = By(:age));
Or use Summary platform and data table subscripting / get values.
Then turn that list into a string using concat items and build your query string. You might have to evaluate the value but I'm not sure if this is necessary
Names Default To Here(1);
dt = open("$SAMPLE_DATA/Big Class.jmp");
Summarize(dt, uniq_age = By(:age));
uniq_age_in = Concat Items(uniq_age, ", ");
//uniq_age_in = "'" || Concat Items(uniq_age, "', '") || "'"; // note that if you have string, you need to add quotes
custom_sql_template = "part_id in (¤uniq_age_in¤)";
custom_sql = Eval Insert(custom_sql_template, "¤");
// your sql thing
Where(Custom(custom_sql, UI(Custom(Base("Continuous")))));
// or if evaluation is necessary
Eval(EvalExpr(
Where(Custom(Expr(custom_sql), UI(Custom(Base("Continuous")))));
));
-Jarmo