Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- JMP User Community
- :
- Discussions
- :
- Discussions
- :
- Control Chart Scripting Question

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Control Chart Scripting Question

Jun 1, 2019 2:57 PM
(521 views)

So 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)

4 REPLIES 4

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: Control Chart Scripting Question

I am not aware of any such syntax. I suggest that you add your request to the JMP Wish List

Jim

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: Control Chart Scripting Question

Hi @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!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: Control Chart Scripting Question

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: Control Chart Scripting Question

Hi @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^ ) )
);
]\" ) ) );
```