locked
=SUM with IFF RRS feed

  • Question

  • I have a simple =sum(Fields!something.Value) that brings back NaN.

    I'm thinging this is a null value but I try to add IIF(Fields!something.value = "NULL",0) but id SSRS doesn't like the syntax

    How should I format =sum(Fields!something.Value) to acount for NULL values?

    Wednesday, October 3, 2012 7:14 PM

Answers

  • Unwind_1, just paste your actual expression that you use here, so someone could take a look and point you to the right direction.
    • Marked as answer by Unwind_1 Thursday, October 4, 2012 4:55 PM
    Thursday, October 4, 2012 3:30 PM

All replies

  • Hi There

    Thanks for your posting. You can try something like this, that might resolve your problem

    =sum(iif(Fields!something.Value is nothing,0, Fields!something.Value))

    =sum(iif(Fields!something.Value is nothing,0, Fields!something.Value))

    Many Thanks

    Syed Qazafi Anjum

    Please click "Mark as Answer" if this resolves your problem or "Vote as Helpful" if you find it helpful

    Wednesday, October 3, 2012 8:31 PM
  • thank you, the sytax works but the NaN is still displaying.

    Thursday, October 4, 2012 2:38 PM
  • Is that possible to 'fix' that in T-SQL by using COALESCE function... SELECT COALESCE(col,0) as name FROM tbl

    Best Regards,Uri Dimant SQL Server MVP, http://sqlblog.com/blogs/uri_dimant/

    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Blog: Large scale of database and data cleansing
    MS SQL Consultants: Improves MS SQL Database Performance

    Thursday, October 4, 2012 2:46 PM
  • Hi,

    This is most probably Divide by zero  for more detail vist this Link for “#ERROR”,N/A



    blog:My Blog/

    Hope this will help you !!!
    Sanjeewan

    Thursday, October 4, 2012 2:52 PM
  • Unwind_1, just paste your actual expression that you use here, so someone could take a look and point you to the right direction.
    • Marked as answer by Unwind_1 Thursday, October 4, 2012 4:55 PM
    Thursday, October 4, 2012 3:30 PM
  • Hi Unwind_1,

    I am experiencing the same issue please let me know how you resolved the NaN issue

    Thursday, October 4, 2012 7:38 PM
  • Hi Sanjay

    Can you please provide us your current expression so that some one could help you out

    Many thanks

    Syed Qazafi Anjum

    Thursday, October 4, 2012 7:40 PM