Leb i Sol Posted March 31, 2004 Posted March 31, 2004 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
-Queue- Posted March 31, 2004 Posted March 31, 2004 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.
Leb i Sol Posted March 31, 2004 Author Posted March 31, 2004 Hi Queue! Thanx for post...but I am still having trubles...your sample works only if the result is "zero" 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!!!
-Queue- Posted March 31, 2004 Posted March 31, 2004 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" )
Leb i Sol Posted March 31, 2004 Author Posted March 31, 2004 Oh great! Thank you very much! I knew I was close in logic...it was the synthax that "got me" Excellent!
-Queue- Posted March 31, 2004 Posted March 31, 2004 By the way, you can use the Choose function above, just add Sign( ) around cPaymentNeeded.
Recommended Posts
This topic is 7910 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 accountSign in
Already have an account? Sign in here.
Sign In Now