select a row then reselect ScriptiingIn this sample table, I am trying to select the row that has a value of 2 in :Number, then grab the value "A" from :letter then select all the rows contains "A" in :Letter.


I wrote this script but it is not working.
dt= current datatable();
dt <<SELECT where=""></SELECT>
looking at the log
s = {"A", "A", "A", "B", "B", "B"};
And no rows were selected at the end of the script.
What went wrong?
Thanks
ScriptingRe: select a row then reselect ScriptiingI think you should have all rows selected based on your script because s contains all values from Letter column, not just those which match number 2's letter and then you check if current rows letter is in that list (it always is).
There are many ways to do what you want. Here is the method I would most likely use ( Data table subscripting 
Names Default To Here(1);
dt = New Table("Untitled",
Add Rows(6),
New Column("Letter", Character, "Nominal", Set Values({"A", "A", "A", "B", "B", "B"})),
New Column("Number", Numeric, "Continuous", Format("Best", 12), Set Values([1, 2, 3, 4, 5, 6]))
);
num_rows = dt << Get Rows Where(:Number == 2);
show(num_rows);
letters_of_interest = dt[num_rows, "Letter"];
show(letters_of_interest);
dt << Select Where(Contains(letters_of_interest, :Letter));
You could also use << Select Where in combination with << Get Selected Rows (one exampleget values from select where )
Re: select a row then reselect ScriptiingThank you. I certainly missed the "Get Rows part"
I came up with this script after a bit of digging
dt= current datatable();
dt <<ROW selection=""></ROW>