<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />Newb to jmp here. I am trying to create a new column in my code data.jmp file called "Limits" by matching the Standard and Grade from the Table matrix.jmp file. e.g. The first row is Standard A & Gade 100, so the column in limits should be filled with 1.
Assuming you do not want to change your data structure, using JSL like:
NamesDefaultToHere(1);
dtM = DataTable("Table Matrix.jmp");
dtD = DataTable("Code Data.jmp");
standardVals = Column(dtM, "MATRIX") << GetValues;
For(r=1, r<=NRow(dtD), r++,
standard = Column(dtD, "STANDARD")[r];
grade = Column(dtD, "GRADE")[r];
limit = Column(dtM, grade)[Loc(standardVals, standard)];
Column(dtD, "LIMIT")[r] = limit;
);
will work.
To run it, do 'File>New>New Script', paste in the code, then do 'Edit> Run Script' (make sure both tables are open first).