All Products
Search
Document Center

Quick BI:Add and configure a filter bar for a chart

Last Updated:Jun 30, 2023

This topic describes how to add and configure a filter bar for a chart on a dashboard.

Prerequisites

A dashboard is created and charts are added to the dashboard.

Background information

If multiple charts are created in a dashboard, you can add a filter bar for one of the charts.

Create a filter bar

The following example describes how to create a query condition for a pie chart.

  1. After you log on to the Quick BI console.

  2. Click console Dashboard.

  3. On the Dashboards page, click the dashboard to which you want to add a filter bar.

  4. On the dashboard edit page, move the pointer over the upper-right corner of the chart, click the 更多icon, and then select Insert Query Condition.

    image
  5. In the Query Criteria in Chart dialog box, configure the following parameters:

    1. Query conditions

      If you click the 添加icon in the Query Condition section and add a query condition, the default name is Unnamed. You can enter a name for the query condition.

      image
      Note
      • The name takes effect immediately after you enter the name.

      • You can click the 隐藏 icon to hide a filter. After a filter is hidden, the filter is no longer displayed on the dashboard. However, the configuration is retained.

      • You can click the 更多操作 icon to rename or delete a filter.

    2. Related charts and fields

      Select the associated fields for this chart.

      image
    3. Query condition configuration

      The configuration of query conditions varies based on the type of associated fields. For more information, see Query type configuration.

      image
    4. Conditional Cascade Configuration

      After you configure conditional cascading, upper-level fields can control the display of lower-level fields. Conditions at the same level can affect each other. After you configure a global filter bar, tab-level filter bar, and chart-level filter bar, these filter bars are cascaded in the following descending order: global filter bar, tab-level filter bar, and chart-level filter bar. For more information, see Configure conditional cascade.

Configure a query condition group

If you add multiple query controls of the same type, such as the Statistical Time and New Time controls of the Date type, you can configure the Condition Group parameter to select the control that takes effect.

Procedure

  1. You have configured the Statistical Time and New Time parameters based on the preceding instructions.

    image
  2. Click the imageicon next to Create Query Condition and select Condition Group from the drop-down list.

    image
    Note
    1. After you add a condition group, you can drag a condition to the condition group.

    2. Only one condition in a condition group takes effect. The default value is the first condition. You can switch to the effective condition in the group in the report. Conditions that do not take effect do not take effect even if default values or global parameters are passed in.

  3. You can customize a name condition group as Time Query. After you specify the name, drag the Time condition and the Time condition group to the Time Query condition group. The following figure shows the configuration of the condition group.

    查询组

Configuration Effect

After the configuration is complete, you can view the time when the first condition in the Time Query condition group takes effect by default. You can query the time when the first condition in the group takes effect by default. 查询控件-图表中查询展示中文.gif

Configure the style

After you configure a filter bar, you can set the display style of the filter bar on the Style tab.

  • In the Template Settings section, you can select a defined template to configure the filter bar style.

    Styles supported in Template Settings are Right-side Search Box, Drop-down List, and Tile.

    image模版配置

    Template Settings allows you to change the style of a filter bar with one click. After you change the style of a filter bar, you can still configure the style in the Basic Settings, Control style, or Field style section.

  • Basic Settings:

    • If you set Template Configuration to Title Drop-down or Title Tile, you can set the Display Position, Button Display, All Filter Conditions, and Control Type.

      image
    • If you select Right-side Search Box in the Template Settings section, you can configure Display Location.

      image
  • Set Condition Name Display Location in the Control style section.

    • If you select Drop-down List or Tile in the Template Settings section, you can set Condition Name Display Location to Above or Left.

    • If you set Template Configuration to Title Right, the condition name can be displayed in the upper part.

      控件样式1
  • Specify the value style and filter width for each field in the Field style section.

    For the date and numeric fields, you can specify only the filter width. For the text fields, you can also set the value style to Drop-Down or Tile.

    image

Configure the display type

Query controls can act on parameters of the same type, placeholders, and common fields at the same time.

参位符

The following content describes the settings of Display type.

  • Date selection

    After you associate a date field with a filter bar, Display type is automatically set to Date selection, and the value of the Time granularity parameter varies based on the date field. The following types of granularities are supported: year, Year-quarter, years, Year-week, year month day, YYYYMMDD HH:MM:SS, time, Hour-minute, and Minutes and seconds.

    In this example, Time granularity is set to year. If you select Year Interval for Filter Mode, Interval Type can be Start At, End At, Time Interval, or Quick Range.

    If you select Start at or Ends at for Interval type, you can query data without the need to enter the complete start time or end time.image

    You can configure custom quick ranges for different types of granularities. The following table describes the mappings between granularity types and quick ranges.

    Time Scale

    Shortcut Interval

    year

    • Last Year

    • Current Year

    Year-quarter

    • Current Quarter

    • Last Quarter

    years

    • this month

    • last month

    • Last 3 months

    • Last 6 months

    • Last 12 months

    • First Half of This Year

    • Second Half of This Year

    • Year to Last Month

    • Year to Current Month

    Year-week

    • Current Week

    • Last Week

    year month day

    • Nowadays

    • yesterday

    • The Day Before Yesterday

    • Year To Date

    • Month To Date

    • Last 7 days

    • Last 15 Days

    • Last 30 days

    • Last 60 days

    • Last week

    • Last month

    • Recently Days (Excluding Today)

      • Last 7 days

      • Last 15 Days

      • Last 30 days

      • Last 60 days

    • Nearest Day

      • Nearest Monday

      • Nearest Tuesday

      • Nearest Wednesday

      • Nearest Thursday

      • Nearest Friday

      • Nearest Saturday

      • Nearest Sunday

    • More

      • First Day of the Month

      • First Day of Previous Month

      • Last Day of Previous Month

    time, Hour-minute, and Minutes and seconds

    Fast range cannot be specified.

    For more information about how to query data based on a date field, see Query data based on a date field.

  • Numeric Input Box

    If the associated field is a measure, you can select No aggregation or another aggregation method from the Aggregation method drop-down list. The default value is Summation.

    Note

    If an aggregation method is used in a filter bar, the filter bar cannot be used to query detailed data. You can set Conditional form to Single condition, Or condition, or And condition. If you want users to preview a report by using a fixed condition, such as the Equal to condition, select Lock the filter condition.

    image

    For more information about how to query data based on a numeric field, see Query data based on a numeric field.

  • Text input box (formerly conditional filter)

    Similar to Numerical input box, you can set the Conditional form parameter to Single condition, Or condition, or And condition.不包含

    The following table describes the mappings between the rules and the SQL statements that are used when you configure default values for the product_sub_type field.

    Rules

    SQL syntax

    Exact match

    product_sub_type='ruler'

    Mismatch

    product_sub_type='ruler'

    contain

    product_sub_type like '%ruler'

    Not included

    product_sub_type not like '%ruler%'

    Starts with

    product_sub_type like 'ruler%'

    End With

    product_sub_type like '%ruler'

    Is empty

    product_sub_type is null

    not null

    product_sub_type is not null

    Empty text

    product_sub_type=''

    Non-empty text

    product_sub_type!=''

    For more information about how to query data based on a text field, see Query data based on a text field.

  • Drop-down list (formerly enumerated filter)

    If you select Drop-down list (formerly enumerated filter) from the Display type drop-down list, Option value source can be set to Automatic parsing, Single data set, or Enter manually. Option value source indicates the source of available values of a filter.

    • If you set Option Source to Automatic Parsing, the values of the filter are automatically parsed. A maximum of 1,000 values can be displayed.

      After you set inquiry mode to Multiple choice and set Query Time to Click to Query, you can select Set filter defaults and configure the default values.

      In the Field pane, you can perform the following operations:

      • Enter a keyword in the search box and click the field name that appears to add it to the Added section on the right.

      • Click Add all field values on the left to add all the field values to the Added section on the right.

      • Select field names on the left side of the Field page to add them to the Added section on the right.

      • Select Exclude at the bottom of the Added section to exclude the selected field values from the Added section.

        Note
        • If you select a field name and select Exclude on the Field page and then change Field style to Tile, the field name appears on the filter bar. This indicates that the field name is excluded from the query result.

        • If you set Field style to Tile and then select a field name and select Exclude on the Field page, the field name appears with a strikethrough on the filter bar.

      • Click Clear to clear the field values that are added to the Added list on the right. 图表查询空间-清空 .gif

    • If you set Option Source to Single data set, you can select a dataset in the workspace to which the current dashboard belongs. We recommend that you select the dataset of the associated chart. The following figure shows the mappings between the associated field, Query Value Field, and Query name field.等级查询_4.2.1

      • Related charts and fields indicates the charts and fields that you want to associate with the filter bar.

      • Query Value 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 appears in the filter bar.

        Note
        • If Query name field is the same as Query Value Field, the system automatically fills Display Name after you select Query Value Field.

        • If Query name field is different from Query Value Field, you must manually change the value of Display Name.

      • Sorting Field: indicates the field that is used to sort data. This parameter is optional. If you do not configure this parameter, the data sequence remains the same as that in the dataset by default.

      • Query Time: supports 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: After you open a dashboard, you can query the values of the drop-down list in advance. You can view the values of the drop-down list for each account based on the row-level permission configuration. The default value varies based on the row-level permission configuration.

          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.

    • If you set Option value source to Enter manually, click the 手工录入 icon. On the Enter manually page, enter Query value and show name.

      • If the values of Query value and show name are the same and it is the first time that you manually enter values, you need to only manually specify Query value. After you click OK, the system automatically fills show name.

      • If the values of Query value and show name are different and it is the first time that you manually enter values, you must manually specify Query value and show name.

      • If you have manually entered values, you must manually enter a new query value and display name. If you enter only the query value, the following error message appears.image.png

  • Tree drop

    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 display or Tiled display, inquiry mode can be set to Single choice or Multiple choice, and Query Time can be set to Click to Query or Pre-query.

    Note

    The tree structure supports up to 10 layers. image.png

    Single choice树形单选_4.2.1Multiple choice多选_4.2.1

    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 design section or click the sub-level name of the tree structure in the Query conditions section to associate it with charts and fields in another dataset. 关联图表4.2.1The following figure shows the field associations for different types of charts. If you select province as the second level of the tree structure to associate fields with vertical bar charts and pie charts that use the same dataset, the system automatically enters the associated fields of Vertical Bar Chart and Pie Chart. When you associate fields with kanbans that use another dataset, you must manually enter the associated fields for Scorecard.自动载入_4.2.1