How to compare 2 expressions in SSRS and hide row based on that?

Anjali Shah 21 Reputation points

I have a table with 2 rows having 2 different expressions.

I want to hide the second row if its value matched with the expression of 1st row. How do I achieve the same?

I tried something like IIF(EXP1=EXP2,TRUE, FALSE) in the visibility expression of 2nd row but it didn't work.

Thanks in advance.

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

2 answers

Sort by: Most helpful
  1. Isabellaz-1451 3,616 Reputation points

    Hi @Anjali Shah

    I did a local test,and mine can works.

    expression: =iif(ReportItems!SECONDROW.Value=ReportItems!FIRSTROW.Value,True,False)
    SECONDROW and FIRSTROW is the name of the two textbox

    Best Regards,

    0 comments No comments

  2. Joyzhao-MSFT 15,571 Reputation points

    Hi @Anjali Shah ,
    I tested this locally and if you use something like =IIF(Your EXPR1=Your EXP2,TRUE,FALSE) this will work fine.
    At first I have the following Table,


    I set up two expressions:


    The preview is as follows:

    When I set the visibility to the second expression textbox:



    The preview is as follows:


    When the value of the second expression is the same as the value of the first expression, the second value is hidden.

    Best Regards,

    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.