0

我创建了一个为用户提供多个选项的参数:

Total Amount = Grand Total
Region 1 = Total Amount for that Region
Region 2 = Total Amount for that Region
Region 3 = Total Amount for that Region
Region 4 = Total Amount for that Region

区域 1 到 4 效果很好,但是当我选择总金额时,我得到的金额不正确。

有人可以告诉我我做错了什么吗?

主要数据集

     SELECT       OccupancyDetail.CalendarYear, OccupancyDetail.CalendarMonth, SUM(OccupancyDetail.No_of_Nights) AS No_of_Nights, 
                         SUM(OccupancyDetail.Capacity) AS Capacity,Site.BDM,Site.Region
FROM            OccupancyDetail INNER JOIN
                         Site ON OccupancyDetail.Site_Skey = Site.Site_Skey

                         WHERE  (OccupancyDetail.ReferenceDate = convert(Date,getdate()))

                         AND
                         CASE WHEN @Time = 'YEAR' THEN CAST(CalendarYear as varchar(4)) else
                         CalendarMonth + ' ' + CAST(CalendarYear as varchar(4)) end in (@Dates)
GROUP BY OccupancyDetail.ReferenceDate, OccupancyDetail.CalendarYear, OccupancyDetail.CalendarMonth,Site.BDM, Site.Region    
Time Dataset

select DateChoice FROM
(select distinct CalendarYear, 1 as MonthNumber,CAST(CalendarYear as varchar(4)) as DateChoice from Time
where @Time = 'YEAR'


union all

select Distinct CalendarYear, MonthNumber,CalendarMonth + ' ' + CAST(CalendarYear as varchar(4)) as DateChoice from Time where @Time = 'MONTH') as QRYDATA
ORDER BY CalendarYear,MonthNumber

BDM 数据集

SELECT DISTINCT BDM
FROM Site
4

1 回答 1

0

Reporting Services 参数在定义多个值参数时提供内置(Select All)值。

选择所有参数

对于您的示例:

  1. Total Amount = Grand Total从参数的可用值列表中删除该选项。
  2. 修改您的数据集查询以接受 region 参数的多个值。例如:... WHERE REGION IN (@Region)
  3. 检查Allow multiple values参数属性中的选项 多值参数
  4. (Select All)替换Total Amount = Grand Total原始设计中的。
于 2013-03-06T14:28:10.537 回答