IIF Expression

John Kelly 146 Reputation points
2022-11-03T12:00:23.797+00:00

Hi

I have a simple expression =Sum(Fields!Charge_Value.Value) that returns a lot of empty fields in the report as shown

256765-expression-preview.png

If the field is empty i want to populate this with 0.00 and have tried multiple variations of IIF in the existing expression but these are still blank and keep getting #ERROR values place of the current values.

Can anyone help with this expression

Many thanks

John

SQL Server Reporting Services
SQL Server Reporting Services
A SQL Server technology that supports the creation, management, and delivery of both traditional, paper-oriented reports and interactive, web-based reports.
2,854 questions
0 comments No comments
{count} votes

Accepted answer
  1. Joyzhao-MSFT 15,571 Reputation points
    2022-11-04T02:00:34.33+00:00

    Hi @John Kelly ,
    Please try:

    =IIF(IsNothing(Fields!Charge_Value.Value),0,Sum(Fields!Charge_Value.Value))  
    

    Here is my test:
    Design:

    257061-01.png

    Preview:

    257044-02.png
    Best Regards,
    Joy


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


1 additional answer

Sort by: Most helpful
  1. John Kelly 146 Reputation points
    2022-11-03T14:19:38.977+00:00

    Solution found:

    =IIF(Fields!Charge_Value.Value < 1,0,Sum(Fields!Charge_Value.Value))

    I think my problem was i was trying to use is null or ISNOTHING or " " in the expression

    0 comments No comments