AnsweredAssumed Answered

Finding Difference Value Between Two Fields

Question asked by RedFile on Feb 6, 2012
Latest reply on Feb 7, 2012 by RedFile

Title

Finding Difference Value Between Two Fields

Post

I have a project where up to six people rate a product between 0.1 to 5.0. The script is very repetitive (too long to put here) and performs inconsistently in Filemaker 7 and I cannot afford to upgrade. The Perform button in the Define Script window performs slightly differently than if I run the SAME script from my project button. My Filemaker scripting knowledge is limited, so the obvious may need to be stated.

The object of the script is to find two votes in the group of up to six that differ more than 1 point and give a result in a message field that asks anyone who is outside the range of most voters to "challenge" the other voters.

I used the IsValid and IsEmpty functions to determine which field votes to include called "Voter1 Ave", "Voter2 Ave",…

I have isolated the problem to be in the following script, which I just don't see, but I am sure it will be easy for someone else. I thought it would be a space or parentheses -- not much difference when I change them. I have tried placing parentheses in different places, but the script still jumps around. This script finds votes outside the mode of the other voters when Voters 1,2,3 and 6 are voting and 4 and 5 are blank.

IsValid ( Products::Voter1 Ave ) and IsValid ( Products::Voter2 Ave ) and IsValid ( Products::Voter3 Ave ) and

IsEmpty ( Products::Voter4 Ave ) and IsEmpty ( Products::Voter5 Ave ) and IsValid ( Products::Voter6 Ave ) and

((Products::Voter1 Ave - Products::Voter2 Ave) > 1 or  (Products::Voter1 Ave - Products::Voter2 Ave) < -1 or
(Products::Voter1 Ave - Products::Voter3 Ave) > 1 or  (Products::Voter1 Ave - Products::Voter3 Ave) < -1 or
(Products::Voter1 Ave - Products::Voter6 Ave) > 1 or  (Products::Voter1 Ave - Products::Voter6 Ave) < -1 or
(Products::Voter2 Ave - Products::Voter3 Ave) > 1 or  (Products::Voter2 Ave - Products::Voter3 Ave) < -1 or
(Products::Voter2 Ave - Products::Voter6 Ave) > 1 or  (Products::Voter2 Ave - Products::Voter6 Ave) < -1 or
(Products::Voter3 Ave - Products::Voter6 Ave) > 1 or  (Products::Voter3 Ave - Products::Voter6 Ave) < -1)

Insert Text (Select; Products::VoterResult; "1,2,3 and 6 Meet"

Perform Script ["Voter Challenge"] .....

Outcomes