tsql - SumDistinct Within a Group in SSRS -


i have ssrs report displaying data on per-day basis in matrix. using left side (up-to-down) display total of entities grouped day. using top side (left-to-right) display break-down of different types of entries summed in row.

eg: dataset:

day typ cnt amount  exp mon 1   3   001000  400 tue 1   4   000200  400 wed 1   0   000000  400 thu 1   1   000020  400 fri 1   5   002100  400 mon 2   2   001000  200 tue 2   0   000000  200 wed 2   2   005000  200 thu 2   0   000000  200 fri 2   20  250000  200 

output:

||  day cnt amount  exp ||  typ cnt amount  typ cnt amount ||  mon 5   002000  600 ||  1   3   001000  2   2   001000  tue 4   000200  600  1   4   000200  2   0   000000 dwn wed 2   005000  600 dwn 1   0   000000  2   2   005000 ||  thu 1   000020  600 ||  1   1   000020  2   0   000000 ||  fri 25  252100  600 ||  1   5   002100  2   20  250000 

the caveat want sum-by-distinct-type exp column (expected amount).

normally sum/ group in query, 1 requirement of report display each individual entry on detail page (in addition output described above) , query prohibitively heavy.

hopefully formatted output not hard decipher; left side (surrounded ||||up dwn||||) grouping on day, sum(cnt), sum(amount), sumdistinct(exp). , right side "matrix", grouped on typ. sumdistinct(exp) (distinct typ column) part having trouble with.

normally sum/ group in query, 1 requirement of report display each individual entry on detail page (in addition output described above) , query prohibitively heavy.

if have this, define called ""subreport" @ of first, separated page-break. not sure program using building reports, should allow create report details save , add main report sub-report.


Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -