dbaspot
Tags Register FAQ Calendar Search Today's Posts Mark Forums Read

CASE function - filemaker

This is a discussion on CASE function - filemaker ; 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 ...


Home > Database Forum > Other Databases > filemaker > CASE function

Reply

 

LinkBack Thread Tools Display Modes
  #1  
Old 11-14-2008, 12:42 PM
Database Bot
 
Join Date: Sep 2009
Posts: 1,236,254
Database Administrator is on a distinguished road
Default CASE function

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


Reply With Quote
  #2  
Old 11-14-2008, 01:43 PM
Database Bot
 
Join Date: Sep 2009
Posts: 1,236,254
Database Administrator is on a distinguished road
Default Re: CASE functionX-Trace

On 2008-11-14 08:42:51 -0800, "sovageorge@gmail.com"
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

Reply With Quote
Reply

Thread Tools
Display Modes



All times are GMT -4. The time now is 08:09 AM.