Skip to main content

Dynamic Explore Conditions

knowledge checkpoint

A grasp of these concepts will help you understand this documentation better:

Overview

Dynamic conditions allow you to create flexible conditions that can change their calculation method or aggregation based on context, user input, or other variables.

Use Case: Filter Multiple Models with the Same Condition

In this example, we will create a dynamic condition that filters multiple models with the same condition.

Step 1: Create a Query Model to store your parameters

Model param_model {
label: 'Param Model'
type: 'query'
data_source_name: 'your_db'
query: @sql select 1 ;;

param gender_param {
label: 'Gender Param'
type: 'text'
}
}

Step 2: Add the Query Model to Your Dataset

Dataset your_dataset {
label: 'Your Dataset'
data_source_name: 'your_db'
models: [model_1, model_2, param_model]
}

Step 3: Create a new Filter Expression in the Condition

buyers.buyer_gender == (param_model.gender_param | first())
and
sellers.seller_gender == (param_model.gender_param | first())

Step 4: Set Up Dashboard Filter

  • Create a field filter called "Gender".
  • Set its source to the any Gender field from Buyers or Sellers model.
  • Map this filter to gender_param.
  • Configure the filter to be single-select.

Let us know what you think about this document :)