rivet Posted April 5, 2004 Posted April 5, 2004 I am updating a DB for a charity event that keeps track of ticket sales. Here is the challenge. There are 12 seats per table Each seat is $500 Max charge per table is $5000 Any quantity can be sold. e.g. - 32 seats = (2 tables and 8 seats) charge= 5000+5000+4000 FileMaker Version: 6 Platform: Mac OS X Panther
Ender Posted April 5, 2004 Posted April 5, 2004 Sounds like an algebra problem. Tables = Int(Seats Sold/12) Table Charge = 5000 * Tables Seats Remaining = Seats Sold - (Tables*12) Seats Remaining Charge = Seats * 400 Total Charge = Table Charge + Seats Remaining Charge
rivet Posted April 5, 2004 Author Posted April 5, 2004 I quickly built your formula, but it seems something is missing (or I have messed up). see attached seats.zip
CobaltSky Posted April 5, 2004 Posted April 5, 2004 Hi rivet, To accomplish the outcome you are looking for in a single step, you may wish to use the formula: Int(sold/12) * 5000 + Min(10, Mod(sold, 12)) * 500 Attached is a revised copy of your test file which includes the above formula and also has relevant corrections to the formulae which you were using to calculate the individual steps. seats.zip
RodinBangkok Posted April 5, 2004 Posted April 5, 2004 Hi Ray, in looking at your formula with regards to the min function, I was not aware that you could use direct entry numbers in the min function. In looking at the formula above I would have expected to get an error upon entry stating that 10 was not a valid field. The way the help explanation reads only field names are allowed in the Min function. Is this another undocumented feature or am I interpreting something wrong concerning min? Rod
CobaltSky Posted April 5, 2004 Posted April 5, 2004 Hi Rod, The Min( ) function can be applied to any series of entities that are resolvable numerically, so that can be a series of numbers, of expressions (so long as they produce a numeric result), fields, field repetitions or related records. A mix of numbers, fields and/or expressions is also possible. This has been the case through many versions (and is still so in version 7), though you woudn't know it from the manuals and the online help documentation. So I guess that yes, it is another undocumented feature... But then, if the documentation provided by FMI were to fully explain all the applications and permutations of every function and feature of FileMaker, they'd need a semi-trailer to deliver the manual.
Ender Posted April 6, 2004 Posted April 6, 2004 It seemed right in my head, but thanks for the Min() function, Ray.
Recommended Posts
This topic is 7536 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now