SQL Server - Multi-level grouping drill down SSRS report

Asked By Paul
20-Jan-10 10:15 PM
I have the following dataset:

col_group col_province col_health_region col_city_region col_hospital
col_total col_median col_25_percentile col_75_percentile
province BC    661 65 53 75
health_region BC east   499 56 45 73
city_region BC east city_east_1  143 69 105 89
hospital BC east city_east_1 hospital_east_11 58 54 58 65
hospital BC east city_east_1 hospital_east_12 85 15 47 24
city_region BC east city_east_2  214 74 111 85
hospital BC east city_east_2 hospital_east_2 214 74 111 85
city_region BC east city_east_3  72 79 88 78
hospital BC east city_east_3 hospital_east_31 27 58 14 23
hospital BC east city_east_3 hospital_east_32 45 21 74 55
city_region BC east city_east_4  70 127 84 140
hospital BC east city_east_4 hospital_east_41 48 72 42 66
hospital BC east city_east_4 hospital_east_42 22 55 42 74
health_region BC south   162 53 47 51
city_region BC south city_south_1  39 55 35 57
hospital BC south city_south_1 hospital_south_11 14 11 62 66
hospital BC south city_south_1 hospital_south_12 25 74 47 44
city_region BC south city_south_2  36 65 77 65
hospital BC south city_south_2 hospital_south_2 36 65 77 65
city_region BC south city_south_3  44 37 42 48
hospital BC south city_south_3 hospital_south_31 15 22 34 52
hospital BC south city_south_3 hospital_south_32 29 45 74 34
city_region BC south city_south_4  43 47 65 72
BC south city_south_4 hospital_south_41 43 47 65 72



I want to create a multi-level drill down report with the highest level as
which is the "province" with the col_total, col_median, col_25_percentile
and col_75_percentile. Then user can click on the "province" cell to toggle
the next level data which is the health_region and it will shows two rows of
data "east" and "south" with the col_total,........col_75_percentile etc.
And so on user can drill down to the "hospital" level. I want to show the
data the way it is at the dataset (ie no aggregation). Can it be done on a
single standard table report with four level groupings? I believe that the
trick is on how to define the grouping on each of the grouping level. I have
spent the last two days on it without success. Please can someone make my
day. Thanks
Grouping
(1)
Report
(1)
Hospital
(1)
Dataset
(1)
Days
(1)
City
(1)
  Paul replied to Paul
20-Jan-10 10:46 PM
Just realize that the dataset I posted is not very clear. The dataset has 9
columns with the prefix "col_". Each row in the dataset has the four numeric
values populated for the col_total, col_median, col_25_percentile and
col_75_percentile. The col_group shows the grouping of that row, eg
col_group with "province" will show "BC" for the col_province and null value
for the col_health_region, col_city and col_hospital. as for the col_group
with col_group "health_region" it will show "BC" for the col_province" and
col_city_region and col_hospital. And so on for the col_city_region showing
all the possible values except null value for the col_hospital. The
col_group "hospital" will show values for all columns. Hope it is clear.
Thanks.
Create New Account
help
Particular query problem SQL Server Hi, I have 2 similar tables, like these: Create Table Report(Month int, Value float) Create Table ReportCorrect(Month int, Value float) with these values: Insert Report values(1, 16), (2, 11), (3, 12), (4, 15), (5, 0), (6, 34), (7, 56 34), (7, 56), (8, 14), (9, 24), (10, 31), (11, 12), (12, 14) In the Report table, for the months 5 (May) and 10 (October), I have Value = 0. Now I third table too. But if I find two months with value = zero in the table Report, I have to sum them with the first month with non zero value. Luigi This Server 2000: SELECT month, SUM(value) AS value FROM ( SELECT R1.Month, C.Value FROM Report AS R JOIN ReportCorrect AS C ON R.Month = C.Month AND R.Value = 0 LEFT JOIN Report AS R1 ON R1.Month > R.Month AND R1.Value <> 0 AND NOT EXISTS(SELECT FROM Report AS R2 WHERE R2.Month < R1.Month AND R2.Value <> 0 AND R2.Month > R.Month) UNION ALL SELECT C.Month, C.Value FROM Report AS R JOIN ReportCorrect AS C ON R.Month = C.Month AND R.Value <> 0
get a time out error. When I run the views in the original VS 2005 report they all work fine, but take several minutes to complete in the upgraded VS 2008 report. Below is one of the views. Does anyone have any ideas ? Thanks SELECT TOP (100 5732 1 / 28 / 2012 7:00:00 AM 1 / 28 / 2012 3:00:00 PM Days 5731 1 / 27 / 2012 11:00:00 PM 1 / 28 / 2012 7:00:00 AM 5729 1 / 27 / 2012 7:00:00 AM 1 / 27 / 2012 3:00:00 PM Days 5728 1 / 26 / 2012 11:00:00 PM 1 / 27 / 2012 7:00:00 AM ShiftPeriod TotalDur AvailDur TargetPro ShiftName HourofDay SortOrder 1 7:00-8:00 60 56 66 Days 7 9 2 8:00-9:00 60 59 69 Days 8 10 3 9:00-10:00 60 50 59 Days 9 11 4 10:00-11:0060 59 69 Days 10 12 5 11:00-12:0060 40 47 Days 11 13 6 12:00
Drillthrough report using "Jump to URL" quits working when Parent Report Parameter values are changed SQL Server I have a summary report that lists totals and the report has the ability to drillthrough to another "details" report by clicking the numbers on the summary report. The details report is rendered in a separate window using details report. This has worked fine for some time, but my problem is I need to modify
Hi Everybody, I am using dynamic SQL to execute a pivot query for a sales report since the column names will change by month. The very last statement is "EXECUTE sp_executesql How do I join these results with another query so as to get one resulting dataset? For example, here is my "other query" results: SELECT 1 AS [CustId], 'ABC Corp.' AS ABC Corp (1) CREATE TABLE (1) PRIMARY KEY (1) UNION ALL (1) NOT NULL (1) Grouping (1) Nvarchar (1) You could use OPENQUERY to execute the dynamic SQL and join the is shot down, refuted, or just picked to pieces. The right way to do a report is to use a report writer. If you have a medium to large company, then look at a report server. Two companies with I have consulted had copies of Report Services as part of their SQL Server contract, but never used it. The excuse was predicate like = 93my_date BETWEEN period_start_date AND period_end_date = 94 to put each row into the right report period. Then use = 93GROUP BY report_period_name = 94 with ROLLUP, CUBE and grouping sets for the
Slow Performance with Dynamic Grouping and ReportViewer In Local M SQL Server I am having quite a problem with very problem. In order to find the bottle neck I have created two reports with one grouping. One has a normal static grouping expression of Fields!MyFieldName.Value while the other also has a static expression but of the form Fields("MyFieldName").Value. This because I need to use dynamic grouping and will replace "MyFieldName" with Parameters!MyGroupParam.Value when this problem is resolved. I am pulling 10k records into the DataSet with about 200 distinct values in MyFieldName. When I load these reports as rdl files to the report server and either run them from the Report Manager OR use a WebViewer or WinForm Viewer in REMOTE mode there is no problem in about the same time (about 1 to 2 seconds). When I use the same report definitions as rdlc (Local Mode) then the first report still renders fast (about 1 to