cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Register to attend Discovery Summit 2025 Online: Early Users Edition, Sept. 24-25.
  • New JMP features coming to desktops everywhere this September. Sign up to learn more at jmp.com/launch.
Choose Language Hide Translation Bar
Françoise
Level VI

formule

Bonjour,

 

je cherche à créer une nouvelle colonne qui ferait la division réf1 : réf 2 si et seulement si les valeurs d'identification sont identiques.

est-ce que quelqu'un a une solution?

 

cordialement

 

 

2025-07-02 155528.PNG.jpg

1 ACCEPTED SOLUTION

Accepted Solutions

Re: formule

And if sorting is not guaranteed, but there are still only one :réf 1 and one :réf 2 for each :Identification, you'll have to do something only a little more complex, like this.

 

id = :Identification;
:réf 1 / :réf 2[Where( :Identification == id & !Is Missing( :réf 2 ) )[1]];

mmarchandFSLR_0-1751469974299.png

 

 

View solution in original post

4 REPLIES 4

Re: formule

If the format is always as shown in your example picture,

 

:réf 1 / Lag( :réf 2 );

If the check of :Identification is necessary,

 

If( Lag( :Identification ) == :Identification,
	:réf 1 / Lag( :réf 2 )
);

mmarchandFSLR_0-1751469451826.png

 

Re: formule

And if sorting is not guaranteed, but there are still only one :réf 1 and one :réf 2 for each :Identification, you'll have to do something only a little more complex, like this.

 

id = :Identification;
:réf 1 / :réf 2[Where( :Identification == id & !Is Missing( :réf 2 ) )[1]];

mmarchandFSLR_0-1751469974299.png

 

 

Françoise
Level VI

Re: formule

Bonjour,

 

merci pour vos réponses.

voici les résultats avec les 2 formules proposées.

 

cordialement

Capture d’écran 2025-07-03 110711.jpg

jthi
Super User

Re: formule

If identification can only appear twice and only one of them has the value filled in, you can use any of col statistical functions such as col min()

Col Min(:ref1, :id) / Col Min(:ref2, :id)

jthi_0-1751472748880.png

There are also plenty of other options which might slightly depend on the full data you have. 

-Jarmo

Recommended Articles