Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is there a problem with nthlargest???

Status
Not open for further replies.

klameer

Technical User
Jun 21, 2002
26
LK
Ok this is my code in basic syntax

Dim Amt1 As Number
Dim count1 As Number
count1 = 1

Amt1 = (Nthlargest(1, {TAirTrans.FATrFare},{TAirTrans.FATrSINo}))

Do while Amt1 <> Nthlargest(count1, {TAirTrans.FATrFare},{TAirTrans.FATrSINo})
count1 = count1 + 1
Loop

formula = count1

but when I look for errors it points at the count1 in the second nthlargest and says that a number is expected here well I defined it as a number didnt I???

Halp@!
 
You can't substitute real numbers with variables in NthLargest - which always seemed a bit retarded to me.

Can't you achieve what you're trying to do replacing NthLargest with Maximum?

Amt1 = (Maximum({TAirTrans.FATrFare},{TAirTrans.FATrSINo}))

Naith
 
What is this formula supposed to do? The loop's never ever going to get started. The first occurence of Count1 equals the get out clause of the loop.

Naith
 
Ya, I know, I would have sorted that out after I figured out why I was getting an error in the formula editor. Little steps forward Naith. Maximum won't work because if this worked there would be other procedures stemming from the value of count1. The ultimate goal would be to gove a detailed breakup of fares in an invoice. There could be 5 possible variations.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top