Subscribe Bookmark RSS Feed

matching rows in a specific column with rows in another table's column


Community Trekker


Jul 2, 2012

I have tried a few jsl commands as well as some matching row commands under tables. I just need to have the user's input from one column in one table be  matched with the rows of one specific column in another table. Thanks


Super User


Jun 23, 2011

Generally you can select rows with something like this:

dt = current data table();

dt << select where(:One Column =="Hello" & :Second Column == "World" & :Num Column > 23);

In this example I'm referencing two text columns (One Column and Second Column), and a numeric column (Num Column).  The ampersands turn it into an AND statement, but you can mix and match with the OR operator "|" (vertical bar), parentheses, etc.

If you have user choices stored in variables it will look like this:

dt = current data table();

user_choice1 = "Hello";

user_choice2 = "World";

user_choice3 = 23;

dt << select where(:One Column == user_choice1 &

                   :Second Column == user_choice2 &

                   :Num Column > user_choice3);