the configuration of the query and the multiple output options is the most important activity related to tis block setup. It requires:
If you have those prerequisites, you are ready to do a lot of things with the Dashboard block.
Remind here that the Dashboard bloc can access to any data stored into Moodle and thus it's configuration may not be allowed in an uncontrolled way.
there are 6 main steps in setting up a dashboard query:
A Dashboard will NOT be able to answer to any demand. Usually, the addressed question must have an answer that can be synthesized within a single unique Query, giving a single aggregated composite output. As the block post-processes the given SQL to feed the query accessories (such as filters, or params), some complex query forms may be not supported.
In general, any results that comes out from simple JOINS (INNER, OUTER or LEFT) among a set of tables will work fine. Some queries using subqueries may work, Union or intersects may work on simple output, but some accessories may crash the query if activated.
the Dashboard block is designed for administrators being able to setup a query and additional dynamic tools addressed to the dashboard end users. Filters will provide multiple derivated partial views of the same output data. Parameters also will allow to change the initial perimeter of the extracted data, such as date ranges, ou value ranges, providing a lot of possible distinct reports with only one generic query.
Usually a data query will output a set of columns (data fields), which can be classed into the following categories :
Filters usually will be defined upon the contextual dimensions, while parameters may usually affect usefull or technical values.
The best practice is to use your standard DB client software to write and debug the base query. Once you know the base query form outputs the data you expect in the arrangement you expect, it will be easier to copy the base query in the Dashboard block. Note that in general, your DB client software has more query coding useful tools such as syntax debugger or optimization helpers.
copy the query in the query text area of the dashboard is the effective first thing to do.
The first panel shows the textarea where to put the query.