Configure conditional cascades

Updated at:

A conditional cascade creates a logical dependency between filter bars. When a cascade is configured, the options in the linked filter bars dynamically update based on selections made in the others. For example, if you select a region in one filter bar, the options in a second filter bar for provinces will only show provinces within the selected region. This topic describes how to configure conditional cascades between filter bars.

Prerequisites

Entry points

Open the Conditional Cascade Configuration page from either of the following entry points:

  • Entry point 1: On the dashboard edit page, follow the steps in the following figure.image

  • Entry point 2: In the Set Query Conditions dialog box, click Conditional Cascade Configuration.image

The Conditional Cascade Configuration page supports two modes: unidirectional cascade and bidirectional cascade.

  • Unidirectional cascade: Establishes a hierarchical relationship between filter bars, following a "parent-drives-child" logic where filters are passed down but not up. When you select a value in the parent control, the child control's option list is automatically filtered to show only relevant values. However, changing the selection in the child control does not affect the parent control.

    This mode is ideal for filtering dimensions with a clear hierarchy, such as in a "Province > City" scenario. For example, if you select "Zhejiang" in the "Province" control, the "City" drop-down list updates to show only cities within Zhejiang. Conversely, selecting a city does not change the selection in the province control.

  • Bidirectional cascade: Establishes a peer-to-peer relationship between multiple filter bars from the same dataset. When you change the value in one filter bar, the options in all other linked filter bars are dynamically filtered.

    This mode is ideal for scenarios that require dynamic filtering between peer dimensions. For example, when filtering by both "Product Type" and "Sales Region," selecting a product type filters the regions to show only where that product is sold. Conversely, selecting a region filters the product types to show only those available in that region.

Limitations and notes

  • Hierarchy Limitations

    Filter bars are organized into three hierarchical levels, from top to bottom: global control > tab-level control > chart-level control.

    • A unidirectional cascade can only pass filters down the hierarchy. Cascading up the hierarchy is not supported. Specifically, a global control can cascade to other global controls, tab-level controls, and chart-level controls. A tab-level control can cascade to other tab-level controls and chart-level controls, but it cannot cascade upwards to a global control. A chart-level control can only cascade to other chart-level controls and cannot cascade to global or tab-level controls.

    • A bidirectional cascade is only supported at the global control level. It cannot be used with tab-level or chart-level controls.

  • Maximum Number of Conditions: You can create multiple cascade configuration groups, and each group can contain up to 30 cascade conditions. However, if a field is part of a bidirectional cascade, it cannot be used in any other cascade configuration.

  • Supported Control Types

    The following table lists the supported filter bar types for different cascade configurations.

    Cascade configuration item

    Supported control types

    Unidirectional cascade

    Single-source cascade

    drop-down list sourced from a Single Dataset

    tree drop-down

    date selection sourced from a dataset field

    Cross-source cascade

    drop-down list sourced from a Single Dataset

    date selection sourced from a dataset field

    Date cascade

    date selection

    Bidirectional cascade

    drop-down list sourced from a Single Dataset

    tree drop-down

    date selection sourced from a dataset field

    Note

    When configuring a single-source cascade or a cross-source cascade, if a date selection control is used as the first level (the trigger) of the cascade, it can start the cascade even if its options are not sourced from a dataset field and instead use the default date picker.

    • If the first-level date control uses the default date picker and is not sourced from a dataset, its selectable date range is not restricted by the dataset.

    • If the first-level date control is sourced from a dataset field, its selectable date range is limited to the dates available in that dataset.

  • Other Notes

    • Conditional cascades do not support exclusions in a drop-down list.

    • You cannot use bidirectional cascades with the dynamic function default value feature.

    • Different controls may contain fields with the same name. To distinguish them, you can select Show Title and edit the control name.image.png

Create a unidirectional cascade

On the Conditional Cascade Configuration page, hover over the Create Unidirectional Cascade button and select the cascade type you want to create.

image

In unidirectional mode, you can create a single-source cascade, cross-source cascade, or date cascade.

  • If your filter bars use the same dataset, configure a single-source cascade.

  • If your filter bars use different datasets, configure a cross-source cascade.

  • If the filter bar type is date selection:

    • If you have multiple date controls and none are sourced from a dataset, you can link them directly. For details, see Date cascade.

    • If you have a single date control and other text-based controls like a drop-down list, both single-source and cross-source cascades are supported.

Single-source cascade

Assume Filter Bar A contains the area and province fields, while Filter Bar B contains the city and product_category fields. Both filter bars use the same dataset. You can link the area field in Filter Bar A to the city field in Filter Bar B. As a result, when you select a region in Filter Bar A, Filter Bar B will only display cities within that region.

  1. On the Conditional Cascade Configuration page, select Create Unidirectional Cascade > Single-source cascade.

    image

  2. Select the target field Area from Filter Bar A and click the 添加 icon on the right.

    image

  3. Select the conditional field City that you want to link with the target field.

    image

  4. Click OK.

    Now, when you select Northwest for the Area in Filter Bar A, the City filter bar will only display cities within the Northwest region.

    Untitled.gif

Cross-source cascade

Assume Filter Bar A contains the area and product_type fields, while Filter Bar B contains the province and product_sub_type fields. The filter bars use data from different datasets. You can link the area field in Filter Bar A to the province field in Filter Bar B. As a result, when you select a region in Filter Bar A, Filter Bar B will only display provinces within that region.

  1. On the Conditional Cascade Configuration page, select Create Unidirectional Cascade > Cross-source cascade.image

  2. Select the target field Area from Filter Bar A and click the 添加 icon on the right.

    image

  3. In the new cascade configuration panel, configure the following settings.

    1. From Filter Bar B, select the conditional field Province to link with the target field.

      image

    2. Select an associated field.

      • The associated field is the field in the child control's dataset that receives the value from the parent control. For example, with area as the parent and province as the child, the area field is selected here because it is designed to receive the value from the parent Area control.

        image

      • The associated field can be a dimension, expression placeholder, or value placeholder. The logic for passing values with placeholders is as follows:

        Control type

        Query method

        Value placeholder

        Expression placeholder

        Date filter

        Single date:

        e.g., 2024-05-28

        2024-05-28

        >=2024-05-28, <=2024-05-28

        Date range:

        2024-05-28 to 2024-05-28

        2024-05-28

        >=2024-05-28, <=2024-05-28

        Date range:

        2024-05-21 to 2024-05-28

        2024-05-21

        >=2024-05-21, <=2024-05-28

        Text filter

        Single selection: East China

        East China

        in ('East China')

        Multiple selections: East China, South China, Northeast China

        East China, South China, Northeast China

        in ('East China', 'South China', 'Northeast China')

        Note

        In a date range filter, if the start and end dates are different (for example, 2024-05-21 to 2024-05-28), the value placeholder passes the start date (2024-05-21) by default. To pass the end date (2024-05-28), you can specify it in the dataset, for example: report_date < '$val{report_date_ph.get(1)}'.

        For more information about how to use placeholders, see Placeholders.

  4. Click OK.

    Now, when you select Northeast for the Area in Filter Bar A, the Province filter bar will only display provinces within the Northeast region.

    image

Date cascade

Cascade between date controls

Assume a date control on the dashboard contains Quarter and Month fields. You can link these two date fields to create a cascade. When you select Q1 2023 for the quarter, the month control will only show the first three months of the year as options.

  1. On the Conditional Cascade Configuration page, select Create Unidirectional Cascade > Date cascade.

    image

    Note

    In a date cascade configuration, the available conditional fields are limited to date-type query controls (both single date and date range). The supported time granularities are Year, Year-Quarter, Year-Month, Year-Week, Year-Month-Day, and Year-Month-Day-Hour-Minute-Second. Hour, Hour-Minute, and Hour-Minute-Second are not supported.

  2. Select the target field Quarter from the date control and click the 添加 icon on the right.

    image

  3. Select the conditional field Month that you want to link with the target field.

    image

  4. Click OK.

    Now, when you select Q1 2023 for the quarter, the month control is filtered to show only January, February, and March.

    image

Cascade between date and other controls

A date query control can cascade with other control types (such as drop-down list or tree drop-down) only when its data source is set to dataset field.

  • Example: Single-source cascade from a date control to another control

    1. On the Conditional Cascade Configuration page, select Create Unidirectional Cascade > Single-source cascade.

      image

    2. Select the target field Shipping Date and click the 添加 icon on the right.

      image

    3. Select the conditional field Area that you want to link with the target field.

      image

    4. Click OK.

      Now, when you select the date 2023-04-01, the Area control is filtered to show only the regions corresponding to that date.

      image

  • Example: Cross-source cascade from another control to a date control

    1. On the Conditional Cascade Configuration page, select Create Unidirectional Cascade > Cross-source cascade.image

    2. Select the target field Promotion from Filter Bar B and click the 添加 icon on the right.

      image

    3. In the new cascade configuration panel, configure the following settings.

      1. Select the conditional field Date that you want to link with the target field.

        image

      2. Select an associated field.

        Note

        The selected associated field must be the field in the child Date control's dataset that receives the value from the parent control. For example, the Promotion field is selected here because it is designed to receive the value from the parent Promotion control.

        image

    4. Click OK.

      Now, when you select Spring Festival for the promotion, the date control is filtered to show only the dates corresponding to that promotion.

      image

      Note

      When another control cascades to a date control, the available range in the date control includes all dates associated with the selected value in the parent control from the dataset.

      For example, if the Spring Festival promotion has three data entries on 2024-02-05, 2024-02-10, and 2024-02-17, the selectable date range becomes the continuous period from 2024-02-05 to 2024-02-17.

Create a bidirectional cascade

Assume your filter bars include Product Type and Area, and both are sourced from the same dataset. By creating a bidirectional cascade, when you select a product type, the Area control will only show regions where that product is sold. Conversely, when you select a region, the Product Type control will only show product types available in that region.

  1. On the Conditional Cascade Configuration page, select Create Bidirectional Cascade > Bidirectional Link.

    image

  2. Select the field Product Type to include in the cascade and click the 添加 icon on the right.

    image

  3. Select the other conditional field, Area, to include in the cascade.

    image

  4. Click OK.

    Now, when you select Office Supplies for Product Type, the Area control only shows regions where Office Supplies are sold. Conversely, if you select Southwest for Area, the Product Type control only shows product types available in the Southwest region.image

Related operations

Use the following instructions to manage your conditional cascades.

  • Add a cascade configuration item

    If you need to configure multiple cascade items, click the Create Unidirectional Cascade or Create Bidirectional Cascade button in the upper-right corner and select the desired configuration type.

    image

  • Delete a cascade configuration item

    To remove a single condition, click the Delete icon (①) above it. To delete the entire item, click the Delete icon (②) to its right.

    image

  • Rename a cascade configuration item

    When you add a new cascade configuration, it is named Cascade Configuration Item by default. You can click the title area to rename it.

    image