Solved

How can I get the value of my textbox in reporting services to include a sum expression?

Posted on 2009-04-03
5
275 Views
Last Modified: 2012-05-06
Hi,
I have the following in one of my text boxes on my value:

= "Total Number of Incidents in Service Alliance queue: "&"          "&Sum(Fields!TotalIncidents.Value, "IncidentsInSAQueue")

IncidentsInSAQueue is the name of my dataset:

select count(sequence) from _SMDBA_._TELMASTE_
where  [date open] > '01-oct-08'
and _SMDBA_._TELMASTE_.subject = 1381
and _group_ in (1011, 1004)
and status = 'O'

When I try to run I get this error:
C:\Reports\Astea\Astea\Service_Alliance_Incident_Report.rdl A value expression used for the report parameter '=count(sequence)' includes an aggregate function.  Aggregate functions cannot be used in report parameter expressions.

Can someone please show me how this should be entered into the textbox?

Thanks,
Rhonda
0
Comment
Question by:Rhonda Carroll
  • 3
  • 2
5 Comments
 
LVL 12

Expert Comment

by:udayakumarlm
ID: 24058843
no aggregate functions are allowed in the report parameters.
if you have to provide the aggregate value then make it part of the query to generate the aggregate value as a field, and use the field as parameter
create select as
select A,B,C,(select Count(A) as CountA) from tableName
and use CountA as parameter
0
 

Author Comment

by:Rhonda Carroll
ID: 24059134
Hi udayakumarlm:

Can you modify my query to do this?

This is my orginal:
select count(sequence) from _SMDBA_._TELMASTE_
where  [date open] > '01-oct-08'
and _SMDBA_._TELMASTE_.subject = 1381
and _group_ in (1011, 1004)
and status = 'O'

I tried:
select sequence, (select count(sequence) as seq) from _SMDBA_._TELMASTE_
where  [date open] > '01-oct-08'
and _SMDBA_._TELMASTE_.subject = 1381
and _group_ in (1011, 1004)
and status = 'O'    

and used this in my text box:
= "Total Number of Incidents in Service Alliance queue: "&"          "&(Fields!seq.Value, "IncidentsInSAQueue")

but it gives a group by error
0
 
LVL 12

Accepted Solution

by:
udayakumarlm earned 250 total points
ID: 24059184
use
select count(sequence) as seq from _SMDBA_._TELMASTE_
where  [date open] > '01-oct-08'
and _SMDBA_._TELMASTE_.subject = 1381
and _group_ in (1011, 1004)
and status = 'O'
0
 

Author Comment

by:Rhonda Carroll
ID: 24059244
Did that too, look at the pic to see what is happening.
report-error.doc
0
 

Author Comment

by:Rhonda Carroll
ID: 24059269
never mind got it. Thanks!
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Everyone has problem when going to load data into Data warehouse (EDW). They all need to confirm that data quality is good but they don't no how to proceed. Microsoft has provided new task within SSIS 2008 called "Data Profiler Task". It solve th…
Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
Via a live example, show how to shrink a transaction log file down to a reasonable size.
Via a live example, show how to setup several different housekeeping processes for a SQL Server.

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now