Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
opensourcederry
Starting Member
12 Posts |
Posted - 2012-03-12 : 08:22:22
|
Hi all,SSRS 2008 R2I am converting some spreadsheets to reporting services but I am having a specific problem in calculating a weighted average for some values. The spreadsheet users use a manual formula in Excel but there does not seem to be an equivalent in SSRS.Imagine the following datasetLocation Department Calls Average TalktimeNew York New Sales 10 200New York Admin 20 150In the report I am grouping by Location and for the New York Location the following needs to be displayed.Location Calls AverageTalkTimeNew York 30 166.66The 166.66 value is worked out in Excel using a formula and it is also a weighted average. The equivalent manual formula is SUM((D4*E4)+(D5*E5))/SUM(D4:D5) which is SUM((10*200)+(20*150))/SUM(10:20) In this formula the calls are in column D and the talk time in column EWe cannot work out how to do this in SSRS at all, any ideas? Thanks in advance,osd |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2012-03-12 : 10:16:24
|
isnt it this?=SUM(Fields!Calls.value * Fields!AverageTalktime.value)/SUM(Fields!Calls.value)------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
|
|
|
|
|