unusual calculation

5 messages Options
Embed this post
Permalink
sarah dawson

unusual calculation

Reply Threaded More More options
Print post
Permalink
Hi
Thanks in advance for any help i can get

i have a number of records with text in the answer stem field (AnsText) that would be values such as
 =>50
<50
else

Else is always the last one in the set but the numbers could be different

i have a variable value set elsewhere in the system $$Value and need to identify which record from the above 3 is correct so it then captures the contents from another field in the chosen record (NextStep)

i've tried doing a calculation $$Value & AnsText setting a new field calculation answer to true if correct

Case ( $$Value & TriageLogic::AnsText;"true";"" )  but this isnt working
any ideas please

sarah
Damian Kelly

Re: unusual calculation

Reply Threaded More More options
Print post
Permalink
Evaluate is your friend :-)

Evaluate ("Case ( $$Value" & TriageLogic::AnsText & ";/"true/";/"/" )")

That is still going to require a little finessing but its kind of  
where i think you ought to be heading

damian

On 6 Nov 2009, at 14:56, sarah dawson wrote:

>
> Hi
> Thanks in advance for any help i can get
>
> i have a number of records with text in the answer stem field  
> (AnsText) that
> would be values such as
> =>50
> <50
> else
>
> Else is always the last one in the set but the numbers could be  
> different
>
> i have a variable value set elsewhere in the system $$Value and need  
> to
> identify which record from the above 3 is correct so it then  
> captures the
> contents from another field in the chosen record (NextStep)
>
> i've tried doing a calculation $$Value & AnsText setting a new field
> calculation answer to true if correct
>
> Case ( $$Value & TriageLogic::AnsText;"true";"" )  but this isnt  
> working
> any ideas please
>
> sarah
>
> --
> View this message in context: http://n4.nabble.com/unusual-calculation-tp547788p547788.html
> Sent from the FMPExperts mailing list archive at Nabble.com.
> _______________________________________________
> FMPexperts mailing list
> [hidden email]
> http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au

_______________________________________________
FMPexperts mailing list
[hidden email]
http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au
sarah dawson

Re: unusual calculation

Reply Threaded More More options
Print post
Permalink
In reply to this post by sarah dawson
HI

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

Thanks in anticipation
dwdc

Re: unusual calculation

Reply Threaded More More options
Print post
Permalink
On Nov 10, 2009, at 1:49 AM, sarah dawson wrote:

> 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

I have some ideas but your explanation is a bit fuzzy.

Will a "Case()" work?

Case(
$$Value =< 50; "=<50";
$$Value > 50; ">50";
"other")

In the "Case()" each test (line) is evaluated in order until one is  
satisfied. If there is no test satisfied it uses the default (other).

If I am way off, feel free to mock up a file with some sample content,  
describe in more detail what you need, and send it to me, PRIVATELY.

Don Wieland
D W   D a t a   C o n c e p t s
~~~~~~~~~~~~~~~~~~~~~~~~~
[hidden email]
Direct Line - (949) 305-2771

Integrated data solutions to fit your business needs.

Need assistance in dialing in your FileMaker solution? Check out our  
Developer Support Plan at:
http://www.dwdataconcepts.com/DevSup.html

Appointment 1.0v9 - Powerful Appointment Scheduling for FileMaker Pro  
9 or higher
http://www.appointment10.com

For a quick overview -
http://www.appointment10.com/Appt10_Promo/Overview.html

_______________________________________________
FMPexperts mailing list
[hidden email]
http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au
Darren Terry-3

Re: unusual calculation

Reply Threaded More More options
Print post
Permalink
In reply to this post by sarah dawson

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