Jump to content

what's wrong with that case


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

Recommended Posts

Case(

mod(char1+8;26)=1, dsd_code = dsd_code & "A",

mod(char1+8;26)=2, dsd_code = dsd_code & "B",

)

I have to do a calculation to know what letter correspond to the number... I get the "an operator (e.g. +, -, ...) is expected here" message... why!?

I also tried multiple if, like:

If( Mod( char1 + 8 ; 26 )=1 ; dsd_code & "A"; "")

If( Mod( char1 + 8 ; 26 )=2 ; dsd_code & "B"; "")

If( Mod( char1 + 8 ; 26 )=3 ; dsd_code & "C"; "")

I get the same error... anyone can help to go through that step?!?

Link to comment
Share on other sites

Case(

mod(char1+8;26)=1, dsd_code = dsd_code & "A",

mod(char1+8;26)=2, dsd_code = dsd_code & "B",

)

I have to do a calculation to know what letter correspond to the number... I get the "an operator (e.g. +, -, ...) is expected here" message... why!?

I also tried multiple if, like:

If( Mod( char1 + 8 ; 26 )=1 ; dsd_code & "A"; "")

If( Mod( char1 + 8 ; 26 )=2 ; dsd_code & "B"; "")

If( Mod( char1 + 8 ; 26 )=3 ; dsd_code & "C"; "")

I get the same error... anyone can help to go through that step?!?

Link to comment
Share on other sites

Case(

mod(char1+8;26)=1, dsd_code & "A",

mod(char1+8;26)=2, dsd_code & "B",

)

The syntax for Case is

Case ( test1, result1, test2, result2,...)

The result dsd_code = dsd_code & "A" is not really a result; the "dsd_code = dsd_code" is really a test.

Part of the problem is that you have not told us what the calculation field's name is. A calculation field cannot modify another field, so I have to assume that the field is dsd_code. In this case the expression should be

Case(

mod(char1+8;26)=1, dsd_code & "A",

mod(char1+8;26)=2, dsd_code & "B"

)

There should be no comma after the last expression.

Link to comment
Share on other sites

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