Overview
Problem
You do not want a fixed default value for a widget. Instead, you want a default value obtained dynamically according to database data. For example, you want to obtain the maximum value in a column.
Solution
You can use report functions to obtain the database data and customize a default value for a widget.
Example
Data Preparation
1. Create a general report.
2. Create a database query ds1 with the SQL query statement SELECT * FROM SaleRental.

Report Design
1. Add a drop-down box widget to the parameter panel.
2. Select the drop-down box widget, bind the dataset ds1, and set Actual Value and Display Value to Sales Volume separately in the Data Dictionary setting box, as shown in the following figure.

Default Value Setting
Select the drop-down box widget and enter max(value("ds1",2)) in the formula input box under Widget Setting > Attribute > Advanced > Widget Value, as shown in the following figure.

Effect Display
Click Pagination Preview. The maximum value 2261.0 is displayed in the drop-down box by default.

The following figure shows the preview effect on the DataAnalyst app and the HTML5 terminal.

Template Download
For details, you can download the template Dynamic Default Value of a Widget.cpt.
Notes
In addition to the above-mentioned solution, you can also obtain the maximum value of the dataset by a SQL statement and set the default value of the widget to be the maximum field value of the dataset.
