Jump to content
Server Maintenance This Week. ×

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

Recommended Posts

  • Newbies

I am sorry if this is the incorrect forum to post my query to but I am very new to this and am about to throw my machine out of the window...but before I do I thought I would ask the question:

 

I am writing an If Statement and need help! I want to say that If a field has a value greater than 1000 but less than 5000 then give a certain result. EG:

 

If ( Donations::sum pound ≥ "1000"  and ≤ "5000" ; "Grade 2 contributor" ; "Grade 1 contributor" )

 

with the calculation result being set to 'text'.

 

I am trying to do a database for a charity I work for, and they want to grade their contributors depending on how much they have given, but this is really, really and I mean really baffling me as I keep getting an error as soon as I try to save the calculation and it highlights the (less than or equal to) symbol. I think it is something to do with me using the 'and'???

 

There are actually 5 different grades of contribution so I was planning on just doing a set of If statements within each other but I simply cant get this 'greater than but less than' bit right!!!

 

Please, please and I can't stress enough pleases, can someone from this forum take pity on me and offer an answer! Thank you sooooo much....

Link to comment
Share on other sites

I want to say that If a field has a value greater than 1000 but less than 5000 then give a certain result.

 

That could be written as =

If ( field > 1000  and  field < 5000 ; "certain result" )

Note that if you write =

If ( field > 1000  and  field < 5000 ; "certain result" ; "other result")

then "other result" will be returned for both field ≤ 1000 and field ≥ 5000 - which is not likely what you want.

 

 

There are actually 5 different grades of contribution so I was planning on just doing a set of If statements within each other

 

Then you definitely want to use the Case() function instead of "a set of If statements". For example =

Case (
field > 10000 ; "word-class benefactor" ;
field > 5000 ; "super contributor" ;
field > 2500 ; "generous person" ;
field > 1000 ; "pulls his weight" ;
"eh"
)

Note that the order of arguments is important: the function will return the result of the first test that evaluates as true.

Link to comment
Share on other sites

Hi filemakmovice, and welcome to the forum,

 

I moved your topic from "Managing Scripts" to "Calculation Engine (Define Fields)”, because it doesn’t have anything to do with a script.

 

Before I could post a reply, comment made one similar to what I was going to say,

Link to comment
Share on other sites

This topic is 3703 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.