freecolours Posted June 21, 2004 Posted June 21, 2004 This is a real brain cracker for me, but I'm sure there's a way out of here.. I have a numberfield with a number, say '7'. Users can change this number with a scipt to another number (no decimals). I need to make a calculationfield that will give a (whatever) result when the new number is not a multiplication of the original number (7). So when number '19' is entered, I should have a result, but when '21' is entered, the calculationfield needs to be empty. I was thinking in the direction of ranges in a globalfield, and then check the field with a PatternCount calculation, but the developmentscript took too long to make a broad range of numbers, and it's also a 'limited' solution. Anyone.....?
-Queue- Posted June 21, 2004 Posted June 21, 2004 I'm not sure if I understand correctly, but here goes... In your script, set another number field (oldnumber) equal to the current number, before it's modified. Create a calculation field of Case( Mod(numberfield, oldnumber), calculation_for_result ). Is this what you're attempting to do?
freecolours Posted June 22, 2004 Author Posted June 22, 2004 Queue, thanks for thinking along! I allready have the 'root' number (7) in a separate field. The new number is set in a -so called- 'trigger'field (exit this field and a script will run, OZ Events plugin). But what I need to know is Case(numberfield = multiplication from rootnumber , "OK" , "") I hope I've clearified my question by this.....
-Queue- Posted June 22, 2004 Posted June 22, 2004 You don't really need the > 0; if it's 0, the result will be false. Nor do you need the null result. If the test is false and the number is divisible by 7, then you won't get a result anyway. So Paul and I gave the same result; mine is just simplified a bit.
Oldfogey Posted June 25, 2004 Posted June 25, 2004 I just hadn't read your stuff properly. Yours is not only simpler it's better. Mine did not take into account the possibility of negative Mods.
Recommended Posts
This topic is 7526 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