Specifying queries for visual projects

Visual projects (visual reports or dashboards) can include one or more queries to run to obtain the result data and display it in the visual project.

About this task

You can create a new query that will be included in the visual project or you can use existing queries.

To specify a query for a visual project, perform the following steps:

Procedure

  1. From the Project Explorer view, right-click the Queries node and select Insert Query from the menu.
  2. Specify a unique name for the query in the Query name field.
  3. Identify the query and specify where it resides in one of the following ways:
    1. If you are creating a new visual query, select Create a new visual query.
    2. If you are creating a new analytical query, click Create a new analytical query.
    3. If you are creating a new Cloudant query, click Create a new cloudant query.
    4. If you are creating a new forecast, click Create a new forecast.
    5. If the query exists, select Attach to an existing query . The Select query list appears. Specify the name of the query and where it resides in the Select Query field. You can click Browse to search for the query.
    6. If you would like to insert a static query, select From file.
      • Select Insert Data to copy the query directly into the Queries folder. This option provides greater portability, because the query will stay with the visual project if it is moved from one system to another.
      • Select Use link to file to create a link to the query's system directory location. This option limits portability, because if the visual project is moved from one system to another, the query will no longer be available.
      • Specify the query to be added in the Select data file list. You can click Browse to search for the query.
      Note: You can open DBF, IXF, XML, and TAB files and use them as queries. You can edit the imported result set by filtering, adding calculated columns, applying grouping and aggregation. When you save the visual project, these files can be converted to dynamarts and saved with the visual project. All modifications will be preserved.
  4. If you insert a visual query or a Cloudant query, you must select a data source connection that you want to use for the query from the Connection list. If the Connection list is empty, add a data source connection to a visual project.
  5. Click Add Connection to open the Insert Connection window.
  6. From the data sources tree, select the data source that you want to add for the visual project and click Finish.
    The data source connection that you selected is added to the visual project and displayed in the Connection list.
  7. If you are inserting an existing forecast or analytical query into a visual project, you can edit connection settings for subordinate queries in the Edit Connections window.
  8. If you are inserting a new forecast or analytical query you cannot set connections for subordinate queries because these queries are not specified yet.
  9. Click Finish. The Project Explorer view lists the query under the Queries node in the tree. If the query requires a parameter, a Parameters folder is added. You will automatically save the query when you save the visual project.

Results

Note: You can also add a query by dragging the query from the Workspaces view to the Queries node of the visual project in the view. The selected query is added to the Queries folder. A new data source connection is automatically added to the Connections folder of the Project Explorer view.