March 5, 201411 yr 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....
March 5, 201411 yr 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.
March 5, 201411 yr 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,
March 5, 201411 yr Before I could post a reply, comment made one similar to what I was going to say, What else is new?
Create an account or sign in to comment