Number#

The Number widget displays numbers, allowing Users to easily perceive and analyze data.

Starting Widget Configuration#

To configure the widget, click on the edit icon .

A pop-up window “Widget Settings” will open:

Fill in the necessary fields to configure the widget.

General Fields#

  • “Widget Name *” – a text field, filled in manually from the keyboard;
  • “Mode” – a drop-down list where you need to select the mode for creating a query for the widget:
Name Description
Builder Mode Allows you to assemble a query from separate blocks. In each block (Table Join, Filters, Widget Rows, Group By, Sort, Row Count) there is an option to configure the necessary commands for working with data, arithmetic and logical commands, comparison operators.
Advanced Mode

Allows you to manually enter a query in the SQL field:

  • “Tables” – a drop-down list with all available database tables.

Additional Fields Available for Configuration Only in Builder Mode#

Table Join#

Table joins are necessary to extract data from multiple related tables and form more complete and informative results.

To compare two tables for subsequent joining, the following operators are used:

Name Description
= Returns rows from both tables where the values in the specified columns are equal.
!= Returns rows from both tables where the values in the specified columns are not equal.
> Returns rows where the value in the specified column from the first table is greater than the value in the specified column of the second table.
< Returns rows where the value in the specified column from the first table is less than the value in the specified column of the second table.

If you need to join only 2 tables, you must fill in the fields:

  1. “Column” from the drop-down list;
  2. “Operator” from the drop-down list;
  3. “Column 2” from the drop-down list;

For example,

If you need to join more than two tables, you must click the button , after which you fill in the necessary fields.

If you need to delete a table join, you must click the button .

Filters#

Filters allow you to set conditions for the selected data using comparison operators and logical operators.

To set a single condition, you need to fill in the fields:

  1. “Column” from the drop-down list;
  2. “Operator” from the drop-down list;
  3. “Value” manually from the keyboard;

For example,

If you need to combine multiple conditions into one, for example, ((robots.is_deleted = 0) AND (robots.id > 13)), you must use logical operators. To do this, select the desired operator by clicking on the icon to change it to OR, or to change it to AND. Then click the button , after which fill in the necessary fields:

If you need to set a complex condition for the Filter, including multiple parentheses, you must click the button , after which fill in the necessary fields.

If you need to delete a condition, you must click the button .

Widget Rows#

Widget rows are used to specify the data columns that need to be extracted from the database. They define what data will be returned in the query results.

To configure Widget Rows, you need to fill in the fields:

  1. “Column” from the drop-down list;
  2. “Operator” from the drop-down list;
  3. “Row Name” manually from the keyboard;

For example,

If you need to display additional data on the legend, you should click the button .

Group By#

Field for configuring the process of merging rows of data with identical values in a specific column (or columns) into a single set, allowing aggregate operations to be performed on these groups. To merge rows of data, you need to fill in the column field from the drop-down list;

Sorting#

Fields for configuring the process of ordering data in the resulting set in a specific order based on the values in one or more columns. To sort in ascending order, you need to enter “ASC” in the “Sort By” field. To sort in descending order, enter “DESC”. Then you need to fill in the “Column” field from the drop-down list;

Row Count#

The field is filled in manually from the keyboard or using the counter . This field allows you to limit the number of records returned in the query results for building the Dashboard.

Testing#

To ensure that the query is set up correctly, you need to click the button , after which a table with data will appear, based on which the Number Dashboard will be built.

To display the Dashboard on the panel, click the “OK” button.

To delete all filled data, click the “Cancel” button.

Example:

To display the number of Jobs on the Number Dashboard, you need to enter the data in the corresponding fields in the "Widget Settings" window:

Builder Mode (example)#

You need to fill in the fields:

Tables *

jobs

Filters

Column
jobs.is_deleted = 0

Widget Rows

Column Row Name
jobs.id COUNT

Row Count

1000

Advanced Mode (example)#

You need to fill in the field:

SQL

SELECT
	count(jobs.id) AS count
FROM
	jobs
WHERE
	jobs.is_deleted=0
LIMIT 1000