Share your ideas for the JMP Scripting Unsession at Discovery Summit by September 17th. We hope to see you there!
Choose Language Hide Translation Bar
Highlighted
011717
Level II

Looping through non zero columns

Hi guys, I need help in creating a loop which will read my column MD where all non zero values will proceed to this process

 

 

dtSample =open("sample.jmp");
dtSample = datatable("smpl");
dtSample << Update(
With( Data Table( dtSpecs ) ),
Match Columns( :Parameter_R = :Parameter, :Order_R = :Order )
);
dtSample << delete columns(:Defecting_R,:Order_R);
deftb << new column("Sample1", numeric, continuous);
For(i=1,i<=N Rows(dtRdr),i++,
foundRows = deftb << get rows where( as column(deftb, dtSample:Parameter_R[i]) < dtSample:LL[i] & isMissing(deftb:MD) == 1 );
deftb:MD[foundRows] = dtSample:MD_LL[i];
foundRows = deftb << get rows where( as column(deftb, dtRdr:Parameter_R[i]) > dtRdr:UL[i] & isMissing(deftb:MD) == 1);
deftb:MD[foundRows] = dtRdr:MD_UL[i];
);

 

 

----

 

I've only started 

 

For each row(deftb:MD = If(deftb:MD != 0,
dtSample =open("sample.jmp"))
);

 

But can't seem to continue scripting since I'm new to this language, the syntax and logic is still confusing. please help and a little explanation will greatly help! Thanks

1 REPLY 1
Highlighted
Thierry_S
Level VI

Re: Looping through non zero columns

Hi,
I would like to help but the first section of script you posted does not make sense to me without more information:
1) You are defining dtSample twice using partially redundant methods
2) You Update dtSample with a dtSpecs that has not been defined (maybe elsewhere in you script?)
3) You are creating a new column in a table deftb that has not been defined (maybe elsewhere in you script?)
4) Your For Loop upper limits N Rows (dtRdr) use a third table that has not been defined either
Hence, it is very difficult to provide an answer without having both the complete script and example input and output.
Sorry for not being more constructive.
Best
TS
Thierry R. Sornasse