简体   繁体   中英

SSRS column and line chart?

Hello I have a simple dataset in SQL that counts meter readings... There are meter readings every day and I would like to SUM the count, display that in a column chart at a daily interval. What I would also like to do is display a cumulative count as a line so 4 orders Monday, 3 orders Tuesday, 5 orders Wednesday 4+3+5 etc. Apparently there is a running total property I read somewhere in SSRS? Does anyone know how to do this? I'm stumped! I currently have a SUM of count as my total value with category group of date read but it does not seem to be displaying properly. Instead of saying 5 orders on tuesday, it is just showing 1,1,1,1,1 etc...

SELECT     COUNT(readingId), dateRead
FROM         Readings
WHERE     (dateRead BETWEEN @StarDate AND @EndDate) AND (webcontactid IS NOT NULL) AND (meter = 1)
GROUP BY Readings.dateRead

如您所见,3月19日丢失了,因为我发现没有数据...有什么办法可以使它显示为0或什么都可以显示为空?

I created a bar chart, put dt as Category group, added a fake Series group called g1 (Group by "A"), and used two data fields, one with the expression

=Sum(Fields!NReadings.Value)

and one with the expression

=RunningValue(Fields!NReadings.Value, Sum, "g1")

and set this to appear as a line.

I got this on SSRS 2005, but I hope it helps for 2008. If anyone has a way to do this without creating a fake Series, then please let me know.

在此输入图像描述

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