I have a very unique question & i have read countless topics on it, not found a correct answer. Please help me in this.
I have a matrix where i'm calculating the count of all Satisfied, Very safistied, neither satisfied nor unsatisfied or very unsatisfied or unsatisfied. Even if the count value is less than 5 i'm using below code to hide the count of 5 .
=(Switch(Count(Fields!Q27_A_1.Value)<5, "*", Count(Fields!Q27_A_1.Value)>5 , Count(Fields!Q27_A_1.Value)))
And i need to count the total of this cell into another cell in row and show their value
But if it contains any "*" values
then total will be "*"
else display = Count(Fields!Q27_A_1.Value).
I have writtten these lines of custom code but not working. : Getting Error : Input String was not in correct format
Public Function SafeConvert(ByVal num As String) As String
Dim s as String
IF IsNumeric(num) <5
Then
Return "*"
Else :
For i as integer = 0 to 4
s += num
Next
Return s
End IF
End Function
At the end, I'm calling this function into that cell using
=Code.SafeConvert(ReportItems!Textbox4.Value)
The issue with your custom code seems superfluous since isn't going to accomplish anything more than the expression you already had. So I would suggest not using any custom code for this.
The main issue here is referencing values in other cells. SSRS has limited support for this built in. You cannot have a grouped expression and then reference it and aggregate it again. But there are ways to work around it to get the desired end result.
One way to do this would be to use subqueries in your SQL to get the additional values you need. Then in the report you would reference the new column to count the filtered values. I would recommend using this approach if possible.
Another option is to add a calculated field to your dataset. You would need to write an expression that filters the data row-by-row. Depending on your exact requirements, this may not be sufficient. Again, you would reference this new column in your table.
I know this isn't a specific answer, but I hope it points you in the right direction.