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

Additionner des cellules

Bonjour, comment je pourrais faire pour : sur une colonne additionner les valeurs lorsque les termes consécutifs sont égaux et laisser les valeurs initiales lorsque les termes consécutifs sont différents ?

Ex:

 

hcarr01_1-1679296450498.png

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
jthi
Super User

Re: Additionner des cellules

Not exactly sure how you would like your data to look, but using Dif (or Lag) in formula should work

Names Default To Here(1);

dt = New Table("Untitled",
	Add Rows(7),
	Compress File When Saved(1),
	New Column("Column 1",
		Numeric,
		"Continuous",
		Format("Best", 12),
		Set Values([1, 1, 2, 3, 4, 4, 4, 5])
	)
);

dt << New Column("Col", Numeric, Continuous, Formula(
	As Constant(val = :Column 1);
	If(Dif(:Column 1) == 0,
		val += :Column 1
	,
		val = :Column 1;
	);
	val;
));
-Jarmo

View solution in original post

2 REPLIES 2
jthi
Super User

Re: Additionner des cellules

Not exactly sure how you would like your data to look, but using Dif (or Lag) in formula should work

Names Default To Here(1);

dt = New Table("Untitled",
	Add Rows(7),
	Compress File When Saved(1),
	New Column("Column 1",
		Numeric,
		"Continuous",
		Format("Best", 12),
		Set Values([1, 1, 2, 3, 4, 4, 4, 5])
	)
);

dt << New Column("Col", Numeric, Continuous, Formula(
	As Constant(val = :Column 1);
	If(Dif(:Column 1) == 0,
		val += :Column 1
	,
		val = :Column 1;
	);
	val;
));
-Jarmo
hcarr01
Level VI

Re: Additionner des cellules

 

Merci pour votre réponse @jthi !

Recommended Articles