Jump to content

Calculation field - Case function or IF?


This topic is 7322 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Hello Gurus!

I am bit stuck with attempting to use the calcualtion field along with Case function so some help would be really apprechiated

scenario:

c_PaymentNeed can be: 1 or -1 or 0 (zero)

I would like to reflect this output with text.

I have created another calculation field that uses Case statement as:


c_PaiedInfo = Case(c_PaymentNeeded,0,"INVOICE PAIED IN FULL",c_PaymentNeeded, "> 0","PENDING - NOT PAIED",c_PaymentNeeded, "< 0","OVERCHARGED")

The logic is:

IF

'c_PaymentNeeded' is 'zero' THEN output "PAIED IN FULL"

ELSE

'c_PaymentNeeded' is 'positive number' THEN output "NOT PAIED in FULL"

ELSE

'c_PaymentNeeded' is 'negative number' THEN output "WE OverCharged You"

ENDIF

Should I be looking into direction of "IF" statements or can a Case handle it?

Many thanx for the feedaback!

FileMaker Version: 6

Platform: Windows 2000

Link to comment
Share on other sites

You could use a Case or

Choose( cPaymentNeeded + 1, "WE Overcharged You", "PAID IN FULL", "NOT PAID IN FULL" )

since cPaymentNeeded + 1 will equal 0, 1, or 2.

Link to comment
Share on other sites

Hi Queue!

Thanx for post...but I am still having trubles...your sample works only if the result is "zero" frown.gif and would not work if the actuall cPaymentNeeded is =1

cPaymentNeeded can be:

-$250.00 ............WE overcharged You

$1.00 ..............Not paied in Full

$0.00 ..............Paied in Full

I know we are talking only 1 dollar diff. but ont 1,000 of records....

what went wrong in that Case statement I used above?....is the synthax correct?

Thanx!!!

Link to comment
Share on other sites

Oh, my bad. I thought you meant the field could be -1, 0, or 1. You meant positive or negative.

Try changing your Case to

Case( c_PaymentNeeded = 0, "INVOICE PAID IN FULL", c_PaymentNeeded > 0, "PENDING - NOT PAID", c_PaymentNeeded < 0, "OVERCHARGED" )

Link to comment
Share on other sites

This topic is 7322 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.