Choose Language Hide Translation Bar
Highlighted
lwx228
Level VII

May I ask whether these two steps can be completed by a formula?

1. In the original ranking situation, we first found out that the weight was the largest position among the three people before and after the belief (7 people were compared each time).
2. Then find the number of lines between the equals sign of each line and the maximum weight.
(when he has a maximum weight, his subsequent lines are compared with the new maximum weight.)
This table data in dt = Open("$SAMPLE_DATA/Big class.jmp ");I can only add 2 columns to the file to complete it.2019-08-28_21-52-41.png

2 REPLIES 2
Highlighted
lwx228
Level VII

Re: May I ask whether these two steps can be completed by a formula?

It seems to work.I want a better way,Thanks!2019-08-28_22-16-09.png

Highlighted
ih
ih
Level VII

Re: May I ask whether these two steps can be completed by a formula?

Here is an option to do this in one column, note the new column name is 'IntervalNew':

 

IntervalNew.PNG

 

Script to create the column for you using the big class data table:

View more...
names default to here(1);
dt = open("$SAMPLE_DATA/big class.jmp");
dt << New Column( "IntervalNew",
	Numeric,
	"Continuous",
	Format( "Best", 12 ),
	Formula(
		If(
			Row() == 1, 1,
			:weight == Max( :weight[Index( Row() - 3, Row() + 3 )] ), 0,
			Lag( :IntervalNew ) + 1
		)
	)
);
Article Labels

    There are no labels assigned to this post.