SSRS 图表中按月和周分组
我在 SSRS 2008 R2 中有一份折线图报告。当我在图表中进行分组时,我首先按年分组,然后按月分组,然后按周分组,然后得到 Sum(Count) 作为数据值。(见下文)
Count Date Week Month Year
10 datex 26 6 2010
15 datey 26 7 2010
但是,如果我有如上所述的一条数据,则周数会重复并且图表发现其中之一有倾角。这是因为日期属于同一周但不同月份。
有什么办法解决这个问题吗?我确信这是一个已知的问题,但在互联网上找不到太多。
编辑:这是我得到的图表
感谢您的帮助。
I have a got a line graph report in SSRS 2008 R2. when I do the grouping in graph I first group by year, then month, then week and I get Sum(Count) as data value.(see below)
Count Date Week Month Year
10 datex 26 6 2010
15 datey 26 7 2010
However, if I have a piece of data as above, week numbers are duplicated and graph finds dip in one of them. it is because dates belong to same week but different month.
Is there any way to get this around? I am sure it is a known problematic, but could not find much on the internet.
Edit: here is the graph I get
Thanks for your help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在计算周/月之前,请调整日期,以便将一周内发生的所有事情移至一周中的特定日期(例如星期三)。
对于 2010 年,6 月 30 日是星期三,因此 6 月 28 日到 7 月 4 日之间的所有内容都将移至 6 月 30 日。然后,周将是 26,月份将是 6 月。第 26 周和 7 月的数据点随后将消失。
此链接可能会有所帮助:
如何获取最后一天sql 周?
Before you calculate week/month, adjust the date so that everything that has happened in a week is moved to a specific day in the week (say Wednesday).
For 2010, Jun 30 was a Wednesday, so everything between Jun 28 and Jul 4 would be moved to Jun 30. The week would then be 26, and the month June. The datapoint for week 26 and July will then disappear.
This link might help:
How to get last day of last week in sql?