Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

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

Recommended Posts

Posted

thanks so much

Sorry it did not work

 

Example if I have the number 7 I need it to return 6

If I have the number 8 I need it to return 6

Posted (edited)
48 minutes ago, indy4300 said:

I need a calculation
Odd number -1
if even number - 2

That's not very clear, Please spend more time formulating your request, so we don't have to guess.

Based on:

18 minutes ago, indy4300 said:

my number field input is 7

I am getting a return of 1

I need it to be 6 ( as above )

I am guessing you want to do:

Number - Choose ( Mod ( Number ; 2 ) ; 2 ; 1 )

Or, if you prefer:

Number - 2 + Mod ( Number ; 2 )

Or even:

2 * Div ( Number - 1 ; 2 )

 

Edited by comment
Posted

I am not sure how I can explain this any better Please explian what you are guessing at I just dont know how to explain it any better

Odd number -1
if even number - 2

Calculated Input number 7 I need it to return 6

Calculated Input number 8 I need it to return 6

 

Number - Choose ( Mod ( Number ; 2 ) ; 2 ; 1 )
calculated field input Number is 7 - Choose ( Mod ( calculated field input Number is 7  ; 2 ) ; 2 ; 1 )
Return number is 4

Number - 2 +  Mod ( Number ; 2 )
calculated field input Number is 7  - 2 +  Mod ( calculated field input Number is 7  ; 2 )
Return number is 4


 

 

Posted (edited)
46 minutes ago, indy4300 said:

I am not sure how I can explain this any better

That's actually very simple: (a) use full sentences; (b) explain the rule first, then give some examples. When explaining the rule, provide step-by step instructions how would one do the calculation manually. For example: if the given number is odd, subtract 2 from the given number; if it's even, subtract 1 (and then I would ask what if the given number is not an integer).

 

46 minutes ago, indy4300 said:

Number - Choose ( Mod ( Number ; 2 ) ; 2 ; 1 )
calculated field input Number is 7 - Choose ( Mod ( calculated field input Number is 7  ; 2 ) ; 2 ; 1 )
Return number is 4

Number - 2 +  Mod ( Number ; 2 )
calculated field input Number is 7  - 2 +  Mod ( calculated field input Number is 7  ; 2 )
Return number is 4

When Number is 7, both:

Number - Choose ( Mod ( Number ; 2 ) ; 2 ; 1 )

and:

Number - 2 +  Mod ( Number ; 2 )

return 6, not 4 as you claim (that is if I understand you correctly: I am not sure what exactly you mean by "calculated field input Number").

 

Edited by comment
Posted

comment gave the short version on how to post a good topic, Please read this for the full one Anatomy of a Good Topic

BTW, the three calculations by comment provided the correct answer to your question.

This topic is 3163 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.