You can reuse existing queries from Cognos®
Analytics
reports by copying either individual queries or entire report specifications into data sets.
The data set and the report from which you copy the queries must be based on the same type of
data source, either a data module or a package.
When you copy an individual report query, you add the query to the data set, and can continue
working with the data set.
When you copy the report specification, the data set is overwritten and you can use the query (or
queries) from the report in the data set. The report layout is not copied. The data set is renamed
to the default New data set. You can then save it as a new data set.
Procedure
-
Create or open an existing data set.
- From Team content or My content, open the
Cognos Analytics report in the edit mode.
- Use the following steps to copy an individual query into your data set:
- In the report, from the Report menu, click
Queries to open the report Queries
view.
- Right-click the query that you want to copy, and click
Copy.
- Go back to the data set, and from the Data set menu, click
Queries.
- Right-click anywhere in the empty space in the Queries view,
and click Paste. The new query is added to the view.
- Save the data set.
- Use the following steps to copy the report specification:
- From any page in the report, click the More icon , and select
Copy report to clipboard.
- Go back to the data set, click the More icon , and select
Open report from clipboard.
- Paste the report specification into the empty box that is displayed, and click
OK.
You are back in the data set list view. The data source and the query in the data set were
replaced. The data set name is shown as New data set, even if you started
with a data set named differently.
- Open the Queries view. All queries from the report are copied
into the data set.
- Save the data set using the Save as option.
- From the Data set menu, click
. You are back in
the data set list view.
- Click the Reset button to break the list association with the
previous query.
The data items are removed from the list. You can now add data items from a different query,
including the copied report queries, to the list.
- In the Insertable objects pane, click the Data
items tab .
The report queries and their data items are shown in the tab.
- Drag items from one query to the data set list.
- Save the data set.
Results
Here is an example of the Queries view after a query labeled
Report query was copied into the data set. The report query was joined with a
preexisting query labeled Initial query.
Later, the data items from the
Joined query were used to populate the list in the data set.