Jump to content
  • 0

Case Statement in Formula of Table



Hello All,


I am stumped. I have the following case statement in a formula field and it verifys.

WHEN [@field:SMNType] = 1 THEN 'l1q1.html?XBSPropertyID=' + [@field:SMNPropertyID] + '&;VRRYear' + [@field:SMNYear]
WHEN [@field:SMNType] = 2 THEN 'l1q2.html?XBSPropertyID=' + [@field:SMNPropertyID] + '&;VRRYear' + [@field:SMNYear]
WHEN [@field:SMNType] = 3 THEN 'l1q3.html?XBSPropertyID=' + [@field:SMNPropertyID] + '&;VRRYear' + [@field:SMNYear]
WHEN [@field:SMNType] = 4 THEN 'l1q4.html?XBSPropertyID=' + [@field:SMNPropertyID] + '&;VRRYear' + [@field:SMNYear]
WHEN [@field:SMNType] = 8 THEN 'b1.html'




However, when I try to save the table I get Unable to save table due tto incompatible values in one or more formula fields.



Link to comment
Share on other sites

6 answers to this question

Recommended Posts

  • 0
14 hours ago, Meekeee said:

Hi @RobDunbar - what are the Data types of [@field:SMNType]  [@field:SMNPropertyID] and [@field:SMNYear]?

Agree with @Meekeee. You need to check what are the Data types of your fields to make sure that it is compatible when you will try to concatenate or add it. If they have different Data types, you can try to convert them all as one Data type.

Link to comment
Share on other sites

  • 0

Hello, @RobDunbar, could you please try this formula if this will work? 

WHEN [@field:SMNType]= 1 
THEN 'l1q1.html?XBSPropertyID=' + CONVERT(VARCHAR,[@field:SMNPropertyID]) + '&;VRRYear' + CONVERT(VARCHAR,[@field:SMNYear])
WHEN [@field:SMNType]= 2
THEN 'l1q2.html?XBSPropertyID=' + CONVERT(VARCHAR,[@field:SMNPropertyID]) + '&;VRRYear' + CONVERT(VARCHAR,[@field:SMNYear])
WHEN [@field:SMNType]= 3
THEN 'l1q3.html?XBSPropertyID=' + CONVERT(VARCHAR,[@field:SMNPropertyID]) + '&;VRRYear' + CONVERT(VARCHAR,[[@field:SMNYear])

Since you your fields are all Integer DataTypes, and you're concatenating it to a String, you need to convert the Integer fields into a String as well. 

I hope this helps! ;)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...