need expression for the field if there is no data

  • hello,

    how can I write an expression in the field which is a dollar amount value

    if there is a data in the database its showing the amount in the field if not its hiding the entire table

    how can I show the table if there is no dollar amount in the field like $0

    I tried this but its not working.

    Note: I used table for this...

    =iif(Fields!AMOUNT.Value) = 0 ,"$ 0",(Fields!AMOUNT.Value)

  • There are a couple of things that could be the problem. First, I'm not sure you've got the right format for your statement. Try this:

    =IIF(Fields!AMOUNT.Value = 0 ,"0", Fields!AMOUNT.Value)

    The problem could also be that you have NULLs instead of zeros, in which case you might try this:

    =IIF(Fields!AMOUNT.Value Is Nothing ,"0", Fields!AMOUNT.Value)

    I'm assuming here the field is formatted in the report as type C, so you shouldn't need the $ symbol in the IIF statement.

  • Thank you for the reply.

    I have a quick question in SSRS report, I am trying to use format percent in the expression for tablix

    how can I write an expression labor amount / fresh fruits + labor amount +small supplies * 100

    the problem here is based on type id we have to write expression

    for labor amount - 35

    fresh fruits- 34

    small supplies - 36

    Another thing in the report I am using the AMOUNT field for all these I did by filtering the table

    FormatPercent(Fields!AMOUNT.Value/Sum(Fields!AMOUNT.Value, "DataSet1"),0) -0- this is the example for format percent.

    Can you please tell me how to write an expression using =iif.

  • Is the formula

    ( labor amount / (fresh fruits + labor amount + small supplies) ) * 100

    Or

    ( ( labor amount / fresh fruits ) + labor amount + small supplies ) * 100

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply