Need to filter data in Tablix

Ali Ahad 131 Reputation points
2024-03-08T17:39:51.67+00:00

I have created a tablix where I need to filter the data, I have used the following expression in the Tablix properties and I am not getting the expected results

 

IIf(IsNothing(field1.Value) OR IsNothing(field2.Value), 1, 0)

The above formula is displaying if both fields are 'NULL'. I need to only filter if one is null or the other.

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,935 questions
{count} votes

Accepted answer
  1. ZoeHui-MSFT 37,221 Reputation points
    2024-03-11T03:07:05.37+00:00

    Hi @Ali Ahad,

    Please try with switch expression.

    =switch(isnothing(Fields!name.Value) and isnothing(Fields!address.Value),"0",
    isnothing(Fields!name.Value)="False" and isnothing(Fields!address.Value)="False","0",
    isnothing(Fields!name.Value),"1",isnothing(Fields!address.Value),"1")
    
    

    User's image

    Actually, I'd like to suggest that you may filter the data in your dataset to make it easier.

    Regards,

    Zoe Hui


    If the answer is helpful, please click "Accept Answer" and upvote it.

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Greg Low 1,770 Reputation points Microsoft Regional Director
    2024-03-11T01:59:26.5966667+00:00

    Are you mapping it to an integer, and are you comparing it to 1?

    The outcome you're getting is what you'd expect if it was just a value that's not compared to anything. And because there's a value, it's treated as true. User's image

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.