我有一个数据集,一个 sql 查询的输出,它给了我以下输出:
Year Month TotalSales TotalProducts
2013 1 23233 45
2013 2 3344 43
2013 3 232 11
2013 4 2232 23
我正在尝试使用 SSRS 在表格和条形图中表示上述数据集。
有没有办法可以将几个月限制在 SSRS 的最后三个月?
我在 SSRS 中使用当前月份作为参数。
例如:我选择第 4 个月作为参数,我想在条形图和表格中仅查看第 4,3 和 2 个月的结果
有什么办法可以做到吗?
实际查询如下所示:
SELECT ISNULL(x.[Month],z.[Month]) AS [Month],
ISNULL(x.Sum_Stores, 0) - ISNULL(y.Sum_SalesStores, 0) AS Difference , ISNULL(Sum_onetonine, 0) as EcontractsbetweenOneandNine........................
FROM
(
SELECT [Month], Sum(Stores) AS Sum_Stores
FROM SUM_XXX
WHERE [Year] = '2013' and Name = 'Pro'
GROUP BY [Month]
) AS x
FULL OUTER JOIN
(
SELECT [Month], Sum(tracts) AS Sum_SalesStores
FROM SUM_yyy
WHERE [Year] = '2013' and Name = 'Pro'
GROUP BY [Month]
) AS y ON x.[Month] = y.[Month]
............................