Hi, FileMaker experts!

I am stuck with a problem that I can't seem to solve and would really appreciate your assistance. My skills with FileMaker are limited as I have been dusting off memories of using FileMaker 5.5, though I am finding FileMaker 15 to be awesome. Here's my problem.

I have a table that will produce a report which uses two separate relational database tables of data to populate the report. I have developed this solution in this manner because there are hundreds of fields needed for this report already laid out in an Excel spreadsheet, which saves me time from creating fields in an additional table within the database. What I need the database to do is to look through a set of fields and determine the three highest values and color the three fields green.

This is what I have tried already: I've read about the conditional formatting functionality in FM15 and the ability to develop a formula to carry this task out. I also know that this task can be completed in Excel using the LARGE function, so if Excel can do it, I'm sure that FM can as well. When I use ExcuteSQL to try to determine and color the three largest values, all records in my database are green. Here is my statement:

ExecuteSQL ("SELECT MAX(ESImport::_3LA.A.1, ESImport::_3LA.A.3, ESImport::_3LA.A.4, ESImport::_3LA.B.10, ESImport::_3LA.B.11, ESImport::_3LA.B.12, ESImport::_3LA.B.13, FROM ESImport)" ; "" ; "")

What am I doing wrong? Do you have any advice or a solution for me?

Thank you!

There's a big difference between finding the RECORD where FIELD A has the greatest value and finding the FIELD from a group of fields in the same record that has the largest value. And it appears that you actually want the max value from a group of field from a group of records. That's basically a two dimensional array and you want the largest value.

Is that correct or am I misreading your initial post?

The Max function in Execute SQL will return the largest value for a given field from the set of records returned by the query so that would not seem to be what you need here.

Max ( Field1 ; Field2 ; Field3 ; Field4....)

Would return the largest value of a group of fields in one record. This could be set up as a calculation field, cMaxField. Then the maximum value of cMaxField could be found via SQL or nonSQL methods.

But you mention needing the "top 3 values" that would seem to complicate this even further.

All in all a different structure to your data (how it's organized into fields and records) that puts one value in one record might make this process much simpler.