COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Query Studio => Topic started by: jhodes on 10 Sep 2009 12:19:54 PM

Title: Subquery-like behavior in Query Studio 8.3?
Post by: jhodes on 10 Sep 2009 12:19:54 PM
Hi All, I'm relatively new to the Cognos world, so forgive the naievete of this question. I want to generate a report in Query Studio that produces the following:

Unique Patients for 2008
Gender    # Patients
male      13,044
female    15,304

My underlying data and metadata is based on visits, not unique patients. So first I think I need to do a count distinct or something similar to get the unique patients. And then group/summarize by gender.

I can do this easily in straight SQL by writing a subquery that gets the distinct patients, then grouping and counting in an outer query. I'm sure I can do this in Report Studio -- but can this sort of thing be done in Query Studio?

Thanks in advance for your help.
Title: Re: Subquery-like behavior in Query Studio 8.3?
Post by: lindero on 30 Sep 2009 05:22:14 AM
IMHO QueryStudio generates always only one query. You are not able to create your own subqueries. it is only possible as you already mentioned in ReportStudio.