Hi,
I'm trying to write a script comparing rows by group but am having trouble figuring out how to do this In the table below, I'm trying to select rows that meet both of the following conditions within a group (i.e. by "Subject Number" column):
- Value in "Target # Days from Previous" column is greater than the row with a value of zero (in example below highlighted rows 71 through 82 have values greater than value for row 83)
- Value in "Visit Sequence" column is less than the value in this column for the row where "Target # Days from Previous" is equal to zero (in example below highlighted rows 71 though 82 have values less than value for row 83)
Basically I'm trying to compare rows within a group with another row within the same group and do this for the entire table. Does anyone know how I can do this?

Thanks,
Christine