4.5.2 Creating a Derived Query
In some cases, you may want to create a set of closely-related queries (i.e., sharing the same data source, tables, joins, grouping) that differ from one another only in terms of the fields retrieved or conditions applied. To do this, design a single “base” query, and then create a set of “derived” queries from the base query. Derived queries can modify the columns retrieved by the base query, and can impose additional conditions.
To create a new query based on an existing query, follow the steps below:
1. Open the Asset panel, and expand the 'Data Source' node.
2. Expand the data source that contains the query you want to modify.
3. Right-click on the query from which you want to derive the new query, and select 'New Derived Query' from the context menu. This opens the 'Query Wizard' dialog box.

4. Specify information in the General, Fields, and Condition tabs of the 'Query Wizard' dialog box as described in Creating a New Query. The settings you add here will modify the settings already in place for the “base” query.

5. Click 'Finish'. This opens the new derived query for editing. (Note that the base query is displayed at top.)

6. Make any desired changes in the editor, and click the Preview tab at bottom to view the results.
7. Click 'Save' in the Style Studio toolbar to save the new derived query to the repository. The new query will appear as a node under the associated data source.
Queries that you create using the tabs in the Query Wizard are automatically parsed (by default) and converted into SQL statements. To view (and optionally edit) the generated SQL string, see Editing a Query SQL String.
| << 4.5.1 Creating a New Query | © 1996-2013 InetSoft Technology Corporation (v11.5) | 4.5.3 Editing a Query >> |