CREATE TABLE [Store](
[StoreId] [int] IDENTITY(1,1) NOT NULL,
[LOC_Name] [varchar](50) NULL,
CONSTRAINT [PK_Store] PRIMARY KEY CLUSTERED
(
[StoreId] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
Insert into [dbo].[Store]
(
[LOC_Name]
)
select 'Virginia'
union all
select 'Chicago'
union all
select 'Dallas'
CREATE TABLE [Employee](
[StoreId] [int] NOT NULL,
[Emp_NAME] [nvarchar](70) NULL,
) ON [PRIMARY]
Insert into [dbo].[Employee]
(
[StoreId]
,[Emp_NAME]
)
select 1,'daniel'
union all
select 1,'jack'
union all
select 1,'roger'
union all
select 1,'matt'
union all
select 2,'sam'
union all
select 2,'henry'
union all
select 3,'eston'
union all
select 3,'robert'
union all
select 3,'nadal'
CREATE TABLE [Customer](
[CustomerId] [int] IDENTITY(1,1) NOT NULL,
[StoreId] [int] NOT NULL,
[CUST_NO] [nvarchar](11) NULL,
[Emp_NAME] [nvarchar](70) NULL,
CONSTRAINT [PK_Customer] PRIMARY KEY CLUSTERED
(
[CustomerId] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
set identity_insert [CCC_STAGE].[dbo].[Customer] on
Insert into [CCC_STAGE].[dbo].[Customer]
(
[CustomerId]
,[StoreId]
,[CUST_NO]
,[Emp_NAME]
)
select 201,1,897456,'daniel'
union all
select 202,1,974652,'daniel'
union all
select 203,1,276294,'matt'
union all
select 204,1,612348,'jack'
union all
select 205,2,187906,'henry'
union all
select 206,2,289123,'henry'
union all
select 207,2,427403,'sam'
union all
select 208,3,591654,'robert'
union all
select 209,3,904563,'robert'
-------------- Query to retrieve In each location each employee is working on how many customers--
select [LOC_NAME],
B.[Emp_NAME],
COUNT(distinct C.[CUST_NO]) TOTAL_CUSTOMERS
FROM [CCC_STAGE].[dbo].[Store_TEST] A
join [CCC_STAGE].[dbo].[Employee_TEST] B
on A.StoreId=B.StoreId
join [CCC_STAGE].[dbo].[Customer_TEST] c
on B.StoreId=C.StoreId
and B.[Emp_NAME]=C.[Emp_NAME]
group by [LOC_NAME]
,B.[Emp_NAME]
ORDER BY [LOC_NAME],B.[Emp_NAME]
Hi everyone,
Can any one help me in this
Drill down report
can any one help me in this
If we click on drill down of Chicago, we should be able to see all the employees of Chicago in the same column, like that if we click on drill down on each loc_name, we should be able to see employees related to that location under the loc_name column, not in the different column. when i try am getting in different column.
How to do this in SSRS? i did this using grouping and visibility feature hidden by toggle, but am able to see employee names, but on top of them am not able to get employee as heading.
Below I am sending the code (creating the tables/inserting the data/ and retrieving the data). please try to run the query with the data I sent. you will see the same data as it is in the below image.


