I was able to find this formula when searching through the threads. It seems to work but only if all of the columns have a value. My problem is that some columns have null values. I don't want to just convert them to a 0 but exclude them entirely. Any help would be greatly appreciated.
WhilePrintingRecords;
Numbervar Array Values:=[{field.1},{field.2},{field.3},{field.4},{field.5},{field.6},{field.7},{field.8},{field.9}];
Numbervar Array Final := [0,0,0,0,0,0,0,0,0];
Numbervar m;
NumberVar n;
NumberVar MedianValue;
//sorting
for m := 1 to ubound(Values) do
(
Final[m] := Maximum(Values);
for n := 1 to ubound(Values) do
(
if Values[n] = Final[m] then
(
Values[n] := 0;
Exit For;
);
);
);
MedianValue := Final[round((count(Numbervar Array Final))/2,0)];
WhilePrintingRecords;
Numbervar Array Values:=[{field.1},{field.2},{field.3},{field.4},{field.5},{field.6},{field.7},{field.8},{field.9}];
Numbervar Array Final := [0,0,0,0,0,0,0,0,0];
Numbervar m;
NumberVar n;
NumberVar MedianValue;
//sorting
for m := 1 to ubound(Values) do
(
Final[m] := Maximum(Values);
for n := 1 to ubound(Values) do
(
if Values[n] = Final[m] then
(
Values[n] := 0;
Exit For;
);
);
);
MedianValue := Final[round((count(Numbervar Array Final))/2,0)];