Normally, I have used median() on a summary value. Now I need to get the median on an array of 7 elements within a single record in the details section.
Here is what I have so far:
WhilePrintingRecords;
Numbervar Array Values:=[{fld1},{fld2},{fld3},{fld4},{fld5},{fld6},{fld 7}];
Sales[(count(Numbervar Array sales))/2];
This returns the middle of the array, or {Fld4}. However, {fld4} is not actually the median, it is just the middle element of my array. To get a mathematical median, what I need to do is sort the elements of the array so that the middle value is always in the middle, so that the last line of my code will actually return a median. Any ideas?
Or if anyone has another way to approach this I am all ears.
Software Training and Support for Macola, Crystal Reports and Goldmine
714-348-0964
dgilsdorf@mchsi.com
Here is what I have so far:
WhilePrintingRecords;
Numbervar Array Values:=[{fld1},{fld2},{fld3},{fld4},{fld5},{fld6},{fld 7}];
Sales[(count(Numbervar Array sales))/2];
This returns the middle of the array, or {Fld4}. However, {fld4} is not actually the median, it is just the middle element of my array. To get a mathematical median, what I need to do is sort the elements of the array so that the middle value is always in the middle, so that the last line of my code will actually return a median. Any ideas?
Or if anyone has another way to approach this I am all ears.
Software Training and Support for Macola, Crystal Reports and Goldmine
714-348-0964
dgilsdorf@mchsi.com