This is the 8th day of my participation in Gwen Challenge

The installation

MetaBase recommends using Docker for installation and deployment

The official tutorials are very detailed, and it is very easy to follow the steps, and the subsequent version of the upgrade is very easy to handle

Initialization occurs after the first startup run, which is not the focus of this article

filter

This article mainly describes how to add a multi-select drop-down box in MetaBase form of screening criteria, in the dashboard use

Modifying the data model

Suppose you have successfully added an available data source (that is, a database), and there is a user table named T_USER in which you need to make the NAME column a filter

Step 1: Enter the administrator interface from the Settings menu in the upper right corner:

Select NAME from T_USER and change it to one of the main rows:

Create a problem

Next we need to create a question, which can be interpreted as creating a query or a statistical graph

Select * from t_user [[where NAME = {{NAME}}]]

[[]] indicates that the condition is not necessary, and {{}} indicates the condition content

Second, MetaBase can automatically recognize a variable and manually set its type to field filter criteria:

Creating a Dashboard

In the first step, we create a new dashboard and add the problems we created earlier to it

Second, we create a new filter of a different type:

The third step is to select the column to be filtered on the added question, associate the filter criteria with it, and modify the attributes of the filter criteria:

So far, our filter criteria have been added successfully:

conclusion

  • Filter criteria specify that the field type must be content in the main line
  • Drop-down box filtering supports multiple selection