cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Try the Materials Informatics Toolkit, which is designed to easily handle SMILES data. This and other helpful add-ins are available in the JMP® Marketplace
Choose Language Hide Translation Bar
VD
VD
Level I

JSL scripting

I would like to add a group column based on the range value of another column. The max of item in the same group is 15. Sample data attached

8 REPLIES 8
Jeff_Perkinson
Community Manager Community Manager

Re: JSL scripting

I'm afraid I don't understand how you want to assign this new grouping column. Can you be more specific and provide some example values? 

Also, it would be easier to help you if you attach a JMP data table instead of an Excel file.

-Jeff
VD
VD
Level I

Re: JSL scripting

Hi Jeff,

Thanks for take a look to my asking.

I re-attaches 2 table, 1 for original and the final is the one I want to be in jmp.

From the final one, I want to add a new column (group) based on the value from price column.

The price can be variation by sell item but if they are closed each other then I want them in the same group.

Jeff_Perkinson
Community Manager Community Manager

Re: JSL scripting

Thanks, @VD, that helps but it does lead to the next question, what rule is applied to say that the first six rows go to one group (i.e. "sell-1"), then the next six to another group, and so forth.

What is it that defines the groups? 

-Jeff
VD
VD
Level I

Re: JSL scripting

hi Jeff, the group define by the price column. The price is always difference by line item but if they have the same range then in the same group.

I want to be in script so i can use on difference data table with difference price.

Thanks,

Jeff_Perkinson
Community Manager Community Manager

Re: JSL scripting

How large a difference between the price from one row to the next would make it a different group? 1000? 100? 

You also only want 15 rows in one group, so if the price doesn't exceed the difference asked about above but there have already been 15 rows in th group then you want a new group. Is that correct?

-Jeff
fja
fja
Level III

Re: JSL scripting

Hello!

I do not understand your question either (as @Jeff_Perkinson)... is it that want to divide your data into groups with a maximum of 15 participants ... and than have the data rows flagged with an indicator for that? If so, does the continuous indicator in your data matter or just the row number (i.e. can we assume the data to be sorted)?

Regards

fja

VD
VD
Level I

Re: JSL scripting

Hi fja,

Thanks for take a look to my asking.

I re-attaches 2 table, 1 for original and the final is the one I want to be in jmp.

From the final one, I want to add a new column (group) based on the value from price column.

The price can be variation by sell item but if they are closed each other then I want them in the same group.

hogi
Level XII

Re: JSL scripting

If manual grouping is OK for you, you can use:
Right-Click on the price column/New Formula column/Distributional/Custom binning ...

hogi_0-1670969639176.png

hogi_1-1670969858276.png

 

Group 4 and 5 look quite the same. Possible to combine them in one group?
And perhaps split group 3?

hogi_2-1670969903732.png