Anyone know of a quick way to determine the largest value in a row or column in a table? (numerical data)
(Other than setting up repeats and comparing a series of pairs )
Thanks,
Ron
find largest value
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- Posts: 106
- Joined: Wed May 31, 2006 9:56 pm
- Contact:
Re: find largest value
Well, for a row it would be pretty easy. Since tables are tab delimited, put the line in question into a variable, replace tab with comma in the variable so that its a number list, and use the max() function.
For column, I believe you do need a repeat, off the top of my head something like
edit: Forgot, you need to set the itemdelimiter to tab for this to work. Add a line like
set the itemdelimiter to tab above the start of the repeat.
For column, I believe you do need a repeat, off the top of my head something like
Code: Select all
repeat for each line theLIne in field "tablefield"
put item 3 of theLIne & comma after tempVar -- build the number list
end repeat
delete the last char of tempVar -- cut the trailing comma
get max(tempVar) -- find the max
set the itemdelimiter to tab above the start of the repeat.
-
- Posts: 106
- Joined: Wed May 31, 2006 9:56 pm
- Contact:
Re: find largest value
That's embarrassing- I forgot about the Max() function
-! Use it all the time in Excel, etc.
Guess it's time to stop for the night.

Guess it's time to stop for the night.