COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: Una_R on 23 Dec 2013 07:32:23 AM

Title: newbie help please - query to check and agregate mulitple rows
Post by: Una_R on 23 Dec 2013 07:32:23 AM
I have the following returned from a query

test a : result 1
test a : result 2
test a: no result
test b: no result
test c: no result
test c: result 4

and I want to generate a table showing tests which have AT LEAST 1 result

so
test a: has result
test b: has no result
test c: has result

I am very confused by the summary and aggregation documentation - is there a way to do this?

Thanks very much
Title: Re: newbie help please - query to check and agregate mulitple rows
Post by: HalfBloodPrince on 23 Dec 2013 10:32:17 AM
try this
create count _calculation as

if (UPPER([Tes_Result_Column])contains 'TEST RESULT') then
(1)
else
(0)

then create another calculation as

if (total (count _calculation  ) >=1) then

('Has result')
else
('Has No Result')
Title: Re: newbie help please - query to check and agregate mulitple rows
Post by: Una_R on 07 Jan 2014 02:32:01 AM
Thanks very much for your help
This worked

Title: Re: newbie help please - query to check and agregate mulitple rows
Post by: Una_R on 07 Jan 2014 07:25:52 AM
Hi again

One last piece in the puzzle

I want to present a simple summary of the query data

test case   test case status
test 1    single result
test 2    no result
test 3    no result
test 4    single result
test 5    more than one result


summary should be

no result  2
single result 2
more than one result 1

This is driving me crazy as I thought I could just use the count distinct on the test case name (as I have in other reports to produce pie charts), but this always returns just one test case status ("more than one result")

Is there a standard way to do this?

Thanks again