COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: mycognosangel on 30 Jan 2017 10:15:20 AM

Title: Creating a Query from another Query in Cognos Studio
Post by: mycognosangel on 30 Jan 2017 10:15:20 AM
PLEASE PLEASE. I need a final help which will fix this problem. I want to retrieve some columns in a query as another query entirely. e.g Based on a query like this:


Query SampleA

Zone         Year         Country         Link
AAA           2000          NG              001
BBB           2001          US              009
CCC           2009          UK              004.

So I want to create a Query SampleB based on query SampleA in order to retrieve two columns. Ofcourse I could do it easily with SQL, but could a good samaritan be kind to let me know the detailed procedure for retrieving this information as a query based on the initial query?

Zone                 Country         
AAA                    NG             
BBB                    US               
CCC                    UK     
Title: Re: Creating a Query from another Query in Cognos Studio
Post by: BigChris on 30 Jan 2017 10:33:42 AM
Just drag another query in and then pull Query Sample A to the right of it. It'll create a shortcut to the first query and you can then use those two fields in your new query.
Title: Re: Creating a Query from another Query in Cognos Studio
Post by: mycognosangel on 30 Jan 2017 10:40:42 AM
I am not getting this
Title: Re: Creating a Query from another Query in Cognos Studio
Post by: hespora on 31 Jan 2017 02:18:37 AM
- Hover over the query explorer, click on queries
- From the toolbox on the left hand side, drag and drop a query object into the report objects on the right hand side
- within your report objects, drag and drop your original query directly to the right of the new query

The result should look like the attached. Now, "new query" will not point at the datasource, but at "original query"'s result set.