On Nov 10, 2009, at 1:49 AM, sarah dawson wrote:
> I dont think i explained it properly
>
> The $$Value is an actual age of the person so would be a number (51)
> entered
> by the user, whereas the text that is in the TriageLogic::AnsText is
> a range
> such as =<50 but there will be more than one to evaluate, though
> each are
> held in a separate record so i can use the next command to go
> through each
> one
>
> I need to find a way to evaluate the expression when the two are put
> together 51=<50 because I want the system to then select the record
> that is
> true and correct and ignore the ones that don’t
>
> Most of these have 3 records in a given set, the last one is always
> 'else'
> so I need to evaluate for example
>
> 51=<50
> 51>50
> 51else
Hi Sarah:
Does the "else" option mean the same as "If the first 2 are both
false, then default to the Else condition"? If so, then you don't
need to worry about evaluating that third option -- it's just the
default value.
How are the 3 records with the AnsText field related? I'm assuming
there's some key field that relates those 3 records to each other
(some "Answer ID" or something that is the same for all three
records), no? If not, you need one. You also need a unique serial
number field as well.
Then you need a self-join relationship where:
Answer ID = Self Join::Answer ID
AND
Unique Serial ≠ Self Join:: Unique Serial
(that's the "not equal" sign in the second predicate of that
relationship). This relationship allows each of the 3 records to see
the other 2 records for the same "question", without seeing itself.
Then, the calculation for Answer Field goes like this:
Case ( TriageLogic::AnsText = "else" and PatternCount ( List ( Self
Join::Answer Field ) ; "true" ) = 0 ; "true" ;
// The above test says: if we're on the "Else" record and none of the
other answers for this question result in "true", then this one is true.
Evaluate ( "Case ( $$Value" & TriageLogic::AnsText &
"; /"true/" ; /"/" )" )
// otherwise, we're not on the "else" record; evaluate the expression
to determine whether it's true or not
)
That should accomplish what you're trying to do, I think. You might
need to monkey around with the Evaluate expression -- I just copied
Damian's formula without testing it. You might need a Quote function
in there, not sure. But I think the above is the way to go.
regards,
Darren
******************************
Darren Terry
[hidden email]
Pacific Data Management, Inc.
http://www.pdm-inc.com/ 111 W. St. John St. Phone: (408) 283-5900 x303
Suite 404 Fax: (408) 283-5903
San Jose, CA 95113
***** FileMaker 10 Certified Developer *****
_______________________________________________
FMPexperts mailing list
[hidden email]
http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au