如何在每月的基础上自动生成相同SQL表字段中的差异报告?

时间:2021-05-25 15:29:36

I have a T-SQL view with integer fields. I need a report on a monthly basis regarding the difference from one month to the next, i.e. so many people were engaged in a particular activity on 8am of the 1st of this month, so many the previous month, here is the difference. The numbers fluctuate all the time. I need a variance between 2 snapshots in time.

我有一个带整数字段的T-SQL视图。我需要每月报告一个月到下一个月的差异,即很多人在本月1日上午8点参与了一项特定活动,上个月这么多,这就是区别。这些数字一直在波动。我需要及时在2个快照之间出现差异。

I am using the SSRS, however in reporting services I can only display the "current" situation. I could run a report at 8am of the 1st of each month and then calculate the differences manually. But how could I automate this calculation and then report on the difference?

我正在使用SSRS,但在报告服务中,我只能显示“当前”情况。我可以在每月1日上午8点运行报告,然后手动计算差异。但是,我怎么能自动计算这个计算然后报告差异呢?

I have tried to import data from SQL to 1 Excel spreadsheet from 1 month, then to the 2nd spreadsheet from the 2nd month. The 3rd spreadsheet calculates the difference. But how do I create a nice looking report from Excel?

我试图从1个月将数据从SQL导入到1个Excel电子表格,然后从第2个月导入到第2个电子表格。第3个电子表格计算差异。但是如何从Excel创建漂亮的报告呢?

Additionally I cannot send the report by email. It has to be available online.

另外,我无法通过电子邮件发送报告。它必须在线提供。

Furthermore, each office wants their figures to be confidential and not visible to another office.

此外,每个办公室都希望他们的数字是保密的,而另一个办公室则看不到。

Thanx in advance.

提前完成。

1 个解决方案

#1


Can you add a UserCount table that stores each office's user count for each month? It could have columns like:

你能添加一个UserCount表来存储每个办公室每个月的用户数吗?它可能有以下列:

  • id
  • date
  • user_count
  • office_id

You would insert a new row each month based on what the view tells you that month for each office. Then it's as simple as exporting that table to Excel and graphing it using Excel's built-in graphing tools.

您将根据视图告诉您每个办公室的月份,每月插入一个新行。然后就像将表格导出到Excel并使用Excel的内置图形工具绘制图表一样简单。

#1


Can you add a UserCount table that stores each office's user count for each month? It could have columns like:

你能添加一个UserCount表来存储每个办公室每个月的用户数吗?它可能有以下列:

  • id
  • date
  • user_count
  • office_id

You would insert a new row each month based on what the view tells you that month for each office. Then it's as simple as exporting that table to Excel and graphing it using Excel's built-in graphing tools.

您将根据视图告诉您每个办公室的月份,每月插入一个新行。然后就像将表格导出到Excel并使用Excel的内置图形工具绘制图表一样简单。