Avatar of Erin Leale
Erin LealeFlag for United States of America

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....  

User generated image
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

SSRSMicrosoft Server OSMicrosoft SQL Server

Avatar of undefined
Last Comment
lcohan
Avatar of Bembi
Bembi
Flag of Germany image

You may try
=abs(sum(Fields!Calcualted_Sales.Value, [Name of Dataset]))
where [Name of Dataset]  is the name (see Dataset), where the field is comming from. 
SOLUTION
Avatar of lcohan
lcohan
Flag of Canada image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of Erin Leale
Erin Leale
Flag of United States of America image

ASKER

I received another error - here is my Dataset Properties:





User generated image
I made this change:
User generated image
I get this error:
User generated image
Any ideas?
Thanks! 
ASKER CERTIFIED SOLUTION
Avatar of Bembi
Bembi
Flag of Germany image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
Avatar of lcohan
lcohan
Flag of Canada image

Right that was my bad...should be
 =abs(sum(Fields!Calculated_Sales.Value,"BAQReportResult" ))
Microsoft SQL Server
Microsoft SQL Server

Microsoft SQL Server is a suite of relational database management system (RDBMS) products providing multi-user database access functionality.SQL Server is available in multiple versions, typically identified by release year, and versions are subdivided into editions to distinguish between product functionality. Component services include integration (SSIS), reporting (SSRS), analysis (SSAS), data quality, master data, T-SQL and performance tuning.

171K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo