Link to home
Start Free TrialLog in
Avatar of Madsing
MadsingFlag for Denmark

asked on

Show table on expression using iif and countrows

Hi,

I have a table inside a SSRS report. I have a problem writing the correct expression regarding the visibility condition.

I would like to set a condition that:

IF the column in the dataset contains more than one rows that has "DK1" in fiel valued I would like to show the table.

=iif(Countrows(Fields!DK1_DK2.Value = "DK1") > 1, TRUE, FALSE)

But with the above expression I get the error: The expression has a scope parameter that is not valid for an aggregate function.

Can you help out here?
Avatar of SThaya
SThaya
Flag of India image

i think you  have applied the expression inside the text box properties .


do the below

1. take the count from the different data set .name called "CountDataset"

2. select the entire table----> properties ....>  select Hidden  ---> set the expression

like


=iif(Sum(Fields!Count.Value, "CountDataset")>0 ,TRUE,FALSE)


this will work out
Avatar of Madsing

ASKER

I am applying the settings to the Tablix (matrix) properties. If you select hidden you dont get the option to type in an expression. So I have selected the "show or hide based on and expression".
 

I need to check the dataset if there are any records with the value "DK1" in the field called DK1_DK2. If there are any records with the above criteria I need to show the matrix otherwise hide it.

So you contribution wont solve it.
Have you defined the group. Since it is a aggregate function, you can't use it without group.
Avatar of Madsing

ASKER

I have tried to change it to:


Set expression for: Hidden
=IIf((Count(Fields!DK1_DK2.Value = "DK1") < 0),True,False)

and it works I have not defined a group!?
oh great. Thanks for sharing.
ASKER CERTIFIED SOLUTION
Avatar of Harish Varghese
Harish Varghese
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial