如何在Cognos report studio中使用总和最终保单?
表1是我目前得到的结果(以蓝色突出显示),即使我将数据项(最终政策溢价)设置为总计。我的目标是看到结果如表2所示(以黄色突出显示)。
注意:我删除了其他列,因为我认为不需要支持我的问题。删除的列是您在我的查询中看到的列。
Select
a.[Policy Number],
b.[Final Policy Premium],
a.[GWP Amt],
a.[Transaction Type Code],
a.[Insured],
a.[Cancellation Effective Date],
a.[Transaction Date] as [Modified Date],
a.[Cancellation Type Code],
a.[Cancellation Reason Code],
a.[Policy Transaction Type Code]
from DW.Table a
inner join
(Select SUM([GWP Amt]) as [Final Policy Premium],
[Policy Number] from DW.Table
where [Policy Number] in ('1111111', '2222222')
group by [Policy Number]) b
on a.[Policy Number]=b.[Policy Number]
where a.[Policy Number] in ('1111111', '2222222')
group by
a.[Policy Number],
b.[Final Policy Premium],
a.[GWP Amt],
a.[Transaction Type Code],
a.[Insured],
a.[Cancellation Effective Date],
a.[Transaction Date],
a.[Cancellation Type Code],
a.[Cancellation Reason Code],
a.[Policy Transaction Type Code]
order by a.[Policy Number]
答案 0 :(得分:0)
我找到了答案!数据项表达式定义中的总计([DW.Table]。[策略编号]的[GWP Amt])。将数据项的属性更改为聚合函数=已计算。