All Products
Search
Document Center

Quick BI:Create a Filter Bar

Last Updated:Mar 01, 2024

You can use a filter bar to create one or more filters to query the data of one or more charts. On a dashboard, you can create multiple filter bars. However, you can pin only one filter bar to the top.

Prerequisites

A dashboard is created. For more information, see Create a dashboard and Overview.

Background information

Effective mode:

  • Drag fields to generate filters.

    You can drag a field to a filter bar to generate a filter. For more information, see Add a query condition.

    添加查询控件..gif

  • Configure custom filters.

    If the filter that is generated after you drag a field does not meet your business requirements, you can configure custom filters. For more information, see Customize query conditions.

    image

Drag fields to generate filters

You can drag a field to a filter bar to generate a filter.

  1. On the dashboard edit page, click Add Query Control in the top navigation bar and select a query control from the drop-down list.

    image

  2. On the Data tab on the right side of the dashboard edit page, drag the required fields to the filter bar.

    The system generates a query control of the appropriate display type based on the field type.

    Untitled.gif

    • If the charts and the filter bar on the dashboard belong to the same dataset, the filter bar to which the fields are dragged is automatically associated with all charts in the dataset. If you continue to add charts in the same dataset after you create a condition, the conditions are automatically associated with the charts.

      同数据集

    • If the charts and the filter bar on the dashboard belong to different datasets, the filter bar to which the fields are dragged is not associated with charts that use different datasets.

      image.png

      In this case, if you need to associate charts that are not in the same dataset, you can switch to the custom mode.

      image.png

      For more information about how to configure query conditions, see Configure query controls.

  3. Select the values that you want to query and click Inquire.

    image.png

    After the configuration is complete, you can modify the style of the query widget. For more information, see Style.

Configure custom filters

The following example shows how to configure custom filters. To configure custom filters, set the Effective Mode parameter to custom.

  1. In the main menu bar of the dashboard edit page, click the Filter Bar icon. Then, configure the filter bar.

    • Method 1:

      image.png

    • Method 2:

      image.png

    • Entry 3:

      image

    • Entrance 4:

      image.png

      Untitled.gif

      Note

      This method is used to configure filters in a chart. The filters take effect only in the current chart and cannot be applied to other charts.

  2. In the Set Query Conditions 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.png

      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 charts and fields that you want to associate with the filter bar. You can select Smart Field Selection. This feature automatically selects associated fields in the charts that are created based on the same dataset as the current chart. If a large number of charts exist, select the check boxes next to the charts that you want to associate with the filter bar.

      image

      Fields of different data types cannot be associated with a filter bar at the same time. For example, you cannot associate a field of the date type and a field of the numeric type with a filter bar at the same time.

      image.png

    3. Query condition configuration

      The parameters in the Query condition configuration pane vary based on the associated field. The following figure shows the parameters for a year-granularity time field. For more information about how to configure these parameters, see Configure the display type.image

      If you turn on the Quick Switch Before and After Date switch, a shortcut arrow is added to the date control on the report page. You can click the arrow to switch the year. The following figure shows the effect.

      Untitled.gif

    4. Conditional Cascade Configuration

      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 control 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 they have 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.

查询组效果

Configure the style

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

You can enter a keyword in the search box at the top of the Style Configuration section to search for configuration items. You can also click image..pngExpand /Collapse All Categories in the right-side chart.

Untitled.gif

PC-style configuration

  • In the Basic Settings section, configure information such as the title.

    image..png

    Parameter

    Configuration Effect

    ① Set the title name

    Set Title Name to Query Control A.

    image..png

    Set background card color and image

    image..png

    ③ Set the component to the top

    When selected, the current top filter control is replaced by this control.

    image..png

    Set expansion filter conditions

    image

    Set the button type

    image

    Note

    The Reset and Clear buttons appear only when Clear and Show are selected configuration items the button display.

    • Reset: indicates that the filter is restored to the default settings.

    • Clear: indicates that the filter is cleared.

    For example, if Filter Bar A is cascaded with Filter Bar B, Filter Bar A is the upper level of Filter Bar B. If Filter Bar A is reset or cleared, Filter Bar B is also reset or cleared. If Filter Bar B is reset or cleared, Filter Bar A does not change.

    Set the display type of the button control

    Level:

    image

    vertical:

    image

  • In the Control style section, specify Control height, Content typography, and Show field labels.

    image

  • 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.

    字段样式

Mobile client style configuration

  • In the Basic Settings section, configure the information such as the title.

    image..png

    Parameter

    Configuration Effect

    ① Set the title name

    Set Title Name to Query Control A.

    image..png

    Set background card color and image

    image

    ③ Set the component to the top

    When selected, the current top filter control is replaced by this control.

    image..png

    ④ Set the display button type

    image

  • In the Control Style section, set the label to the top or left.

    • Above

      image

    • Left

      image

  • In the Field Style section, if you set Display Type to Drop-down List, you can set the Value Style parameter. If you set Display Type to Drop-down, you can set the Number of Fields parameter.

    移动端字段样式

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 Granularity is configured based on the date field. Multiple types of granularities are supported, such as Year, Year-Quarter, Year-Month, Year-Week, Year-Month-Day, YYYYMMDD HHMMSS, Hour, Hour-Minute, and Hour-Minute-Second.

    In this example, Granularity is set to Year. If you select yearInterval for Screening mode, Interval type can be Start at, Ends at, Time interval, or Fast 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 granularity

    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.

    Rule

    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 (Formally Enumerated Filter)

    If you select Drop-down List (Formally Enumerated Filter) from the Display Type drop-down list, Option Source can be set to Automatic Parsing, Single Dataset, or Manual Input. Option 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 names 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 names 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 Added section.

        image..png

    • If you set Option Source to Single Dataset, 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.

      • Display Name is the field in the source dataset that is used to filter data. This field appears in the filter bar.

        Note
        • 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.

      • 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: This mode is supported from Quick BI V3.12.1. If you select Pre-query, you can select a value from the drop-down list in the filter bar on the dashboard. The values that are displayed in the drop-down list vary based on the configuration of row-level permissions. 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.

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

      • If Query Value and Display Name are the same and it is the first time that 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 that you manually enter values, you must manually specify Query Value and Display 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.

    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 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. 关联图表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