Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

This topic is 4448 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

Hello everyone,

I am trying to create a calculation that checks to see if the number in a field falls within a certain range and thereby assign it a value based on that. For instance, if the number is 34, then assign it a 3 (to state it simply). I've tried experimenting with the Case function, but to no avail. The problem I am having is setting it up so that it checks for being in a specific range, like 11 to 20, 21 to 30, etc. How would I setup the calculation to check for being within a specific range? And is there a better option than Case for this?

Thanks in Advance,

Joshua

Posted

Look at the example here

The case evaluates until it finds a correct answer, so your statement would be something like this.

Case( data >= 40; 4 ;data > 30; 3 ; data >= 20 ; 2; data >= 10 ; 1 ; data < 10 ; 0 )

Posted

All answers are right. And if you have difficulties to mention all ranges in Case function (as offers Lee), then you might wanna use this one

Left ( your_number_field ; Length ( your_number_field ) - 1 )

One by dividing by 10 or any other way you'll find.

Posted

Why not

Int (theNumberField / 10 )

then? If it is a number then best to use a number function. But we do not know the range yet ... As you say, that consistency may not hold. :-)

Posted

Left ( your_number_field ; Length ( your_number_field ) - 1 )

This will break if there is a decimal.

Posted

All answers are right.

All answers are right, but some are more right than others... :getlost:

We don't know that the ranges follow a uniform pattern. It might be just a coincidence. More importantly, we don't know if the ranges themselves are data or not. If they are, then this should be a lookup, not a calculation.

Posted

Thanks for all the replies. I appreciate the help. The ranges represent growth in different performance metrics. The ranges will be numbers up to two decimal places (calculated from other fields). The breakdown will be less than or equal to 0, then 0 to 20, then 20 to 30, 30 to 40, 40 to 50, and then so on up to 100, where it will end in greater than or equal to 100. And you're right, there is not a consistent range per se. 

 

I chose Case just because of prior familiarity. I'm still a newbie with FileMaker. So if there is something better, I'm not exactly sure.

 

I'm just looking for a way to lighten my workload. :) Prior to this, I just entered the values myself, but on occasion during very busy times I may have missed an update.

 

Again, thanks for the help.

Posted

The ranges represent growth in different performance metrics.

 

 

I am afraid that doesn't tell me much.

 

 

Prior to this, I just entered the values myself, but on occasion during very busy times I may have missed an update.

 

 

An update of what exactly? This is a crucial point: do the ranges ever change or are they cast in stone? And if they do change, what is supposed to happen to the already existing numbers?

Posted

I am afraid that doesn't tell me much.

The performance metrics are metrics like net income growth, operating margin growth, etc. So, they will be in percentage form with two decimal places. The calculated field I am trying to come up with assigns a numerical value based on whatever particular range they fall into.

The ranges will be cast in stone.

Posted

Look at the example here

The case evaluates until it finds a correct answer, so your statement would be something like this.

Case( data >= 40; 4 ;data > 30; 3 ; data >= 20 ; 2; data >= 10 ; 1 ; data < 10 ; 0 )

Hey, just wanted to let you guys know I finally got around to and the method posted by Lee Smith is working like a charm. Thanks again!

This topic is 4448 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.