Topic: Trying Add Highest and Lowest Values from a field Posted: 28 Oct 2013 at 1:54am
Record setA
Record ID TimeSlice
A1 520
A2 460 *
A3 550
A4 700 *
A5 650
Need to subtract the highest value in the range from the lowest value in the range.
E.g. 700 - 460 = 240
240 is the result of the calculation that I want to print out per Record set
Report Output (Detail line for Group Footer if that works better ... not sure about best approach)
Set A Result = 240
Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Posted: 28 Oct 2013 at 4:48am
well, my favorite is the variable...they come in sets of 3 formulas (probably could use a running total as well)
reset: usually in a group header
shared numbervar hi:=0;
shared numbervar low:=1000000;
""//hide the reset value
increment: usually in details:
shared numbervar hi;
shared numbervar low;
if {table.field} > hi then hi:={table.field};
if {table.field} < low then low:={table.field};
"" //again to hide the output
display: usually in a group footer
shared numbervar hi;
shared numbervar low;
hi-low
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum