You can use a filter bar to query 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.
Create a filter bar
- Click the Workspace tab. In the left-side navigation pane, click Datasets.
- On the Datasets page, find the company_sales_record dataset and click the icon in the Actions column. Note If you are using Quick BI Enterprise Standard, you must select Standard or Full Screen. In this example, Standard is selected.
- In the menu bar, click the icon to create a filter bar.
- In the dashboard display area, find the filter bar and click the icon.
- In the Set Query Conditions dialog box, configure the following parameters:
- Query ConditionWhen you click the icon next to Query Condition to add a filter, the default name of the filter is Unnamed. You can enter a name for the new filter.Note
- The name takes effect immediately after you enter the name and move the pointer.
- You can click the icon to hide a filter. After a filter is hidden, it is no longer displayed on the dashboard but its configuration is retained.
- You can click the icon to rename or delete a filter.
- Associated Charts and FieldsSelect the charts and fields to be associated 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.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.
- Query Condition ConfigurationParameters in the Query Condition Configuration pane vary based on the data type of the associated field. The following figure shows the parameters for a year-granularity time field. For more information, see Configure the display type.If you select Set a chart with only the start and end time points associated, left and right arrows appear next to the date picker control on the dashboard. You can click the arrows to change the month, as shown in the following figure.
- Conditional Cascade ConfigurationFor more information, see Configure conditional cascade.
- Query Condition
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 Basic Configuration section, specify Show title, Global pin, Hide query button, Show Clear Button, Show
Reset Button, and Control type. Note The Clear and Reset buttons appear in the filter bar only after you select Show Clear Button and Show Reset Button.
- 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.
- In the Control style section, specify Control height, Content typography, and Show field labels.
- In the Field style section, specify the value style and filter width for each field. 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.If you select Exclude and add some items to the Added section in the Field pane when you configure filters, the items that you selected are filtered out.
Configure the 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 Year Interval for Filter Mode, Interval Type can be Start At, End At, Time Interval, or Quick Range.If you select Start At or End At for Interval Type, you can query data without the need to enter the complete start time or end time.You can customize quick ranges for different types of granularities. The following table lists the mappings between granularity types and quick ranges.For more information about how to query data based on a date field, see Query data based on a date field.
Granularity Quick range Year
- Last Year
- Current Year
- Current Quarter
- Last Quarter
- Current Month
- Last Month
- Last 3 Months
- Last 6 Months
- Last 12 Months
- First Half of This Year
- Second Half of This Year
- Current Week
- Last Week
- Current day
- 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 (Excluding the Current Day)
- Last 7 Days
- Last 15 Days
- Last 30 Days
- Last 60 Days
- Last Day of the Week
- Last Monday
- Last Tuesday
- Last Wednesday
- Last Thursday
- Last Friday
- Last Saturday
- Last Sunday
- First Day of This Month
- First Day of Last Month
- Last Day of Last Month
Hour, Hour-Minute, Hour-Minute-Second Quick Range cannot be specified.
- Numeric Input BoxIf the associated field is a measure, you can specify Aggregation Method. The default value is Summation. You can also select No Aggregation or another aggregation method from the drop-down list of Aggregation Method.For more information about how to query data based on a numeric field, see Query data based on a numeric field.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, or AND. If you want users to preview a report by using a fixed condition, such as the Equal To condition, select Lock Filter Condition.
- Text Input BoxSimilar to Numeric Input Box, you can select Single Condition, OR, or AND for Conditional Form.The following table describes the mappings between rules and the SQL statements used when you configure default values for the product_sub_type field.For more information about how to query data based on a text field, see Query data based on a text 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!=''
- 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
After you set Query 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.
- 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.
- 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 relationships between the associated field, Query Value, and Display Name.
- Associated 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.
- 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 specify 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 Pre-query is selected, you can
select a value from the Order Level drop-down list in the dashboard display area.
The 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.
- If you set Option Source to Manual Input, click the icon. On the Manual Input page, enter Query Value and Display 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.
- 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.
- Tree DropIf 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, Query Mode can be set to Single Choice or Multiple Choice, and Query Time can be set to Click to Query or Pre-query.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. 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 for Kanban.