x

change background color in ssrs

i do have a section and subsection in a groups, each section might have multiple subsections and i am performing avg on each subsection at report level. I want to change the back color for the subsection which will get minimum average score. While i am performing at backcolor expression like

= iif(min(avg(score)) < avg(score),'blue','white') ...it is giving an error....

**EDIT** (Error from comments on [Cyborg answer][1])
[rsAggregateofAggregate] The Value expression for the textrun 'Order_Count9.Paragraphs[0].TextRuns[0]' contains an aggregate function (or RunningValue or RowNumber functions) in the argument to another aggregate function (or RunningValue). Aggregate functions cannot be nested inside other aggregate functions.

[1]: http://ask.sqlservercentral.com/questions/80069/change-background-color-in-ssrs?page=1#80070
more ▼

asked Oct 12, 2011 at 01:13 AM in Default

Murali gravatar image

Murali
906 101 117 120

(comments are locked)
10|1200 characters needed characters left

1 answer: sort voted first
did you tried iif(min(avg(score)) < avg(score),"blue","white")..?
more ▼

answered Oct 12, 2011 at 01:35 AM

Cyborg gravatar image

Cyborg
10.6k 36 40 45

yes, but still same error...
Oct 12, 2011 at 03:24 AM Murali
I guess you cannot use nested aggregates in SSRS min(avg(score)), can you post the error in detail?
Oct 12, 2011 at 03:28 AM Cyborg
[rsAggregateofAggregate] The Value expression for the textrun 'Order_Count9.Paragraphs[0].TextRuns[0]' contains an aggregate function (or RunningValue or RowNumber functions) in the argument to another aggregate function (or RunningValue). Aggregate functions cannot be nested inside other aggregate functions.
Oct 12, 2011 at 07:07 AM Murali
Murali, the error message clearly says that you cannot nest the aggregate function. IS it possible to bring that Avg(Score) to separate column and then do aggregate on the new column, ie MIN(of New column)
Oct 12, 2011 at 08:51 PM Cyborg
(comments are locked)
10|1200 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

New code box

There's a new way to format code on the site - the red speech bubble logo will automatically format T-SQL for you. The original code box is still there for XML, etc. More details here.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

SQL Server Central

Need long-form SQL discussion? SQLserverCentral.com is the place.

Topics:

x554

asked: Oct 12, 2011 at 01:13 AM

Seen: 1194 times

Last Updated: Nov 03, 2011 at 01:52 PM