This topic describes how to configure a filter bar to query data based on a text field.

Prerequisites

  • A dashboard that contains text fields is created.
  • A filter bar is created on the dashboard. For more information, see Create a filter bar.

Configure a filter

  1. Go to the dashboard editing page. For more information about how to go to the dashboard editing page, see Create a dashboard.
  2. Find the charts for which you want to configure a filter bar.
    Charts that are created on the dashboard must contain text fields. For more information, see Line chart. 1
  3. In the filter bar that appears in the dashboard display section, click the New filter icon to configure the filter bar.
    1
    1. In the Query Conditions section of the Set Query Conditions dialog box, set the filter name to Order Level.
    2. In the Associated Charts and Fields section, select Line Chart and then select order_level from the drop-down list for Line Chart.
    3. Specify Display Type in the Basic Configuration section as required.
      • If you select Drop-down List (Formerly Enumerated Filter) from the Display Type drop-down list, see the use case in Drop-down List (Formerly Enumerated Filter).
      • If you select Text Input Box from the Display Type drop-down list, see the use case in Text Input Box.
      • If you select Tree Drop from the Display Type drop-down list, see the use case in Tree.
  4. Click OK.

Drop-down List (Formerly Enumerated Filter)

If you select Drop-down List (Formerly Enumerated Filter) from the Display Type drop-down list, Option Source can be set to Automatic Parsing, Single Dataset, or Manual Input. The following figure shows that Option Source is set to Automatic Parsing. Drop-down list 3.12.1
Note
  • If the data in the charts selected from the Associated Charts and Fields section belongs to the same dataset, Automatic Parsing indicates that the system automatically obtains data from the dataset.
  • If the data in the charts selected from the Associated Charts and Fields section belongs to multiple datasets, Automatic Parsing indicates that the system automatically obtains data from multiple datasets. This means that the values in the drop-down list of a filter bar are from multiple datasets.
Table 1. Automatic Parsing
Parameter Description Example
Query Mode Valid values: Single Choice and Multiple Choice. Multiple Choice.
Query Time Valid values: Click to Query and Pre-query.
  • Click to Query: This is the default value. When you click Inquire on the right side of the filter bar on the preview page, a conditional query is triggered.
  • Pre-query: This mode is supported from Quick BI V3.12.1. If Pre-query is selected, you can select a value from the Order Level drop-down list in the dashboard display section. Values displayed in the drop-down list are determined based on the configuration of row-level permissions. Therefore, the default value that is displayed for each account varies based on the configuration of row-level permissions.

    If the selected dataset is configured with row-level permissions and the amount of data is small, you can set Query Time to Pre-query. In other scenarios, Pre-query may prolong the report loading time.

Click to Query.
Set Filter Defaults Displays the value that you set in this section in the Order Level drop-down list. This option is selected. Medium and High are selected as default values.

Example:

After you set Query Mode to Multiple Choice and set Query Time to Click to Query, select Set Filter Defaults. In the Field pane, click the required field values to add them as default values. 1
In the Field pane, you can perform the following operations:
  • Enter a keyword in the search box and click the field value that appears to add it to the Added list.
  • Click Add all field values on the left to add all the field values to the Added list.
  • Select field values from the left side of the Field pane to add them to the Added list.
  • Select Exclude in the lower part of the Added pane to exclude the selected field values from the Added list.
    Note
    • If you select a field name and select Exclude in the Field pane and then change Field style to Tile, the field value is excluded from the query result when you click the field name in the filter bar.
    • If you set Field style to Tile and select a field value and then select Exclude in the Field pane, the field value appears with a strikethrough in the filter bar.
  • Click Clear to clear the Added list.
Singe dataset 3.12.1
Table 2. Single dataset
Parameter Description Example
Single Dataset The dataset in the workspace to which the current dashboard belongs. We recommend that you select the dataset of the associated chart. company_sales_record
Query Value The field in the source dataset that is used to match the associated field. order_level
Display Name The field in the source dataset that is used to filter data. This field appears in the filter bar.
  • If Display Name is the same as Query Value, the system automatically fills Display Name after you select Query Value.
  • If Display Name is different from Query Value, you must manually change the value of Display Name.
order_level
Sorting Field The field that is used to sort data. This parameter is optional. If you do not specify this parameter, the data sequence remains the same as that in the dataset by default.

You can select a sorting field from the drop-down list, such as a measure or a date dimension.

After you specify this parameter, only the order of field values in the Order Level drop-down list is changed. The order of dimension field values in the charts is not affected because it is determined based on the field order in the dataset or the field order in the Category Axis (Dim.).

province
Query Mode Valid values: Single Choice and Multiple Choice. Multiple Choice
Query Time Valid values: Click to Query and Pre-query.
  • Click to Query: This is the default value. When you click Inquire on the right side of the filter bar on the preview page, a conditional query is triggered.
  • Pre-query: This mode is supported from Quick BI V3.12.1. If Pre-query is selected, you can select a value from the Order Level drop-down list. Values displayed in the drop-down list are determined based on the configuration of row-level permissions. Therefore, the default value that is displayed for each account varies based on the configuration of row-level permissions.

    If the selected dataset is configured with row-level permissions and the amount of data is small, you can set Query Time to Pre-query. In other scenarios, pre-query may prolong the report loading time.

Click to Query
Set Filter Defaults Displays the value that you set in this section in the Order Level drop-down list. This option is selected. Medium and High are selected as default values.
Table 3. Manual Input
Parameter Description Example
Manual Input If you set Option Value Source to Manual Input, you must manually specify Query Value and Display Name. N/A.
Query Mode Valid values: Single Choice and Multiple Choice. Multiple Choice.
Set Filter Defaults Displays the value that you set in this section in the Order Level drop-down list. This option is selected. Medium and High are selected as default values.
  • If Query Value and Display Name are the same and it is the first time you manually enter values, you need only to manually specify Query Value. After you click OK, the system automatically fills Display Name.
  • If Query Value and Display Name are different and it is the first time you manually enter values, you must manually specify Query Value and Display Name.
  • If it is not your first time to manually enter values, you must manually enter a new query value and display name. If you enter only the query value, the following error message appears. Error
The following figure shows a chart with the preceding configurations. 123

Text Input Box

If you select Text Input Box from the Display Type drop-down list, Conditional Form can be set to Single Condition, OR, or AND. The following figure shows that Conditional Form is set to OR. Text Input Box 3.12.1
The following table describes the mappings between rules and the SQL statements used when you configure default values for the product_sub_type field.
Rule SQL statement
Exact Match product_sub_type='ruler'
Mismatch product_sub_type!='ruler'
Contain product_sub_type like '%ruler%'
Not Contain product_sub_type not like '%ruler%'
Start With product_sub_type like 'ruler%'
End With product_sub_type like '%ruler'
Null product_sub_type is null
Not Null product_sub_type is not null
Empty Text product_sub_type=''
Non-empty Text product_sub_type!=''
Parameter Description Example
Conditional Form Valid values: Single condition, OR, and AND. OR
Set Default Value The character or value varies based on the selected conditional form. In the following example, ruler is specified for Contain and table is specified for Start With.
Lock the Filter Condition Displays the value that you set in this section in the Order Level drop-down list.
Note This parameter appears only when you select Set Default Value.
This option is selected.

Tree

If you select Tree Drop from the Display Type drop-down list, fields from both the current dataset and another dataset can be selected. Display Form can be set to Tree or Tile.

  1. Select the company_sales_record dataset from the Select Dataset drop-down list. In the Tree Structure Design section, click Start Configuration.
  2. In the Tree Structure Design dialog box, specify Query Value and Display Name for each level and click OK.
    • If Query Value is the same as Display Name, the system automatically fills Display Name after you select Query Value.
    • By default, the values of Display Name and Query Value are the same. If they are different, you must manually change the values.
    • A tree query supports a maximum of four levels.
  3. Configure Display Form, Query Mode, and Query Time.
    You can set Display Form to Tree or Tile.
    • If you set Display Form to Tree, Query Mode can be set to Single Choice or Multiple Choice.
      Figure 1. Example of a chart configured with tree display and single choice
      Tree 3.12.1
      Figure 2. Example of a chart with tree display and multiple choices
      1
    • If you set Display Form to Tile, Query Mode can be set to Single Choice or Multiple Choice, and Query Time can be set to Click to Query or Pre-query.
      If data records exceed 1,000, we recommend that you set Display Form to Tile. Tile 3.12.1
  4. Select and configure Set Default Value.
  5. Optional:Select and configure Quick Association.
    If you select Quick Association, the current line chart and field are automatically selected for the sub-level of the tree structure.
    Click Associate Chart in the Tree Structure Design section or click the sub-level name of the tree structure in the Query Condition section to associate it with charts and fields in another dataset. Associate Chart 3.12.1
    The following figure shows the field associations for different types of charts. When you select province as the second level of the tree structure to associate fields with line charts and pie charts that use the same dataset, the system automatically enters the associated fields of Line Chart and Pie Chart. When you associate fields with kanbans that use another dataset, you must manually enter the associated fields of Kanban. Automatic loading
  6. Click OK.
    After the configuration is complete, you can view the configured levels in the Query Condition section in the Set Query Conditions dialog box.
    • Click the Hide icon to hide or show the query levels.
    • Click the Hide icon to hide the filter condition in the filter bar.
  7. Click Inquire in the dashboard display section of the filter bar. All the charts that are associated with the filter bar are automatically updated.
    The following figure shows the query result obtained when Display Form is set to Tree Drop. 3