cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Choose Language Hide Translation Bar
pankajsync
Level I

Difference between each points

I would like to create a new column which shows the difference between the two values as highlighted (Column = Value). I need help to come up with a formula in that new column which shows the difference between blue point and red point for each Abs[Voltage] and for each Site and Coupon. Attaching the jmp file.

 

pankajsync_0-1714344389742.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
jthi
Super User

Re: Difference between each points

For formulas there are many different kinds of Col formula combinations you can use, Jim suggested one and here is another which might work (add Abs/swap order as needed)

Col Mean(If(:EPG == "TE", :Value, .), :Coupon, :Site, :"Abs[Voltage]"n) - Col Mean(If(:EPG == "TP", :Value, .), :Coupon, :Site, :"Abs[Voltage]"n);

 

I know you asked for a formula, but if you can split your data this is much simpler to do as you can just add new difference column as you would be comparing row by row. In this case you might want to remove duplicate values first to avoid some possible issues. Depending on your data you can do this from rows menu and select duplicates -> remove them or create new summary table.

 

-Jarmo

View solution in original post

2 REPLIES 2
txnelson
Super User

Re: Difference between each points

Here is the formula that I came up with.....others may have alternate solutions.

theDif = Col Max( :Value, :Site, :"Abs[Voltage]"n ) - Col Min( :Value, :Site, :"Abs[Voltage]"n );
If( :Value < Col Mean( :Value, :Site, :"Abs[Voltage]"n ),
	theDif = theDif * -1
);
theDif;
Jim
jthi
Super User

Re: Difference between each points

For formulas there are many different kinds of Col formula combinations you can use, Jim suggested one and here is another which might work (add Abs/swap order as needed)

Col Mean(If(:EPG == "TE", :Value, .), :Coupon, :Site, :"Abs[Voltage]"n) - Col Mean(If(:EPG == "TP", :Value, .), :Coupon, :Site, :"Abs[Voltage]"n);

 

I know you asked for a formula, but if you can split your data this is much simpler to do as you can just add new difference column as you would be comparing row by row. In this case you might want to remove duplicate values first to avoid some possible issues. Depending on your data you can do this from rows menu and select duplicates -> remove them or create new summary table.

 

-Jarmo