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
skratchzero
Level II

How do I calculate a new column with row-dependent operations determined by a grouping label?

I created a stacked table that has a column X corresponding to x-coordinates, a column Label with a grouping label, and finally the Data column. Suppose the set of x-coordinates shared for all collected data are [1,2,3,4,5,6,7,8,9,10], there are three groups A,B,C, and the data are arbitrary numbers. I want to make a new column where the value from Data is normalized within each group (A, B, C) by the value from that group at a specific coordinate, let's say X=3. In other words, for every row where Label = A, divide Data by the value of Data where X=3 AND Label=A. Repeat for B and C. I can think of approaches with if and for loops, but I suspect that is a pretty inefficient way to do the calculation at scale.

1 ACCEPTED SOLUTION

Accepted Solutions
hogi
Level XII

Re: How do I calculate a new column with row-dependent operations determined by a grouping label?

3 REPLIES 3
hogi
Level XII

Re: How do I calculate a new column with row-dependent operations determined by a grouping label?

use the Normalization GUI 

hogi
Level XII

Re: How do I calculate a new column with row-dependent operations determined by a grouping label?

If you prefer a script: 
use the GUI once to create a normalized column, then steal the code.

hogi_2-1719608492311.png

 

 

skratchzero
Level II

Re: How do I calculate a new column with row-dependent operations determined by a grouping label?

Wow that's exactly what I needed, thank you!