Cognos: Best Practice: Naming Queries in Report Studio

By default when you create a list report or graph in Report Studio it calls the query ‘Query 1’. Whilst this is not confusing when you have only the one query, it can become difficult to find what you are looking for when there are multiple queries and/or prompt queries.

Cognos: Best Practice: Naming Queries in Report Studio

So a good habit to get into is to give each of the queries a name that has some meaning.

For example if you have a report that has the following:

  • List Report – for Quantity
  • Graph – for Revenue
  • Prompts for Region and Sales Person

You might name your queries as follows:
Cognos: Best Practice: Naming Queries in Report Studio
You will notice that the prompt queries have ‘p_’ at the beginning. Not only does this distinguish the prompt queries from the queries that are being used in lists or charts, but it allows you to call another query say ‘Region’ if you are reporting on this separately.

So how do you rename the Query?

In Report Studio, click on the Query Explorer window
Cognos: Best Practice: Naming Queries in Report Studio

And a Query Explorer pane will appear. Click on the Queries folder

Cognos: Best Practice: Naming Queries in Report Studio
Then single click on the Query that you want to rename. You will notice that the ‘Properties – Query’ pane now appears:
Cognos: Best Practice: Naming Queries in Report Studio

Scroll down, and you will see the name of the Query is ‘Query 1’.
Cognos: Best Practice: Naming Queries in Report Studio

Click on the Query 1, and type in the new name and hit Enter for it to accept the new name. Repeat steps for all queries.
Cognos: Best Practice: Naming Queries in Report Studio