cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Sign-in to the JMP Community will be unavailable intermittently Dec. 6-7 due to a system update. Thank you for your understanding!
  • We’re retiring the File Exchange at the end of this year. The JMP Marketplace is now your destination for add-ins and extensions.
  • JMP 19 is here! Learn more about the new features.

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