PDA

View Full Version : Summary Function Fileds A4 to A5


ABC123

fwala
06-22-2010, 09:15 PM
I'm trying to convert my A4 app to A5.

A4 had several choices in the Types of Summary field selections. There was Total, Count, First, Last, Biggest and Smallest. I'm interested in replacing the "Biggest" function. This function will retain the highest number in the column of numbers it was tracking. I.e, if the column contained numbers 13, 49 and 66, the summary field would print 66.

How would I replace this function in A5v10?

Thanx,
Frank

Tom Cone Jr
06-23-2010, 08:04 AM
Check the help file topics for tableMax(). It could be used in a calculated field expression for your table, form, or report.

Here's what the expression would look like to get the max field value for the "Extension" field in the "Invoice_items" table of AlphaSports


tablemax("invoice_items",".t.","Extension")

-- tom

ps. Welcome to AlphaFive!

fwala
06-23-2010, 11:43 AM
Exactly what I needed. Thank you, and thanks for the welcome.

Frank

fwala
09-15-2010, 07:25 PM
Hi Tom (or anyone reading this),

I have finally run my report using "real situation" data. I find that Tablemax does not quite replace the A4 "highest" function.

For my report, I need to find the "highest" value in the parent of the current set based on a filtered or group value. The Tablemax function returns the "highest" value on the parent table regardless of group/filters.

If tried a calculation using the IF funtion to compare values and conditionally retain the highest value, however, the false side of the IF is zeroing out the retained value. See below:

Variable:
HIHI = 0

Calc:
IF(Ediv->Invalue > Var->HIHI,Var->HIHI=Ediv->Invalue,Var->HIHI=Var->HIHI)

I'm thinking an xbasic IF script with a null ELSE might do the trick, but I don't know how or where to get this in my report.

Thanks for your help in advance,
Frank