Madsing
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?
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_
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?
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.
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.
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!?
Set expression for: Hidden
=IIf((Count(Fields!DK1_DK2
and it works I have not defined a group!?
oh great. Thanks for sharing.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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.Valu
this will work out