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.

 All Forums
 SQL Server 2008 Forums
 Analysis Server and Reporting Services (2008)
 Group Textbox Expression

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 Hours
Monday OFFICE 1 355.0
OFFICE 2 41.9
OFFICE 3 14.0
Tuesday OFFICE 2 197.1
OFFICE 1 8.4
OFFICE 3 6.2

What I need is to assume all of the work hours for the day were performed at the office with thie highest total. Like this

Day Location Work Hours
Monday OFFICE 1 410.9
Tuesday OFFICE 2 211.7

I 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 like

DENSE_RANK() OVER (PARTITION BY Day ORDER BY [Work Hours] DESC) AS Rnk

then refresh dataset and make expression like

=Max(IIF(Field!Rnk.value=1,field!office.value,Nothing))



------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -