简体   繁体   中英

SSRS BIDS Reporting Group By Header

在此处输入图片说明

Does anyone know how to make it so that when there are multiple records for a month (See image) there is only one line of data rather than splitting it into 4 boxes.

For example see June, I want this to have one box for RFC days and one box for Project days.

I have grouped by so far:

Row Groups - Service, MonthName

Column Groups - classification Management Studio视图-如果有帮助

You could do it by using grouping and sum the values at the group level and hide the detail line.

However, the easiest thing to do is do it in SQL using nested queries, like so (you probably also want to order by the month number rather than name, as shown below):

SELECT Service, Month(DateField) AS MonthNumber, 
    MAX(DatePart(Month, DateField)) AS MonthName, 
    SUM(ProjectDays) AS ProjectDays, SUM(RFCDays) AS RFCDays
FROM (
    SELECT Service, DateField, Days AS ProjectDays, 0 AS RFCDays
    FROM Project
    UNION ALL
    SELECT Service, DateField, 0 AS ProjectDays, Days AS RFCDays
    FROM RFC
)
GROUP BY Service, Month(DateField)
ORDER BY Service, Month(DateField)

I found that I had to GROUP BY my MONTH field so I dragged this into the group by row groups, right clicked on it from here and in Group Properties added a group expression. 在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM