Control Chart Scripting QuestionSo I have this
dt << newColumn("FlatPeak", "numeric", "continuous",setFormula(If( :DISPENSESPEED == 1550,
Maximum( :R050, :R051, :R052, :R053, :R054, :R055, :R056, :R057, :R058, :R059,:R060) * 1000,
.
)
));
Can I somehow use
dt << newColumn("FlatPeak", "numeric", "continuous",setFormula(If( :DISPENSESPEED == 1550,
Maximum( :R050 : :R060) * 1000,
.
)
));
Trying to be able to specify more columns (:R050 etc...) without having to type them out...
kind of like
=AVERAGE(A1:G1)
Re: Control Chart Scripting QuestionI am not aware of any such syntax. I suggest that you add your request to the JMP Wish ListRe: Control Chart Scripting QuestionHi @UberBock,
I'm also unaware of any jsl that will allow you to specify a column range in that way (and in general, I avoid numeric references to columns since order then affects the results of my scripts). That said, I feel your pain in specifying large numbers of columns. What I do is use the "Replace Selected Subexpression" operation in Formula Editor to create the list of columns, and then copy into my jsl. Just add a function (like max(), into your formula, select a set of columns, right click > replace the selected subexpression with columns. Here's what that looks like:
I hope this helps!
@julian
Re: Control Chart Scripting QuestionTHank you for the suggestion. I can see how that would make it easier. In my case it wouldnt work very well. I am using the custom SQL to query data. In the Post-Script Query tab I have various scripts to add things and other things. So I would have to create a new table with the column names from the database to use what you suggest. RIght now I use excel/notepad to create a long list of comma delimited items to paste into the script. I understand that my case is not common.
Re: Control Chart Scripting QuestionHi @UberBock,
I understand! Perhaps some jsl to make your list of columns and then evaluate the formula with that list could do the trick? Here's one (perhaps inelegant) way to do it:
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Baltic.jmp" );
//set range for columns
colMin = 5;
colMax = 8;
colStrList = "";
//make list of columns
For( i = colMin, i < colMax, i++,
colStrList ||= ":Name(\!"" || Column Name( i ) || "\!"),"
);
//create formula
Eval( Parse( Eval Insert( "\[
dt << New Column( "Test",
"numeric",
"continuous",
Set Formula( Maximum( ^colStrList^ ) )
);
]\" ) ) );
@julian