Table des matières
Dashboard Block
Configuring the Output Data
Table type
Data can be presented in 3 forms:
- Linear table: Data is presented by result row
- Crosstab: Data is presented as a two-dimensional table. The table description must specify:
- The column carrying the horizontal dimension (a single choice)
- The column(s) carrying the vertical dimension.
- The composition of the cell content
- Hierarchical table: if the extracted data follows a hierarchical principle (id,parent) it can be displayed in a tree representation.
Output column
- This setting determines which fields of the query result will be displayed in the result table (data display). Fields must be named after the column output names (field name or alias name) and cannot be SQL expressions. Field names are separated by semicolons (;).
Example, if the query is:
SELECT YEAR(FROM_UNIXTIME(time)) as year, count(*) access FROM mdl_log GROUP BY year
Then the output columns can be:
year;access
Output column names
- The output column names can be specified by separating the names with ;
Example: Category;Subcategory
Output data format
- These fields let you reformat the output data according to masks compatible with the “sprintf” function, which returns a formatted string.
For a list of reference fields, the format list must contain the same number of formatting expressions separated by semicolons. An empty expression means “no formatting”.
Example: To return two string fields:
%s;%s
Example: For a query defining an attendance rate, you may want to format the division (float) as a number with one digit after the decimal point. The “data output” and “output format” fields, for example, would be expressed like this:
mois;ratio ;%.1f
Learn more about formatted strings
Output with html: It is possible to format an output value by coupling it with html language, so to generate a link on a value displaying a course short name (shortname), you would write the string as follows:
<a href="/course/view.php?id=%{cid}">%s</a>
Pagination size
- This field corresponds to the result page size in case of very large data output: When specified (non-zero), it forces pagination of the table results.
Disable security
- This choice concerns protection against massive results: Extraction queries can have dramatic consequences on performance, particularly when tuning joins. To prevent the interface from ending up in an unrecoverable situation, a safeguard adds forced pagination on results in edit mode. This protection can however cause problems in some cases, for example when producing graphic curves that require a lot of data. When it is disabled, massive results are actually produced and sent back to the block for rendering.
:!:It is strongly recommended to use result caches for this type of query.
Enable the result cache
- Yes/no: Enabling the cache lets the dashboard put pre-calculated data in cache, in order to minimise database accesses, which is particularly relevant for statistical queries that need multiple records to produce a smaller number of output data.
The cron allows suitable scheduling of the cache refresh, combined with its TTL value (Time To Live). The cache TTL in minutes can be specified.
Clean the table
- Yes/no: This option lets you choose the resulting columns to display by specifying the stop point in the “Do not clean after column no.:” option
Sortable table
- Yes/No
Subtotal separation column
- Enter the value
Credits
- Valéry Frémaux (valery@activeprolearn.com)- Development and documentation
- Florence Labord (florence@activeprolearn.com) - documentation
Back to the configuration guide index - Back to the component index - Go to the generic query catalog - Back to the plugin index - Back to the catalog
