How to use COUNT, IIF, & IS NOT NULL in a SSRS expression together?

Leo Verratti 1 Reputation point
2021-04-14T22:42:08.927+00:00

Hi,

I'm looking to use an expression with 3 different statements. In SQL it would be a simple line like:
SELECT count(clientid)
FROM table1
WHERE col1 = "value1" and col2 = "value2" and col3 IS NOT NULL

This is what I have so far... I don't know where to put the IS NOT NULL statement

=COUNT(IIF(Fields!Column1.Value="True" AND Fields!Column.Value="True" ,1,Nothing))

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,101 questions
No comments
{count} votes

1 answer

Sort by: Most helpful
  1. ZoeHui-MSFT 18,746 Reputation points Microsoft Employee
    2021-04-15T01:42:47.057+00:00

    Hi @Leo Verratti ,

    You may refer below expression for a try:

    =sum(IIF(Fields!Column1.Value="True" and Fields!Column.Value="True"  and Fields!Column3.Value<>nothing ,1,Nothing))  
    

    If I misunderstand your need, please incorrect me.

    Regards,
    Zoe


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

    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.

    What can I do if my transaction log is full?--- Hot issues November

    How to convert Profiler trace into a SQL Server table -- Hot issues November

    No comments