This topic describes how to use a query control to query data based on a text field.
- A dashboard is created.
- A query control is created on the dashboard. For more information, see Create a query control.
- Select the created dashboard. It contains the following chart and query control.
- Click the New filter icon in the query control. In the Query condition setting dialog
box that appears, configure the following parameters:
- Set the query condition name to Order query.
- Select Line chart and the order_level field to associate with the query control.
- Set Display type to one of the following values:
Drop-down list (formally enumerated filter)When Display type is set to Drop-down list (formally enumerated filter), you can set Option value source to Automatic parsing, Single data set, or Enter manually. Option value source indicates the source of available values of the query condition field.
- When Option value source is set to Automatic parsing, the values of the query field are automatically parsed. Up to 1,000 values can be displayed.
- When Option value source is set to Single data set, you can select a dataset in the
workspace of the current dashboard. We recommend that you select the dataset of the
associated chart. The relationships between the associated field, Query Value Field,
and Query name field are as follows:
- The associated field is the field you want to associate with the query control in the chart.
- Query Value Field is the field in the source dataset that is used to match the associated field.
- Query name field is the field in the source dataset that is used to filter data. This field is displayed in the query control.
- Query name field is the same as Query Value Field by default. After you specify Query Value Field, Query name field is automatically set. If the two values are inconsistent, you must manually specify the same value for the two fields.
- When Option value source is set to Enter manually, click the icon. In the manual input dialog box that appears, specify Query value and show name.
- If it is the first time that you manually enter the values and Query value and show name are consistent, you only need to specify Query value. After you click OK, show name is automatically set.
- If it is the first time that you manually enter the values and Query value and show name are inconsistent, you must manually specify both values.
- If it is not the first time you manually enter the values, you must manually enter the new query value and the show name. If you enter only the query value, the following error message is displayed.
Text input box (formally conditional filter)When Display type is set to Text input box (formally conditional filter), Conditional form can be set to Single condition, Or condition, or And condition. In this example, Conditional form is set to Or condition.
Tree dropWhen Display type is set to Tree drop (formally cascading query), fields from both the current dataset and another dataset can be selected. Display form can be set to Tree display or Tiled display. Follow these steps to configure Tree display:
Note Quick association is enabled by default. This feature automatically selects associated charts and fields in the same dataset for sub-levels of a tree structure. Click Association chart in the tree structure or the sub-level name in the left-side navigation pane to associate the sub-level with charts and fields in another dataset.For example, after you click Association chart next to the second level area, associated fields of Line chart 1 and Line Chart 2 that are created based on the same dataset are automatically selected. However, the associated field of Vertical car chart that is created based on another dataset must be manually entered.
- Select a dataset and click Start configuration.
- In the Tree structure design dialog box, specify Query Value Field and Display name field for each level.
- The value of Display name field is the same as that of Query Value Field by default. If the values are inconsistent, you must manually specify the same value for the two fields.
- Up to four levels are supported.
- Click OK.
- Click OK.
- In the query control, click Inquire. The chart to which the query control applies is updated. The following figure shows the query results when Display type is set to Tree drop.