I've a report to show a summary by users, getting data from 2 database. I wrote individual dataset to get it for each column, but as the values could be come duplicate , I don't know how can I get all the records of each user
I'm using UNION ALL
in my query to get the data from 2 databases
MainDataset
Select Count(*) as total, Username from database1
where my condition...
group by Username
UNION ALL
Select Count(*) as total, Username from database2
where my condition...
group by Username
Username Total
User1 2
User2 1
User3 3
User4 4
User5 10
User6 5
Dataset 2
Select Count(*) as totalCol2, Username from database1
where condition for this column...
group by Username
UNION ALL
Select Count(*) as totalCol2, Username from database2
where condition for this column...
group by Username
Username totalCol2
User1 2
User2 1
User2 1
User3 3
User3 2
User4 1
User5 2
User5 3
User6 4
I'm using MainDataset
to show the rows in my report and for each column I need to show summary from Dataset2
:
Username Total totalCol2
User1 2 2
User2 1 2
User3 3 5
User4 4 1
User5 10 5
User6 5 4
I tried to use lookup but only got the first match from dataset2, sum function with condition but doesn't work as well. Can someone give me some idea if can I do something in SSRS.
The report have more than 10 column and each one come from differents dataset.