cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Image to Table JMP extension imports single or batch images as data tables. Useful to extract curves from pictures or convert image data to curve data to use in analyses like Functional Data Explorer. Download and install the extension.

Discussions

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

formule

Bonjour à tous,
Je vous pose une simple question, j’aimerais établir la requête suivante à l’aide des formules dans JMP si possible :
 
Mettre dans la colonne « erreur » la valeur 1 une ligne après qu’une cellule dans la colonne « bilan » soit non-nulle.
 
Voici la base de données :
 
hcarr01_0-1689678474015.png
Il faudrait qu’à la ligne 38 061 la valeur dans la colonne « bilan » soit 1 et pas la ligne 38 060.
 
Merci pour vos réponses !
2 ACCEPTED SOLUTIONS

Accepted Solutions
jthi
Super User

Re: formule

Using Lag() (and possibly check for first row) should be enough here.

Names Default To Here(1);

dt = New Table("Untitled 5",
	Add Rows(3),
	Compress File When Saved(1),
	New Column("Column 1", Character, "Nominal", Set Values({"", "aaa", ""}))
);

dt << New Column("Col", Numeric, Nominal, Formula(
	Row() != 1 & !IsMissing(Lag(:Column 1, 1))
));
-Jarmo

View solution in original post

txnelson
Super User

Re: formule

Jarmo's formula works fine, but it can be simplified to

If( Is Missing( Lag( :Bilan ) ) == 0,
	1,
	0
)

which will increase the runtime efficiency

Jim

View solution in original post

2 REPLIES 2
jthi
Super User

Re: formule

Using Lag() (and possibly check for first row) should be enough here.

Names Default To Here(1);

dt = New Table("Untitled 5",
	Add Rows(3),
	Compress File When Saved(1),
	New Column("Column 1", Character, "Nominal", Set Values({"", "aaa", ""}))
);

dt << New Column("Col", Numeric, Nominal, Formula(
	Row() != 1 & !IsMissing(Lag(:Column 1, 1))
));
-Jarmo
txnelson
Super User

Re: formule

Jarmo's formula works fine, but it can be simplified to

If( Is Missing( Lag( :Bilan ) ) == 0,
	1,
	0
)

which will increase the runtime efficiency

Jim

Recommended Articles