cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • JMP will suspend normal business operations for our Winter Holiday beginning on Wednesday, Dec. 24, 2025, at 5:00 p.m. ET (2:00 p.m. ET for JMP Accounts Receivable).
    Regular business hours will resume at 9:00 a.m. EST on Friday, Jan. 2, 2026.
  • We’re retiring the File Exchange at the end of this year. The JMP Marketplace is now your destination for add-ins and extensions.

Discussions

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

Divide column by reference point with conditions

Hi. I have a problem I can't get my head around. 

I am trying to create a new column which consists of another column divided by a reference point, but the problem is I have some conditions to include.

For simplicity I have added a generated datafile which I will refer to.

 

What I want to do is to take column Z and divide it by Z|X=c within each Y-group. The Y-groups are as you can tell not the same size.

 

SO C is the reference point, and for all Y-groups (1-9) I want to take column Z, and divide it by Z|X=c.

That is, in the new column all values where X=c will be 1 and the others will be Z / (Z|X=c).

 

I apologize for not being able to formulate myself in clearer terms, for various reasons I can not show my real dataset and English is not my native tounge. 

 

Any help is greatly appreciated.

V

 

1 ACCEPTED SOLUTION

Accepted Solutions
txnelson
Super User

Re: Divide column by reference point with conditions

Here is one formula that works

currentY = :Y;
:Z / :Z[(Current Data Table() << get rows where( :X == "c" & :Y == currentY ))[1]];

txnelson_0-1636019077377.png

 

Jim

View solution in original post

2 REPLIES 2
txnelson
Super User

Re: Divide column by reference point with conditions

Here is one formula that works

currentY = :Y;
:Z / :Z[(Current Data Table() << get rows where( :X == "c" & :Y == currentY ))[1]];

txnelson_0-1636019077377.png

 

Jim
Vvvv
Level II

Re: Divide column by reference point with conditions

Haha this was way easier than I thought it would be.

 

Thank you very much.

Recommended Articles