get rows where and select where<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />I'm seeing a weird issue with get rows where when trying to make it dynamic.
dt = Open("$SAMPLE_DATA\Big Class.jmp");
dt << get rows Where(:Sex == "F"); //Works
dt << Get Rows Where(Column("Sex") == "F"); // Doesn't Work
//but ...
col = :Sex; //doesn't work
col = Column("Sex"); //Works
//so trying to do
dt << Get Rows Where (col == "F");
//can't work in any way that I can see
Tried a few different versions. Anyone else getting this? I swear I've done this before. I tried :Name as well but it doesn't like using a variable and doing some type of Eval seems pretty hacky for this.
Re: get rows where and select wherebetter solution;
dt = Open("$SAMPLE_DATA\Big Class.jmp");
col1="height"; val="61"; val2="95";
srows = dt << get rows Where(char(column(col1)[]) == char(val) );
Re: get rows where and select whereOne more wrinkle. I use strings for the column names, rather than pointers to the column. This works:
dt = Open("$SAMPLE_DATA\Big Class.jmp");
col = "Sex";
srows = dt << get rows Where(as column(dt, col) == "F");
This works too:
srows = dt << get rows Where(as column(col) == "F");
Re: get rows where and select whereYep. Column("Sex")[row()] was how I was doing it before.
Thank you
Re: get rows where and select whereAn empty index appears to be needed to access the data of a column when the current row is implicit. Alternatively As Column() can be applied to a column name (as string) or a variable.
dt << Get Rows Where(Column("Sex")[] == "F"); // Works
col = Column("Sex"); //Works
dt << Get Rows Where(col[] == "F"); // Works
dt << Get Rows Where(As Column(col) == "F"); // Works
dt << Get Rows Where(As Column("sex") == "F"); // Works
Re: get rows where and select whereI could do
col = Column("Sex")<<Get Values;
Loc(col,"F");
But I still think something within the data table should work.