I am Getting Error in the expression in SSRS - reporting-services

Hi I have a An expression on one of the column in Tablix like
=Iif(month(today)="5", Fields!H1Quota.Value+Fields!Q3Quota.Value+Fields!AprQuota.Value,
iif(month(today)="6",Fields!H1Quota.Value+Fields!Q3Quota.Value+Fields!AprQuota.Value+Fields!MayQuota.Value,
iif(month(today)="7",Fields!H1Quota.Value+Fields!Q3Quota.Value+Fields!AprQuota.Value+Fields!MayQuota.Value+Fields!JuneRevenue,
Fields!H1Quota.Value+Fields!Q3Quota.Value)))
In the above expression ,i have set a condition based on the excecution month.It was showing error in preview,but it is not showing anything in as red lines but getting the error,
IS the above syntax correct?

Related

issue with IFF and Multiple cascading Split in SSRS report

I am getting error for the below,
=IIF(Fields!ParentObjectType.Value !="Approval Request",Split(Split(Fields!CT_CaptionURL.Value,"f =").GetValue(1),"Target").GetValue(0),Split(Split(Fields!CT_CaptionURL.Value,"f=").GetValue(1),"target").GetValue(0))
Got the below error
The Value expression for the field ‘URL’ contains an error: [BC30203] Identifier expected.
The definition of the report '' is invalid.
Replace != with <> in your expression

SSRS Drill Through report using expression report name invalid

In a text box I am using an expression for a goto report action based on a parameter. A report will be openend based on the value of the parameter:
iif(Parameters!Par_Sub.Value = "Werkgever.Bedrijf",
"reportsubtwo.rdl",
nothing
)
In preview however I get the following message:
the Drillthrough Report Name for the text box is not valid. Item names cannot contain the following reserved characters ;?:#&=+$,*<>|". (rsInvalidReportNameCharacters)
What could be wrong? The report reportsubtwo exists and does not contain any special characters, I am running into a dead end obviously.
I have found the solution, the = character before the IIF statement is missing,
=iif(Parameters!Par_Sub.Value = "Werkgever.Bedrijf", "reportsubtwo.rdl", nothing )
is the right syntax. Curiously there was no syntax error message displayed after completing the goto report action, but this vague message about the report name containing reserverd characters during previewing the report.

SSRS report returning error - The sort expression for the group 'grp' contains an error: Attempted to divide by zero

I am attempting to fix an error in a previous developers SSRS report. There is a group by parameter, when choosing a certain value it returns the error - The sort expression for the grouping 'grp' contains an error: Attempted to divide by zero.
The error suggests this expression is causing the error;
=-Sum(Fields!RentCollected.Value)/Sum(Fields!RentDue.Value)
Selecting other parameters works without any errors.
Any ideas how this can be fixed?
I don't know what further information to provide but can if it specified.
Thanks in advance for any help.
Looks like the error is caused when the sum of Fields!RentDue.Value is zero. To fix this, a simple IIF statement to check for zero should fix the issue. Try the following expression.
=Sum(Fields!RentCollected.Value)/IIF(Sum(Fields!RentDue.Value) = 0, 1, Sum(Fields!RentDue.Value))

The 'AverageRejection' parameter is missing a value

I have the report that I have build with Reporting Services 2008.
In this report, I have a chart that use throught "strip line" an hidden parameter. The hidden parameter is called "AverageRej". The parameter "AverageReg" is populated by a query. This is the situation:
Configuration hidden parameter
In stripLine I have this code:
=iif(IsNothing(Parameters!AverageRejection.Value), 0, Parameters!AverageRejection.Value*100)
But, If I try to show a report and the query not have one or more result I have this error:
The 'AverageRejection' parameter is missing a value
I tried to give a try, I have set AverageRejection as a VisibleParameter, I show a Select box, if I manual setting a null value, I don't have a error message.
What is the error?

#Error in Column With both Text and Numeric Values in ssrs reports

In my report for one field i have both numeric and text values.( i.e 10.546 and "vary")
So when i apply CDec function for this field values i get #error where i have filed value as "Vary" .
10.6572 10.6572
Vary #Error
i tried expression "
=IIf(IsNumeric(Fields!price.Value),
CDec(Fields!price.Value),
"Fields!price.Value)"
but it is not working.
i checked in net in most of the cases all telling to write function, unfortunately in my project that is not allowed.
so is their any way i can resolve this "#Error" using expression.
I got solution.
=iif(IsNumeric(Fields!EUnit.Value), VAL(Fields!EUnit.Value),Fields!EUnit.Value)
this is working fine to me.
Ref : https://social.msdn.microsoft.com/Forums/sqlserver/en-US/ac2c9db4-85a5-44a8-909b-1ee09791542e/ssrs-check-if-the-field-value-is-numeric-or-not?prof=required