Jump to content
  • 0
NikkiC

Calculated field error message

Question

Hi there,

I have a formula that is working fine in most instances, but it falls down every once in a while.  I think I've got it figured out and then it falls down again!

This is my code

IsNull((SELECT sum(IsNull([@field:Optimiser_RatingX],0)+IsNull([@field:QA_Tester_RatingX],0)) FROM Card_comments_and_updates WHERE User_ID=[@field:Analyst_IDX])/((SELECT COUNT(IsNull([@field:Optimiser_RatingX],0)) FROM Card_comments_and_updates WHERE IsNull([@field:Optimiser_RatingX],0) >0  AND User_ID=[@field:Analyst_IDX])+(SELECT COUNT(IsNull([@field:QA_Tester_RatingX],0)) FROM Card_comments_and_updates WHERE IsNull([@field:QA_Tester_RatingX],0) >0 AND User_ID=[@field:Analyst_IDX])),0)

I want it to display zero if it can't calculate anything!

Basically my datapage displays all my users along with an average of all the star ratings they have.  The calculated field looks in a different table for every instance where the user ID in this table is listed in the Analyst column.  Then it checks the 2 different fields where ratings are given (QA Tester Rating and Optimiser rating) for values more than 0.  Adds them together and then divides them by the count, thereby giving the average.  For the most part it works fine ... EXCEPT where there are fields where either the QA Tester Rating or Optimiser Rating are zero.

Help!

Many thanks

Nikki

Share this post


Link to post
Share on other sites

1 answer to this question

Recommended Posts

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

×
×
  • Create New...