Jump to content

Goofy Case Calculation


pryjda
 Share

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

Recommended Posts

I'm always comeing here for advice. THis is by far the best FileMaker Forum anywhere.

Any advice would be appreciated. I am tying to figure this problem out.

First of all, It seems FM doesn't like my calculation.

Case (

ROCPG3 ≥ 001 and ≤ 029 ;category ID = 40;

ROCPG3 ≥ 030 and ≤ 032 ;category ID = 41;

ROCPG3 ≥ 033 and ≤ 040 ;category ID = 42;

ROCPG3 ≥ 041 and ≤ 044 ;category ID = 44;

ROCPG3 ≥ 045 and ≤ 050 ;category ID = 45;

"n/a" // default value

)

Next, i was wondering if it is possible to contain in the same calculation, set a 3rd field (category ID Name) to display a value from a defined list based on the value calculated above.

In other words if the value is 40 change name to "xx172", if the value is 41 change name to "xxxB", ...

Is this possible or should i create a second case statement on the 3rd field?

Thanks to everyone for viewing my post and any guidance is helpful.

Thanks

Link to comment
Share on other sites

Lol, good work sucking up ;) Just kidding, I Love these forums too :)

On to the question

Case (

ROCPG3 ≥ 001 and ≤ 029 ;category ID = 40;

ROCPG3 ≥ 030 and ≤ 032 ;category ID = 41;

ROCPG3 ≥ 033 and ≤ 040 ;category ID = 42;

ROCPG3 ≥ 041 and ≤ 044 ;category ID = 44;

ROCPG3 ≥ 045 and ≤ 050 ;category ID = 45;

"n/a" // default value

)

2 Things wrong with the above:

1) You have reference the field for both the greater than and less than statements

2) You shouldn't be referencing the field in second portion

e.g.

Case (

ROCPG3 ≥ 001 and ROCPG3 ≤ 029 ; 40;

ROCPG3 ≥ 030 and ROCPG3 ≤ 032 ; 41;

.etc

.etc

.etc

)

Secondly... yes, just make your 3rd field either an auto-enter calc or a basic calc (depends if you want the field to be editable) and use a case statement based on the second field... then you get a little daisy chain effect

Field 1 Edited

Updates Field 2 (References Field 1)

Which in turn updates field 3 (References Field 2)i

Link to comment
Share on other sites

Thanks GenX,

in fact i just figured out i needed to list my ROCPG field name twice in each line while i was waiting for a response but thanks for listening.

Also thanks for the advice on the second calculation.

I appreciate your help.

as for the sucking up bit, ya gotta

Chirstmas is just around the corner.

Excuse me if i sound a little too mushy

pryjda

Link to comment
Share on other sites

i just figured out i needed to list my ROCPG field name twice in each line

Actually, you don't. Something like this should produce a similar result:

Case (

ROCPG3 < 30 ; 40 ;

ROCPG3 < 33 ; 41 ;

ROCPG3 < 41 ; 42 ;

ROCPG3 < 45 ; 44 ;

ROCPG3 < 51 ; 45 ;

"n/a" )

Also note that [color:blue]ROCPG3 < 30 is the same as [color:blue]ROCPG3 < 030, but NOT the same as [color:blue]ROCPG3 < "030". The first two use a numeric comparison, the last one is a text comparison.

Link to comment
Share on other sites

This topic is 5796 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
 Share

×
×
  • Create New...

Important Information

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