Query Wizard

Use the query wizard to generate new queries and edit existing ones.

In order to edit an existing query, in the module containing the text of the query place your cursor anywhere in the query text and select Text – Query Wizard or Text – Query wizard with results processing menu item.

In order to create a new query, in the module containing the text of the query place your cursor where the query text is supposed to be added and select Text – Query Wizard or Text – Query wizard with results processing menu item.

The query wizard will appear on the screen.

Using the Next > buttons, work your way through the tabs and select the desired source data, specify the groupings and conditions, set the desired order, and describe the total data. The wizard will create a form and a template, which will be placed on the appropriate branches.

To edit the data, use the < Back button.

 

On the Tables and fields tab in the Database section select the required objects and drag them to the Tables and Fields section.

On the Grouping tab you can select the properties to group by, if required.

On the Conditions tab, you can specify the conditions to filter the source data by, if required. For each selected field, choose the type of condition and specify the parameter name.

On the Conditions tab generate additional query parameters if required: define a selection of records and type of the query as well as the tables that should be blocked from subsequent changes.

On the Unions/Aliases tab, select the properties to group by, if required. The table shows the mapping between the selected fields and the source data. You can change the field names and mappings. To change the name, select the field and press Enter. Then enter the new field name. To change the match, select the desired row in the “Query” column and press Enter. In the drop-down list, select the desired value.

On the Order tab, specify the order in which the resulting information will appear, if necessary.

On the Totals tab, specify by which fields the subtotal and overalls should be displayed, if required.
If you click the >> button next to the group fields, all the reference fields will be placed in the fields for grouping. If you click the >> button next to the summable fields, all numerical fields will be placed in the list of summable fields.

On the Report Builder tab, customize the report builder settings. Select tables and fields, specify conditions and order of presentation, and describe the total data. The Report Builder tab is only displayed for the wizard opened using Text – Query Wizard command.

If the query wizard is opened from the data composition schema wizard, the wizard will also have the Characteristics tab.

The desired characteristics are defined on the Characteristics tab.

In the Type column specify the type of the field to which the described characteristic will belong. In the Source of types column specify whether the characteristics list is obtained from a database table or from query results. In the Characteristic types field select the required table or create a query using the query wizard if query is to be used as a source. In the Field of name column select the field containing the characteristic name. In the Field of value type column select the field containing the characteristic value type. A null value in this column will mean that the characteristics has  the same type as the Field of value that contains the characteristic value. If the field of characteristic value is not specified then it is considered that the characteristic has the Boolean type.Boolean type.

In the second column named Source of values specify the source of the characteristics value list. In the Characteristic values column specify the table name or query to get the characteristics values. In the Object field column select the field containing the object identifier. In the Field of type column select the field containing the characteristic identifier. In the Field of value column select the field containing the characteristics value. When the null value is chosen, the characteristic value will be True if the object has this characteristic, or False otherwise.

The Query Batch tab enables you to create a succession of batch queries when working with batch queries. You can edit and configure each query in the same window, and all previous tabs allow you to switch between the queries being configured using the tabs located along the right border of the query wizard.

Use the Results Processing tab to customize how the results are displayed.

Specify the type for data processing: result bypass, output to a table or to a chart. Depending on the selected presentation, a corresponding settings page will be added to the wizard.

For a spreadsheet document you can specify how groupings and attributes will be arranged. The settings have explanatory labels.

For charts, select the chart type.

If the results are output to a table document, a table output template is created in the metadata object which module or form module calls the query. The template is modified if the wizard is used again. This template is deleted if the previous wizard was intended for output to a table document but when editing the query with the wizard another output form is selected. For shared modules shared templates are created.

 

You can view the query text anytime while constructing the query by clicking the Query button.

1C:Enterprise Developer's Community