Jump to content
  • 0
Sign in to follow this  
ktitler

Formula Error

Question

Hello,

 

I am trying to add a formula to my table, and I keep getting the following error: "Unable to save table due to incompatible values in one or more formula fields."

Formula:

([@field:Elig_Reg_Riders]+[@field:Elig_Spec_Need_Riders])/([@field:Regular_Runs]+[@field:SPED_Runs])

All four of the fields have Number DataType, so I am not sure why I am getting this error. Can you please help?

Share this post


Link to post
Share on other sites

2 answers to this question

Recommended Posts

  • 0

Make sure you are not getting 0 by this statement:  ([@field:Regular_Runs]+[@field:SPED_Runs])  as division by 0 is not allowed. Try to change your formula to :

 

([@field:Elig_Reg_Riders]+[@field:Elig_Spec_Need_Riders])/(CASE WHEN ([@field:Regular_Runs]+[@field:SPED_Runs])  = 0 THEN 1 ELSE  ([@field:Regular_Runs]+[@field:SPED_Runs])  END)

 

Share this post


Link to post
Share on other sites
  • 0

Hi there, that's correct. the reason why it's returning an error is if you have 0 on the division. You can just add a NULLIF to your statement. 

 

You can use this formula:

([@field:Elig_Reg_Riders]+[@field:Elig_Spec_Need_Riders])/NULLIF(([@field:Regular_Runs]+[@field:SPED_Runs]),0)

 

Let me know if this works.

Share this post


Link to post
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.

Guest
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.

Loading...
Sign in to follow this  

×
×
  • Create New...