question

AnjaliShah-7274 avatar image
0 Votes"
AnjaliShah-7274 asked Isabellaz-1451 commented

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

I have a table with 2 rows having 2 different expressions.
200596-image.png



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
image.png (769 B)
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @AnjaliShah-7274
we have not get a reply from you. Did any answers could help you?
If there have any answers helped you, please do "Accept Answer". If not, please let us know. By doing so, it will benefit for community members who have this similar issue. Your contribution is highly appreciated. Thank you!

Best Regards,
Isabella

0 Votes 0 ·
Isabellaz-1451 avatar image
0 Votes"
Isabellaz-1451 answered

Hi @AnjaliShah-7274

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
200727-image.png



Best Regards,
Isabella


image.png (12.6 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Joyzhao-MSFT avatar image
0 Votes"
Joyzhao-MSFT answered Joyzhao-MSFT commented

Hi @AnjaliShah-7274 ,
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,

200718-01.jpg

I set up two expressions:

 =COUNT(Fields!CaseID.Value)
 =IIF(COUNT(Fields!CaseID.Value)=8,8,0)

The preview is as follows:
200813-00.jpg

When I set the visibility to the second expression textbox:

 =IIF(COUNT(Fields!CaseID.Value)
 =
 IIF(COUNT(Fields!CaseID.Value)=8,8,0),True,False)

200758-02.jpg

The preview is as follows:

200805-03.jpg

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

Best Regards,
Joy


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.


01.jpg (15.1 KiB)
00.jpg (50.8 KiB)
02.jpg (62.3 KiB)
03.jpg (48.3 KiB)
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

You can also use Built-in collections - ReportItems like the example given by Isabella.


0 Votes 0 ·