Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
DB Engine
SQL ServerMSDESQL Server CE
Services
Analysis (Data Mining)Analysis (OLAP)DTSIntegration ServicesNotification ServicesReporting Services
Programming
CLRConnectivitySQLXML
Other Technologies
ClusteringEnglish QueryFull-Text SearchReplicationService Broker
General
Data WarehousingPerformanceSecuritySetupSQL Server ToolsOther SQL Server Topics
DirectoryUser Groups
Related Topics
MS AccessOther DB ProductsMS Server Products.NET DevelopmentVB DevelopmentJava DevelopmentMore Topics ...

SQL Server Forum / Services / Reporting Services / July 2008

Tip: Looking for answers? Try searching our database.

Expression capability in the data cell of the matrix data region

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
dbuchanan - 28 Jul 2008 06:22 GMT
Does the matrix support the kind of expression that will allow repurposing
the the output of the matrix 'data' textbox based on the level at which a
secific grouping row is exposed.

More information:

Please refer to the following pseudo code expression as a starting point to
show what I would like to be able to achieve.

=Switch(Level = 0,Fields!data.Value
Level = 1,count(Fields!data.Value)/((First(Fields!stAssocCnt.Value)+0.0)),
Level = 2,count(Fields!data.Value)/((First(Fields!stAssocCnt.Value)+0.0)),
Level = 3,count(Fields!data.Value)/((First(Fields!stAssocCnt.Value)+0.0)),
Level = 4,count(Fields!data.Value)/((First(Fields!stAssocCnt.Value)+0.0)),
Level = 5,count(Fields!data.Value)/((First(Fields!stAssocCnt.Value)+0.0)))

The word "level" in the above 'code' is supposed to imply the use of the
level function. Even though it is my understanding that the level function
is only available for the table data region and we are discussing the matrix
in this question the use of the level function here roughtly demonstrates
what I want to achieve.

I also understand that my syntax for the use of the "level" function is not
correct (partially because it is used out of context) however the use above
does convey the concept of what I would like to be able to do - repurpose
the 'data' cell based on the level of the hierarchy which is exposed.

I am also not sure which level should be '0' the highest or the lowest - in
this example I am assuming that level '0' is the lowest level of the
hierarchy.

What is happening in the pseudo code above is that when a particular row is
fully expaneded what is displayed is the untouched field value as it is in
the underlying data table. When the first group is collapsed then the count
of cells within the group are divided by the first value in a named column.
The result is a percentage that has a particular meaning to this report.

Here are some sample data.

hdName,hdEnt,hdTCntAaB,dvName,dvEnt,dvTCntAaB,reName,reEnt,reTCntAaB,arName,arEnt,arTCntAaB,stName,stEnt,stAssocCnt,associateName,courseTitle,data
TKHdqtrs,26183,824,Division: 9480,88041,265,Region: 9460,96151,101,Area
9435,88630,44,TK#601,88083,4,FELIFRANCISCO,Brake Systems Service,87% score
TKHdqtrs,26183,824,Division: 9480,88041,265,Region: 9460,96151,101,Area
9435,88630,44,TK#601,88083,4,FELIFRANCISCO,Brake System Theory,80% score
TKHdqtrs,26183,824,Division: 9480,88041,265,Region: 9460,96151,101,Area
9435,88630,44,TK#601,88083,4,FELIFRANCISCO,Tire Service - Tire Repair
Procedures,100% score
TKHdqtrs,26183,824,Division: 9480,88041,265,Region: 9460,96151,101,Area
9435,88630,44,TK#601,88083,4,ALVAJULIO,Brake System Theory,80% score
TKHdqtrs,26183,824,Division: 9480,88041,265,Region: 9460,96151,101,Area
9435,88630,44,TK#601,88083,4,ALVAJULIO,Diagnosing Antilock Brake Systems,90%
score

What the calculation is doing is taking the count (aggregate count of text
entries) of persons who have taken a course and dividing it by the value
supplied by the query (the count of persons who are assigned to take a
course.

The end result is that at the lowest level you have the score of individual
persons (in text format) if they took the course and blanks if they have
not. Then as you successively collapse the grouping levels you get the
percentage of total persons who have taken the course at and below the
current level of the hierarchy who were assigned to take the course.

What is not obvious here is that he total counts in the data have come from
a separate query (built in a stored procedure) because the primary query (by
requirement) filters out those persons who have not taken any of the courses
selected for display  in the report.

The question I need answered is: Is there a way to detect for a particular
data cell what level of the hierarchy the user has selected to expose and
use that information in an expression entered in the 'data' text box of the
matrix data region?

Thank you,
Doug
dbuchanan - 28 Jul 2008 08:11 GMT
corrected pseudo code

=Switch(Level = 0,Fields!data.Value
Level = 1,count(Fields!data.Value)/((First(Fields!stAssocCnt.Value)+0.0)),
Level = 2,count(Fields!data.Value)/((First(Fields!arAssocCnt.Value)+0.0)),
Level = 3,count(Fields!data.Value)/((First(Fields!reAssocCnt.Value)+0.0)),
Level = 4,count(Fields!data.Value)/((First(Fields!dvAssocCnt.Value)+0.0)),
Level = 5,count(Fields!data.Value)/((First(Fields!hdAssocCnt.Value)+0.0)))

Sorry,
Doug
Charles Wang [MSFT] - 28 Jul 2008 11:31 GMT
Hello Doug,

Thank you posting!

This is a quick note to let you know that I am performing research on this issue and will get back to
you as soon as possible. I appreciate your patience.

Best regards,
Charles Wang
Microsoft Online Community Support
===========================================================
Delighting our customers is our #1 priority. We welcome your
comments and suggestions about how we can improve the
support we provide to you. Please feel free to let my manager
know what you think of the level of service provided. You can
send feedback directly to my manager at: msdnmg@microsoft.com.
===========================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notifications.

Note: The MSDN Managed Newsgroup support offering is for
non-urgent issues where an initial response from the community
or a Microsoft Support Engineer within 1 business day is acceptable.
Please note that each follow up response may take approximately
2 business days as the support professional working with you may
need further investigation to reach the most efficient resolution.
The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by
contacting Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
============================================================
Signature

This posting is provided "AS IS" with no warranties, and confers no rights.

=========================================================
Charles Wang [MSFT] - 29 Jul 2008 12:45 GMT
Hi Doug,
Level is for recursive group. You can use Level function with the group name in your matrix data
region.
To retrieve the current item's level, you can use "=Level("Group_Name")". Based on this, I think that
you can change the Data field value with the expression as following:
=Switch(Level("The_Group_Name") = 0,Fields!data.Value
Level("The_Group_Name") = 1,count(Fields!data.Value)/((First(Fields!stAssocCnt.Value)+0.0)),
Level("The_Group_Name") = 2,count(Fields!data.Value)/((First(Fields!stAssocCnt.Value)+0.0)),
Level("The_Group_Name") = 3,count(Fields!data.Value)/((First(Fields!stAssocCnt.Value)+0.0)),
Level("The_Group_Name") = 4,count(Fields!data.Value)/((First(Fields!stAssocCnt.Value)+0.0)),
Level("The_Group_Name") = 5,count(Fields!data.Value)/((First(Fields!stAssocCnt.Value)+0.0)))

Hope this helps. If you have any other questions or concerns, please feel free to let me know.

Best regards,
Charles Wang
Microsoft Online Community Support
===========================================================
Delighting our customers is our #1 priority. We welcome your
comments and suggestions about how we can improve the
support we provide to you. Please feel free to let my manager
know what you think of the level of service provided. You can
send feedback directly to my manager at: msdnmg@microsoft.com.
===========================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notifications.

Note: The MSDN Managed Newsgroup support offering is for
non-urgent issues where an initial response from the community
or a Microsoft Support Engineer within 1 business day is acceptable.
Please note that each follow up response may take approximately
2 business days as the support professional working with you may
need further investigation to reach the most efficient resolution.
The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by
contacting Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
============================================================
Signature

This posting is provided "AS IS" with no warranties, and confers no rights.

=========================================================
Charles Wang [MSFT] - 31 Jul 2008 14:46 GMT
Hi Doug,
What is this issue going on? Please feel free to let me know if you have any other
questions or concerns.

Best regards,
Charles Wang
Microsoft Online Community Support
=========================================================
Delighting our customers is our #1 priority. We welcome your
comments and suggestions about how we can improve the
support we provide to you. Please feel free to let my manager
know what you think of the level of service provided. You can
send feedback directly to my manager at: msdnmg@microsoft.com.
=========================================================
Signature

This posting is provided "AS IS" with no warranties, and confers no rights.

=========================================================
Charles Wang [MSFT] - 31 Jul 2008 14:46 GMT
Hi Doug,
What is this issue going on? Please feel free to let me know if you have any other
questions or concerns.

Best regards,
Charles Wang
Microsoft Online Community Support
=========================================================
Delighting our customers is our #1 priority. We welcome your
comments and suggestions about how we can improve the
support we provide to you. Please feel free to let my manager
know what you think of the level of service provided. You can
send feedback directly to my manager at: msdnmg@microsoft.com.
=========================================================
Signature

This posting is provided "AS IS" with no warranties, and confers no rights.

=========================================================
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.