Erin Leale
asked on
SSRS Declare a Variable
Good day!
I'm new to SSRS reporting, Crystal Reports veteran. We are using SSRS Report Builder 3.0 with Epicor 10. I need to declare a variable on my report. Here are the details:
Labor Burden Rate Budget to Actual Report
Data set is my Epicor BAQ and contains all the data I need
I need to name this value and use it in a formula across departments
=abs(sum(Fields!Calculated_Sales.Value))
When I add a Variable to the Report Properties - I get an Error attempting to run the report:
I have tried various versions of the formula and tried to declare or name the variable and I'm missing something obviously....
I get this error:
The Variable(vSalesYTD) expression for the report ‘body’ uses an aggregate expression without a scope. A scope is required for all aggregates used outside of a data region unless the report contains exactly one dataset.
In Crystal Reports - The naming of the variable was straight forward. In here - I'm lost. I've exhausted my search for help on the web and SSRS help that I have available.
Any help would be greatly appreciated.
Thank you so much!
EL
I'm new to SSRS reporting, Crystal Reports veteran. We are using SSRS Report Builder 3.0 with Epicor 10. I need to declare a variable on my report. Here are the details:
Labor Burden Rate Budget to Actual Report
Data set is my Epicor BAQ and contains all the data I need
I need to name this value and use it in a formula across departments
=abs(sum(Fields!Calculated_Sales.Value))
When I add a Variable to the Report Properties - I get an Error attempting to run the report:
I have tried various versions of the formula and tried to declare or name the variable and I'm missing something obviously....
I get this error:
The Variable(vSalesYTD) expression for the report ‘body’ uses an aggregate expression without a scope. A scope is required for all aggregates used outside of a data region unless the report contains exactly one dataset.
In Crystal Reports - The naming of the variable was straight forward. In here - I'm lost. I've exhausted my search for help on the web and SSRS help that I have available.
Any help would be greatly appreciated.
Thank you so much!
EL
SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER
I received another error - here is my Dataset Properties:
I made this change:
I get this error:
Any ideas?
Thanks!
I made this change:
I get this error:
Any ideas?
Thanks!
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
Right that was my bad...should be
=abs(sum(Fields!Calculated_Sales.Value,"BAQReportResult" ))
=abs(sum(Fields!Calculated_Sales.Value,"BAQReportResult" ))
=abs(sum(Fields!Calcualted_Sales.Value, [Name of Dataset]))
where [Name of Dataset] is the name (see Dataset), where the field is comming from.