Good Morning. I am creating a report in SSRS and I cannot figure out how to do this.
I am trying to get the count of records that match certain criteria. For example, If the value of column A is "Refinance" and the value of column B is greater than 35, add it to the total. I thought using an IIF inside of a CountDistinct would work but no such luck.
Whoops! Yep, I forgot my expression. Here is what I was trying to use:
="Purchase 35 DTC: " & COUNT(IIF(Fields!TransType.Value = P AND Fields!DTC.Value < 35, Fields!TransType, NOTHING), "dataset1")
And the error I get:
The value expression for the text box 'txtPurchase35DTC' has a scope parameter that is not valid for an aggregate function. The scope parameter must be set to a string constant that is equal to either the name of the containing group, the name of the containing data region or the name of the dataset.
Ah HA! thanks for the help, dam spelling...
I can now compile and view the report but I get this error for the textbox that is using this code:
="Purchase 45 DTC: " & CStr(COUNT(IIF(Fields!TransType.Value = "P" AND Fields!DTC.Value < 45, Fields!TransType, NOTHING), "DataSet1"))
Error:
The value expression for the textrun 'txtPurchase35DTC.Paragraphs[0].TextRuns[0]' uses an aggregate function with an expression that returned a datatype not valid for the aggregate function.