Solved

SSRS 2008 Average Column in Column Chart

Posted on 2010-08-30
10
1,122 Views
Last Modified: 2012-05-10
Hi all, is it possible to display an Average Column in the Column chart in SSRS 2008? I have range of scores (300-310,311-320,321-330, etc.) on the X-axis and number of students on the Y-axis. I need to display a vertical line in different color for the Average score. I tried the Moving average but that's not what I need.

Any help is appreciated,
Thank you.
0
Comment
Question by:mr_patel
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 5
10 Comments
 
LVL 10

Accepted Solution

by:
itcouple earned 250 total points
ID: 33567134
Hi

Yes it is possible but do you want to do that? Basically you just add an extra row (you might use union in your dataset) which will display 'average range' with an here is the issue: How many students do you want to show for this average???

Alternative approach is to highlight 'average' range so it is different colour. In this case you need to identify in your dataset row which represent average and flag using new field IsAverage (true/false) if false then standard colour else average colour.

Let me know if this suggestions will work for you.

Regards
Emil
0
 
LVL 10

Expert Comment

by:itcouple
ID: 33567210
Hi

I just read again your request and noticed you want a line.... you can get it on Y axis (horizontal line) but vertical would be rather difficult to do as it doesn't belong "naturally" to the graph. You should be still able to do that but adding extra row (see above solution) and changing the width of the bar. It should be possible (not 100% sure)  to do using expressions or programmatically. But I suggest to consider option 2.

Regards
Emil
0
 

Author Comment

by:mr_patel
ID: 33567338
Thanks itcouple for the suggestion. I'll give it a try and let you know.
0
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

 

Author Comment

by:mr_patel
ID: 33568891
itcouple, that worked like a charm!! Thanks a lot for the suggestion. But now it created another issue. The PointWidth for the bar width doesn't work anymore! As soon as I remove the UNION from the query, the bar width is fine, but with the UNION, it just draws one thin line, no matter what the PointWidth is. Any ideas? Thanks again.
0
 
LVL 10

Expert Comment

by:itcouple
ID: 33571198
Hi

Can you attach screenshot. I want to see how it looks maybe I will use it for my reports :)

Regarding the widht issue. Make sure your data type is correct when using UNION and expression does explicit conversion. If that doesn't help paste your expression here and I'll try to help.

Regards
Emil
0
 

Author Comment

by:mr_patel
ID: 33571341
I've attached the screenshot. Here is my query:

SELECT        ScaledScore, ScaledScore - ScaledScore % 10 + 5 AS Range, COUNT(*) AS count,0 As IsAverage
FROM            vApplication
WHERE        (RouteID = 'NG') AND (ExamDate >= @DateFrom) AND (ExamDate <= @DateTo)
GROUP BY ScaledScore, ScaledScore - ScaledScore % 10
UNION
SELECT Avg(ScaledScore) As ScaledScore, Avg(ScaledScore) AS Range, COUNT(*) As count, 1 As IsAverage
FROM vApplication
where schoolID = @SchoolID And (RouteID = 'NG') AND (ExamDate >= @DateFrom) AND (ExamDate <= @DateTo)

Untitled.png
0
 
LVL 10

Expert Comment

by:itcouple
ID: 33571546
Hi
I cannot see anything wrong with the query. Do you use expressions on the chart?

Regards
Emil
0
 

Author Comment

by:mr_patel
ID: 33573550
No, the only expression I have is in the Color. I also tried restoring the report from a backup and added the UNION, but no luck.
0
 
LVL 10

Expert Comment

by:itcouple
ID: 33574334
Hi

Try removing expression in the colour and see if it changes the behaviour. If it doesn't then try to do union with different figures to see if makes any difference. I'm afraid in this case it might be that you  will have to find 'lower level' issue to try to resolve it. Also without union try to see if X or Y scale changes.

Regards
Emil
0
 

Author Comment

by:mr_patel
ID: 33576382
I'll try that. Thanks for the suggestions.
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Written by Valentino Vranken. Introduction: The first step of creating a SQL Server Reporting Services (SSRS) report involves setting up a connection to the data source and programming a dataset to retrieve data from that data source.  The data…
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…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

738 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