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 |
jhaney
Starting Member
33 Posts |
Posted - 2011-10-19 : 16:05:16
|
I hope I am explaining this correctly. I have a matrix that produces the following:Day Location Work HoursMonday OFFICE 1 355.0 OFFICE 2 41.9 OFFICE 3 14.0Tuesday OFFICE 2 197.1 OFFICE 1 8.4 OFFICE 3 6.2What I need is to assume all of the work hours for the day were performed at the office with thie highest total. Like thisDay Location Work HoursMonday OFFICE 1 410.9Tuesday OFFICE 2 211.7I can get the hours to show correctly but the office column is inconsistant.I tried =first(field!office.value) and =Max(field!office.value) Neither of those worked. I need to display the office that has the highest work hours for the day with the work hours showing the total for all offices. Thanks in advanced for any assistance. |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2011-10-20 : 04:30:43
|
add the below one line to your query behind in select likeDENSE_RANK() OVER (PARTITION BY Day ORDER BY [Work Hours] DESC) AS Rnkthen refresh dataset and make expression like=Max(IIF(Field!Rnk.value=1,field!office.value,Nothing)) ------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
|
|
|
|
|