This topic describes how to use a compound query control. It uses nested OR and AND relationships to implement compound query of charts in the same dataset.

Prerequisites

The dashboard edit page is displayed.

Procedure

  1. Click the Compound Query Control icon.Compound query
  2. Perform the following operations on the Data tab:
    • Select a dataset from the Dataset drop-down list.
    • Click the Edit icon icon to go to the dataset edit page. You can edit dimensions and measures.
  3. Click Configure Selector to add fields you want to query.Configure query fields
  4. On the Style tab, you can perform the following configuration:
    • Basic Settings: You can set Show Title, Widget Name, and Hide Query Button.Basic Settings
    • Style of Controls: You can set Height of Controls and Show Label Name.Style of Controls
    • Style of Field: You can set Selector Width.Style of Fields
  5. Click Configure Selector. In the Configure Selector dialog box that appears, select a chart for filter interaction.
    Note Compound Query Control supports only filter interaction of charts from the same dataset. Cascade filtering is not supported.
    Configure Selector
  6. In the Configure Selector dialog box, select filter fields.
    1. Click Add Filtering Condition to add a filter condition under this level.
      • Search for or select a field for filtering, change Field Name, specify Filter By, and set Default Value.
      • If you want to delete a filter condition, click the Delete icon next to the filter condition.
    2. Click Add Relationship to add a relationship node to the inner layer of this level.Add a relationship
      • Click the node of the first outer layer relationship and select a relationship type to replace the current relationship.Change the current relationship
      • If the relationship of the outer layer is And, the default relationship of the next layer is Or. If the relationship of the outer layer is Or, the default relationship of the next layer is And. The relationship types of the inner layer and its outer layer are opposite. They can be And-Or, Or-And, And-Or-And, or Or-And-Or.
      • You can click the Delete icon to delete all filter fields and relationships for a node.Delete a relationship
        Note You can add a maximum of three layers of relationship nodes for each link.
  7. Click OK to complete the compound query configuration.

Example

  • Filter by string

    Data of the string type can be filtered in three methods: Enum - Single Choice, Enum - Multiple Choice, and Conditions.

    1. Click the Compound Query Control icon. On the Data tab, select a dataset.
    2. Click Configure Selector. In the Configure Selector dialog box that appears, select a chart for filter interaction.
    3. In the Set Filter Conditions section, set filter conditions.
      • Click Add Filtering Condition, set Filtering Field to area, Field Name to area, Filter By to Enum - Single Choice, and Default Value to North.
      • Click Add Filtering Condition, set Filtering Field to order_level, Field Name to order_level, Filter By to Conditions, and Default Value to Matches, L1.
    4. Click OK.
    5. Click Query in the display area of the compound query control. All the charts that are filtered by the control are updated.
  • Filter by data
    1. Click the Compound Query Control icon. On the Data tab, select a dataset.
    2. Click Configure Selector. In the Configure Selector dialog box that appears, select a chart for filter interaction.
    3. In the Set Filter Conditions section, set filter conditions.
      • Click Add Filtering Condition, set Filtering Field to order_number, Field Name to order_number, and Default Value to Greater Than, 30.
      • Click Add Filtering Condition, set Filtering Field to order_amt, Field Name to order_amt, and Default Value to Greater Than, 10000.
    4. Click OK.
    5. Click Query in the display area of the compound query control. All the charts that are filtered by the control are updated.
    Note Only values of numeric fields can be filtered. The data is displayed based on the aggregate method selected for measures in a chart. Assume that the aggregate method of the order_number field in a cross table is sum. If you use the compound query control to filter data in which the number of orders is greater than 30, the cross table displays all data in which the number of orders is greater than 30 and the aggregate method is sum.
  • Filter by date

    Data of the date type can be filtered by using Shortcut or Filter By Date.

    1. Click the Compound Query Control icon. On the Data tab, select a dataset.
    2. Click Configure Selector. In the Configure Selector dialog box that appears, select a chart for filter interaction.
    3. Click Add Filtering Condition to set filter conditions.
      Note If you filter data of a certain period of time, you need to add a date filter field first, and set Default Value to Greater Than or Greater than or Equal To. Then, add the same date filter field, and set Default Value to Less than or Equal To or Less Than.
      • Click Add Filtering Condition, set Filtering Field to report_date(year), Field Name to date, and Default Value to Greater Than, 2010.
      • Click Add Filtering Condition, set Filtering Field to report_date(year), Field Name to date, and Default Value to Less than or Equal To, 2011.
    4. Click OK.
    5. Click Query in the display area of the compound query control. All the charts that are filtered by the widget are updated.