Welcome to dbForumz.com!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

CASE function

 
   Database Forums (Home) -> FileMaker RSS
Next:  Using the Me.RecordSource Command  
Author Message
sovageorge

External


Since: Nov 26, 2007
Posts: 8



(Msg. 1) Posted: Fri Nov 14, 2008 8:42 am
Post subject: CASE function
Archived from groups: comp>databases>filemaker (more info?)

I have a trouble of expressing a condition within the CASE statement
when a test result should be between two values. Within a pricing
table for financial assets where an asset can have several prices, I
am to select one price when the ratio between the highest and the
lowest price is let's say between 3% and 10% and another price when
the ratio is more than 10%. I compute ratios separately and store them
in separate fields, named highlow

A statement(highlow >3 xor highlow<10) does not select the right price
neither a statement (highlow >3<10). Both statements are accepted by
the CASE formula.

What am I doing wrong? Is there another approach?

I would appreciate any help

 >> Stay informed about: CASE function 
Back to top
Login to vote
Lynn Allen

External


Since: Aug 13, 2007
Posts: 47



(Msg. 2) Posted: Fri Nov 14, 2008 9:43 am
Post subject: Re: CASE function [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On 2008-11-14 08:42:51 -0800, " "
said:

> I have a trouble of expressing a condition within the CASE statement
> when a test result should be between two values. Within a pricing
> table for financial assets where an asset can have several prices, I
> am to select one price when the ratio between the highest and the
> lowest price is let's say between 3% and 10% and another price when
> the ratio is more than 10%. I compute ratios separately and store them
> in separate fields, named highlow
>
> A statement(highlow >3 xor highlow<10) does not select the right price
> neither a statement (highlow >3<10). Both statements are accepted by
> the CASE formula.

I wouldn't use xor. In fact, I've *never* used xor. Perhaps that's just
my mathematical inadequacy showing.

Case( highlow > 3 and highlow < 10, Result1, DefaultResult)

should work, since you want to select between the two highlow values.

However, if you have different results below 3 and greater than 10, I'd
write it like this:

Case(

highlow =< 3, Result 1;

highlow > 3 and highlow < 10, Result2,

DefaultResult)

Maybe highlow can never be less than 3, in which case the first calc will work.

Case statements always return the first true result, so order of
arguments matters.


--
Lynn Allen
--
www.semiotics.com
Member Filemaker Business Alliance
Long Beach, CA

 >> Stay informed about: CASE function 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
Case or If/Else - How do I know when to use the "Case" script steps as opposed to the "If/Else" script steps? I have experimented with both and seem to have more success with "Case" but don't know when each is indicated.

case question - i am trying to write a calc field (number) 'wewk' which depends on the values in two fields (daynum, term) so here's what I did more or less wewk = case ( daynum = 1 & term =1; 8; daynum = 7 & term =1; 8 ; 2=<daynum<=6 & term=1; 9) i...

Case problem - I have a calculation field that reads Due_Date = Shipped_Date + Terms. If there is no Shipped_Date I get a default of 00 December 00 - (very inelegant). The solution it seems is to write a Case wherein the calculation is contingent on a Shipped_Date bein...

Case script - FM 8.5 PRO I want to design an Excel styled sheet in Filemaker I have a bike business with 9 styles(1, 2,3,4,...) in a range of colours (a,b,c,d,...). I want to be able to see at a glance the colours and styles in production. The production is based off...

Can filemaker differentiate a different case? - Hi I am new to filemaker pro and trying just starting to create fields in a database. My raw data referes to a dimension on a drawing on one side its 'd' and the other its 'D'. Is there a way filemaker can tell the difference between d and D or do I nee...
   Database Forums (Home) -> FileMaker All times are: Pacific Time (US & Canada)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]