2 Replies Latest reply on Mar 9, 2013 5:39 AM by ronnieedm

# Problem using Max function for setting the Maximum X value in a chart

### Title

Problem using Max function for setting the Maximum X value in a chart

### Post

I'm hoping maybe someone has a solution for this.  I am charting a lot of data points.  In Axis options, I can set the Minimum point and label to show correctly by using the Calcuation Min (field name).  It's Set Maximum that doesn't seem to work correctly.  I am using the Calculation Max (field name) - like when I Set Minimum.  I may have about 100 or so points to chart at a time and the chart always wants to add 3-8 blank lines at the end and not stop on the Max value of the found set.  You may have to scroll all the way to the bottom right to see the screenshot...

• ###### 1. Re: Problem using Max function for setting the Maximum X value in a chart

Min ( fieldname ) and Max (fieldName )

probably aren't producing the results that you think.

both require a list of fields or a repeating field before they return anything but the value of a single field in the current record.

Max ( 4 ) is 4 after all, it's just not referring to the values ( 5, 3, 6 100 ) found in other records in your table.

Max should be used like this:

Max ( RelatedTable::Field ) , Max ( Field 1 ; Field 2 ; Field 3 ) or Max ( repeatingField )

None of these options return the maximum value for your current set of records in your found set.

Min follows the same rules. It may be returning an acceptable value purely by accident.

If your chart is charting values from a found set of records, try defining a pair of summary fields that compute the maximum and minimum values and then refer to these summary fields instead of using the Max and Min aggregate functions.

You might also be able to use ExecuteSQL() to get the max and min values. (FileMaker 12 or newer only.)

• ###### 2. Re: Problem using Max function for setting the Maximum X value in a chart

I guess I'm confused.  I use Max and Min in other layouts and it always produces the correct minimun and maximun values.  Some of these databases contain 400,000 records and they always find the exact min and max values of the found set.  I did go back and create a summary field for Min and one for Max, then used that field name for the Axis options for Set Min and Set Max and it works like it's supposed to.  Thanks for the help.