RAD Studio
ContentsIndex
PreviousUpNext
Creating Decision Datasets with the Decision Query Editor

All data used by the decision support components passes through the decision cube, which accepts a specially formatted dataset most easily produced by an SQL query. See Using datasets with decision support components for more information. 

While both TTable and TQuery can be used as decision datasets, it is easier to use TDecisionQuery; the Decision Query editor supplied with it can be used to specify tables, fields, and summaries to appear in the decision cube and will help you set up the SELECT and GROUP BY portions of the SQL correctly.

To use the Decision Query editor

  1. Select the decision query component on the form, then right-click and choose Decision Query editor. The Decision Query editor dialog box appears.
  2. Choose the database to use.
  3. For single-table queries, click the Select Table button. For more complex queries involving multi-table joins, click the Query Builder button to display the SQL Builder or type the SQL statement into the edit box on the SQL tab page.
  4. Return to the Decision Query editor dialog box.
  5. In the Decision Query editor dialog box, select fields in the Available Fields list box and assign them to be either Dimensions or Summaries by clicking the appropriate right arrow button. As you add fields to the Summaries list, select from the menu displayed the type of summary to use: sum, count, or average.
  6. By default, all fields and summaries defined in the SQL property of the decision query appear in the Active Dimensions and Active Summaries list boxes. To remove a dimension or summary, select it in the list and click the left arrow beside the list, or double-click the item to remove. To add it back, select it in the Available Fields list box and click the appropriate right arrow.
Once you define the contents of the decision cube, you can further manipulate dimension display with its DimensionMap property and the buttons of TDecisionPivot. For more information, see Using decision cubes,Using decision sources, and Using decision pivots.
Note: When you use the Decision Query editor, the query is initially handled in ANSI-92 SQL syntax, then translated (if necessary) into the dialect used by the server. The Decision Query editor reads and displays only ANSI standard SQL. The dialect translation is automatically assigned to the TDecisionQuery's SQL property. To modify a query, edit the ANSI-92 version in the Decision Query rather then the SQL property.

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!