Forum Discussion
2 Replies
- EdwardHefterQrew Cadet
Thanks - I had seen that before and her videos have been extremely helpful to me! I am trying to find the highest value. I can rank them, but if I have 2 records in "first place," I can't do a "sumvalues" to find the highest number.
I might be able to do a sumvalue of the highest ranking and then divide by the number of records, though. I'll give that a try tomorrow.
------------------------------
Edward Hefter
www.Sutubra.com
------------------------------- EdwardHefterQrew Cadet
I was trying to figure out what the next serial number should be in a set of records with different airplane types, and each airplane type gets its own serial number with a 3 letter suffix, and the serial numbers increment for that airplane type. Sounds like the perfect use of a maxvalue function...I can't wait!
First step was to strip off the letters, which was easy enough using the "notright" function.
Then I ranked all of the serial numbers using the great suggestion from Matt Stephens and Quickbase Junkie!
First rank all the serial numbers (this is field 42):var Text GTESerial = "{43.GT."&[Number part of S/N]&"}"; //43 is [Number part of S/N]var text SameModel = "{7.EX.'"&[Aircraft or Float Type]&"'}"; //7 is [Aircraft or Float Type]Size(GetRecords($GTESerial & "AND" & $SameModel))+1
This will end up in the situation where, if two airplanes of the same type have the same serial number (gotta do the error checking!), they can both be number 1. So, I used a little math to divide the sum of all the number 1s by the number of records:
var Text FindLowest = "{42.EX.1}";var text SameModel = "{7.EX.'"&[Aircraft or Float Type]&"'}";(SumValues(GetRecords($FindLowest&"AND"&$SameModel),43)
/
Size(GetRecords($FindLowest&"AND"&$SameModel))) + 1
Time to put this in my toolbox and thank all the people who came before me and wrote up their solutions!
------------------------------
Edward Hefter
www.Sutubra.com
------------------------------