cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
dnh234589
Level I

Normalize a column

TLDR: How do I normalize a column to itself?

 

See attached. I have:

  • Column A = 0,1,2,3. Maybe think of this as like an ID number
  • Column B. Think of this as a timestamp
  • Column C. This is the data

Now I want column D to have the data in Column C, ONLY when B=1.

As you can see in the attached file, I have manually copy-pasted the yellow cells from C into D. Pasted over and over.

Screenshot 2026-01-12 131239.png

Therefore when I do D/C, I'm basically normalizing the whole of column C, to these special yellow values. This is the reason I'm doing all this, is to find D/C. So a value of 0.9 in this column means C is lower than the yellow C's, and 1.1 means it's higher than the yellow C's. 

 

So, long story short, what is the formula that goes in D, to be able to get the yellow values?

1 ACCEPTED SOLUTION

Accepted Solutions
hogi
Level XIII

Re: Normalize a column

Use a grouped Col aggregation like col Median() to define the values of column D as 

Col median(if (:B==1,:C), :A)

You can also skip Column D and directly calculate :C/Denominator.
There is an AddIn in the Marketplace which does such Normalization automatically.

View solution in original post

11 REPLIES 11
mmarchandFSLR
Level VI

Re: Normalize a column

edit

Sorry, I need to pay more attention.  You weren't asking how to get D/C.

 

Select C and D, then right click.  New Formula Column > Combine > Ratio (reverse order)

mmarchandFSLR_0-1768253266140.png

 

mmarchandFSLR
Level VI

Re: Normalize a column

Sorry if I'm still misunderstanding, but if you want D to be missing when B is not 1 and D to have the values of C when B is one, try this formula.

 

Choose( :B, :C, . )
dnh234589
Level I

Re: Normalize a column

Thanks for your answer. Not exactly. I simply want a formula in column D, that will reproduce those numbers.

 

That formula will take the yellow cells in C, and apply it to the entire column D. So that now the entire column D is the repeated yellow cells as shown. (Presumably in the formula somewhere, we would hardcode B=1.)

 

Probably I confused things by manually typing in D in the example. I manually typed in those numbers, but I want a formula that will populate D for me.

dnh234589
Level I

Re: Normalize a column

Thanks for your answer, but here is a comparison of your answer, and what I want which is just a formula for D. So compare the final column and D and you'll see they are not the same.

Screenshot 2026-01-12 163235.png

txnelson
Super User

Re: Normalize a column

Isn'1 the formula just

If( :B == 1, 1, :D / :C )

txnelson_0-1768274651706.png

 

Jim
dnh234589
Level I

Re: Normalize a column

No, I want to find the formula for D. In my example I just manually typed in the numbers for D but I want a formula
hogi
Level XIII

Re: Normalize a column

what is wrong with

Col median(if (:B==1,:C), :A)

?

Re: Normalize a column

I'm sure there is a way to script a solution, but I would instead propose that switching from your Tall data format to a Wide data format makes more sense in this case. When using JMP formulas, it is always easiest when all the terms needed for that calculation are in the same row. (Sometimes this is impossible, then clever scripting is needed. But in this case, it is possible.)

My suggestion: Split the data table so that it is in a Wide format, with a separate Column for each "B". Then normalizing (diving by C) becomes easy. 

christianz_1-1768300938286.png

You can recode the column names to make them a bit more readable: 

christianz_2-1768300974359.png

After adding the new formula columns, you end up with: 

christianz_4-1768301435801.png

Would this work for you? I attached the table for your reference. 

hogi
Level XIII

Re: Normalize a column

Use a grouped Col aggregation like col Median() to define the values of column D as 

Col median(if (:B==1,:C), :A)

You can also skip Column D and directly calculate :C/Denominator.
There is an AddIn in the Marketplace which does such Normalization automatically.

Recommended Articles