locked
how to detect nulls or non existing records in Matrix RRS feed

  • Question

  • hi,

    here i am using the matrix. there are some empty fields in the matrix after rendering the report. these empty fields needs to be displayed with some default values. these default values are different for each column ( Ex: default values for w1 - "15" , w2 - "25" , ..........) . how to get ths done using expressions in the report.?

    Dataset Column are Persons, Weeks, Amount.

    Here Rows - Persons , Columns - Weeks , Data - Amount.

    Thanks.

    Wednesday, February 15, 2012 7:51 AM

Answers

  • This expression should get you the results you want:

    =Iif(ISNOTHING(Fields!Amount.value)=True,
    Switch(Fields!Weeks.Value = "w1",15, Fields!Weeks.Value = "w2",25, Fields!Weeks.Value = "w3",35, Fields!Weeks.Value = "w4", 45),
    Fields!Amount.value)

    Cheers,

    Martina

    http://dataqueen.unlimitedviz.com/


    Martina White

    • Proposed as answer by Sharp Wang Friday, February 17, 2012 9:50 AM
    • Marked as answer by Sharp Wang Tuesday, March 6, 2012 2:36 PM
    Friday, February 17, 2012 2:39 AM

All replies

  • Hi,

    Try this in textbox expression

    =IIF(Fields!Weeks.Value = "w1" AND Fields!Amount.value IS NOTHING, 15,
        IIF(Fields!Weeks.Value = "w2" AND Fields!Amount.value IS NOTHING, 25,
            IIF(Fields!Weeks.Value = "w3" AND Fields!Amount.value IS NOTHING, 35,
                IIF(Fields!Weeks.Value = "w4" AND Fields!Amount.value IS NOTHING, 45, Fields!Amount.value))))


    Regards,

    Asim Bagwan

    Kindly mark the replies as Answers if they help!

    Wednesday, February 15, 2012 8:28 AM
  • hi Asim i tried the above expression but its not showing any replacements for nulls.

    Wednesday, February 15, 2012 10:07 AM
  • Hello,

    Follow the link below. It will help you on this.

    http://www.mredkj.com/vbnet/RSNullCheck.html

    http://stackoverflow.com/questions/835954/sql-2005-reporting-services-if-check-for-null

    Wednesday, February 15, 2012 10:13 AM
  • This expression should get you the results you want:

    =Iif(ISNOTHING(Fields!Amount.value)=True,
    Switch(Fields!Weeks.Value = "w1",15, Fields!Weeks.Value = "w2",25, Fields!Weeks.Value = "w3",35, Fields!Weeks.Value = "w4", 45),
    Fields!Amount.value)

    Cheers,

    Martina

    http://dataqueen.unlimitedviz.com/


    Martina White

    • Proposed as answer by Sharp Wang Friday, February 17, 2012 9:50 AM
    • Marked as answer by Sharp Wang Tuesday, March 6, 2012 2:36 PM
    Friday, February 17, 2012 2:39 AM
  • Hi,

    Try this expression in the textbox whereever you want the defalult value

    Eg

    =iif(isnothing(Fields!W1.value),15,Fields!W1.value)

    in W2 textbox

    =iif(isnothing(Fields!W2.value),25,Fields!W2.value)


    Mark this as answer if this post helps you.

    Friday, February 17, 2012 4:41 AM
  • there is no other textbox than week(column column grouped), so w1,w2,w3.... are values of week.

    Friday, February 17, 2012 6:46 AM