cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Learn how to build custom Python data connectors and further customize JMP’s Data Connector Framework with the Python Data Connector Demo, available now in the JMP Marketplace!
  • See how to create experiments to support product design and ID useful product features. Register for June 12 webinar, 2pm US Eastern Time.

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