Skipi Posted November 24, 2008 Posted November 24, 2008 Hi, I've let my filemaker go bit rusty and I'm driving myself mad trying to remember how to make a calculation that gives a result based on a range of numbers. ie. 1-10 =10 11-20 = 20 21-30=30 etc I've tried case (field >1 <10;10 etc etc i've a feeling that I'm missing something between the >1 and <10??? Thanks in advance, Skip
LaRetta Posted November 24, 2008 Posted November 24, 2008 (edited) Case ( field < 10 ; 10 ; field < 20 ; 20 ; field < 30 ; 30 ; ... continue and then if there is a default result ; 999 ) Since vs. 7, calculations short circuit and stop evaluating when they hit the first true. There is also concept of predicting which groups will have the largest numbers of records returned and planning for it. For instance, if you know that 80% of your records are above 80 but not over 100 then it works best to reverse the theory as: Case ( field > 100 ; 999 ; field > 90 ; 90 ; field > 80 ; 80 ; ... etc. Taking advantage of branch prediction will speed up evaluations overall. Edited November 24, 2008 by Guest Added explanation
LaRetta Posted November 24, 2008 Posted November 24, 2008 Actually, you may not need to list out all your options. Consider this as well: Ceiling ( field / 10 ) * 10
Recommended Posts
This topic is 5903 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