cancel
Showing results for 
Search instead for 
Did you mean: 

Find MAX in Row of Values

Former Member
0 Kudos

How do I find the MAX value in a row of values?

So far my report looks like this:

               0100     0300     0500    0700

pH             7.2       7.3       7.7       7.2

temp          11         9          9          12       

I need my data to look like this:

               0100     0300     0500    0700     MAX

pH             7.2       7.3       7.7       7.2        7.7

temp          11         9          9          12        12

I've tried using MAX(in[0100], [0300], [0500], [0700])), but that doesn't work.

Thanks!

-Eric

Accepted Solutions (1)

Accepted Solutions (1)

abhilash_kumar
Active Contributor
0 Kudos

Hi Eric,

Create a formula with this code:

Local numbervar array arr;

arr := [{0100}, {0300}, {0500}, {0700}];

Maximum(arr);

Hope this helps!

-Abhilash

Former Member
0 Kudos

That works! Thanks.

I've got some holes in my data (null values). The MAX isn't calculating on rows where some values are null. Any ideas on how to adjust for this?

-Eric

abhilash_kumar
Active Contributor
0 Kudos

That's strange. Could you go to File > Options > Reporting tab > check "Convert Database NULL values to default" and also "Convert other NULL values to default".

Then go to File > Report Options > check the above options in here as well.

Let me know the results. If that doesn't work, please attach a copy of the report with saved data.

To attach the report, please make sure you change its extension to .txt first.

-Abhilash

Former Member
0 Kudos

My problem was that I was using Tonumber instead of Val in some of my formulas. So the last twist to my problem is now answered. Thanks!

-Eric

Answers (0)