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 query conditions.
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.
Drag fields to generate filters
You can drag a field to a filter bar to generate a filter.
On the dashboard edit page, click Add Query Control in the top navigation bar and select a query control from the drop-down list.
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.
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.
In this case, if you need to associate charts that are not in the same dataset, you can switch to the custom mode.
For more information about how to configure query conditions, see Configure query conditions.
Select the values that you want to query and click Inquire.
After the configuration is complete, you can modify the style of the query widget. For more information, see Configure the style of the query widget.
Configure custom filters
The following example shows how to configure custom filters. To configure custom filters, set the Effective Mode parameter to custom.
In the main menu bar of the dashboard edit page, click the Filter Bar icon. Then, configure the filter bar.
Method 1:
Method 2:
Entry 3:
In the Set Query Conditions dialog box, configure the following parameters:
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.
NoteThe 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.
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.
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 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.
If you enable the Quick Switch Between Before and After Date feature, a shortcut arrow is added to the date control on the report page. You can click the arrow to quickly switch the year. The following figure shows the effect.
Conditional Cascade Configuration
For more information, see Configure conditional cascade.
Configure a query condition group
If you have added multiple query controls of the same type, such as the Statistical Time and New Time controls of the Date type, you can configure a query condition group to associate the query controls with the controls. You can switch between the query conditions.
Procedure
You have configured the Statistical Time and New Time parameters based on the preceding instructions.
Click the icon next to Create Query Condition and select Condition Group from the drop-down list.
NoteAfter you add a condition group, you can drag a condition to the condition group.
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.
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 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.
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.
NoteIf 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.
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'
No
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.
NoteIf 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 mappings between the associated field, Query Value Field, and Query name field.
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.
NoteIf 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.
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.
NoteThe tree structure supports up to 10 layers.
Tree radio display
Tree multi-selection display
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. 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.
Remember query conditions
Query conditions can be remembered at the report level. If you select this check box, the system remembers the last query condition by default.
Report-level settings are affected by organization-level configuration.
If you select Remember Query Condition in the Report Configuration section, the Select Remember Query Condition section is dimmed and cannot be deselected.
If you do not select Remember Query Criteria in the Report Configuration section, you can specify whether to remember query criteria based on your business requirements.