1 Reply Latest reply on Nov 10, 2011 8:12 AM by philmodjunk

    Median for multiple fields in a set of records

    RafaCorrea

      Title

      Median for multiple fields in a set of records

      Post

       Hi, I am working on a research database (FM 10) that has on each record multiple fields that contain numeric values (eg age, weight, ht, radiation dose...). I want to get the median values for each of this within the specific found set that I am at the time. I have had no luck with this... Is there any way that this can be done... Does anyone know if FM 11 has a specific median function.

      Thanks alot.

      Rafa

        • 1. Re: Median for multiple fields in a set of records
          philmodjunk

          It would be difficult to do given that you have different fields within the same record. If you moved this data into a related table where each record stored one value in the same field, this becomes a very easy excersize. You can sort your records in ascending or descending order and then access the middle record or pair of records to determine the median.

          GetNthRecord can be used along with count ( relatedTable::SomeNeverEmptyField ) to access the middle record or pair of records.