How do I use the For clause to create a sum or total of an aggregated column in Cognos report studio? -
how use sum in cognos report studio final policy premium?
table 1 result (highlighted in blue) if set data item (final policy premium) total. goal see results shown in table 2 (highlighted in yellow).
note: removed other columns think not needed support question. columns removed ones see in query.
select a.[policy number], b.[final policy premium], a.[gwp amt], a.[transaction type code], a.[insured], a.[cancellation effective date], a.[transaction date] [modified date], a.[cancellation type code], a.[cancellation reason code], a.[policy transaction type code] dw.table inner join (select sum([gwp amt]) [final policy premium], [policy number] dw.table [policy number] in ('1111111', '2222222') group [policy number]) b on a.[policy number]=b.[policy number] a.[policy number] in ('1111111', '2222222') group 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 a.[policy number]
i found answer! total([dw.table].[gwp amt] [policy number]) inside data item expression definition. change properties of data item aggregate function = calculated.
Comments
Post a Comment