COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: BiliBoy on 22 Nov 2013 10:55:21 AM

Title: Indifferent result with aggregation
Post by: BiliBoy on 22 Nov 2013 10:55:21 AM
Hello  Experts, need some help here,

I have following situation

SN         CERTICODE   CERTIRESULTS
11111      A                 P
11111      A                 P

I have to count number of CERTIRESLUTS FOR SN, when i use this formula
count ([SN] for (if ([CERTIRESULTS='P') then (1)else (0)))  i get count of 2 which is fine  but when i tried to use same formula in different report which has several data items with 'TOTAL' aggregate function and 'Automatic' rollup aggregate. In my second report i get count of 152 with the same formula  so what am i doing wrong? please help. AutoGroup and summarize for the query in my second report is 'Yes'.

Both these reports have  SN,CERTICODE ,CERTIREULTS  in them.
Title: Re: Indifferent result with aggregation
Post by: Lynn on 22 Nov 2013 11:16:10 AM
How about just this expression with aggregate function set to count.

if ([CERTIRESULTS='P') then ([SN]) else (null)