cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Register for our Discovery Summit 2024 conference, Oct. 21-24, where you’ll learn, connect, and be inspired.
Choose Language Hide Translation Bar
StandardPanda11
New Member

Can anyone help correct a script?

Hi all!

 

I wrote a script years ago, and it has some flaws that I'm not sure how to correct. It's pretty simple. I take a single column of data and split it into 3-5 columns of as close to equal as possible. It's a weight column- things amongst friends. We get a number of things of various weights and try to split it between us. The problem I'm having is that I didn't incorporate a way to acknowledge an uneven number. For example, if I have 150 things split 5 ways- it works. If I have 153 things split 5 ways, it goes haywire. I haven't scripted in almost a decade and cannot for the life of me remember or figure out how to have an "orphan" column- a place where the things that don't divide equally go. HELP!

I have JMP 18

I've added my script and a sample table with an uneven distribution.

What I would like to see is the most even distribution possible, with another column for the rows (objects) that don't figure in. 

2 REPLIES 2
WebDesignesCrow
Super User

Re: Can anyone help correct a script?

Hi @StandardPanda11,

Since you have JMP 18 & still remember the steps, how about click "File" --> "New" --> "Workflow Builder".

Then open you JMP table --> perform the steps manually to get the result.

 

You can click at the workflow builder that record your steps to view the JSL script.

More information about workflow builder:

https://www.jmp.com/support/help/en/18.0/index.shtml#page/jmp/overview-of-the-workflow-builder.shtml 

https://www.jmp.com/support/help/en/18.0/index.shtml#page/jmp/workflow-builder.shtml 

 

jthi
Super User

Re: Can anyone help correct a script?

How do you split the column "as close as possible"? And how do you determine in how many columns it should be split to? You might be able to do this using JMP's Subset using Stratify Create a Subset Data Table (jmp.com) (I think you might have to do it multiple times).

-Jarmo