This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
blocks:dashboard:userguide [2017/08/11 22:36] admin |
blocks:dashboard:userguide [2023/01/31 16:46] (current) |
||
---|---|---|---|
Line 14: | Line 14: | ||
there are 6 main steps in setting up a dashboard query: | there are 6 main steps in setting up a dashboard query: | ||
- | * Carefully identify in which tables and which fields are the data that represents the query | + | - Carefully identify in which tables and which fields are the data that represents the query |
- | * Identify the dimensions of sorting and filtering | + | - Identify the dimensions of sorting and filtering |
- | * Write and test the base query form in a DB client | + | - Write and test the base query form in a DB client |
- | * Copy the query in the dashboard | + | - Copy the query in the dashboard |
- | * configure the output (data tables or graphs) | + | - configure the output (data tables or graphs) |
- | * Setup accessories, (filters, parameters, colorizers, sub-totals, summators, etc). | + | - Setup accessories, (filters, parameters, colorizers, sub-totals, summators, etc). |
==== Think about the problem (identify the query) ==== | ==== Think about the problem (identify the query) ==== | ||
Line 25: | Line 25: | ||
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. | 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. | ||
- | ==== Identifier les modalités de tri et de filtrage ==== | + | ==== Identify dimensions for sorting or filtering ==== |
- | Le bloc Tableau de Bord est conçu de telle manière à ce que, une fois mise en place par un utilisateur autorisé, il puisse servir d'outil dynamique d'exploration de données pour l'usager final. Il est donc important de bien penser aux filtres et autres outils dynamiques que l'on va mettre en place sur la requête. | + | 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. |
- | ==== Ecrire et tester la requête de base ==== | + | Usually a data query will output a set of columns (data fields), which can be classed into the following categories : |
- | Vous utiliserez pour cela un client standard de votre base de données. Ce test permet de vérifier que la requête de départ fonctionne correctement et qu'elle produit bien des données cohérentes. | + | * The identifier(s) |
+ | * The useful data (the really observed values) | ||
+ | * The contextual dimensions (that split the data space into local contexts) | ||
+ | * the technical data (that helps to calculate, format, or build other final results) | ||
- | === Les pièges à éviter === | + | Filters usually will be defined upon the contextual dimensions, while parameters may usually affect usefull or technical values. |
+ | ==== Write and test a base query ==== | ||
- | * Faire particulièrement attention à la première colonne extraite dans la requête. Il doit s'agit d'une donnée unique valant pour clef. Si tel n'est pas le cas, le résultat apparent semblera avoir perdu des données. | + | 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. |
- | * Utiliser des requêtes composées (UNION, INTERSECT) dans lesquelles le placement de certains compléments automatiques de SQL ne peut pas se faire. | + | |
- | * Utiliser des requêtes imbriquées complexes mettant en jeu de nombreuses séquences ORDER BY ou GROUP BY. | + | |
- | ==== Mettre en place la requête ==== | + | === Several traps to avoid === |
- | La mise en place de la requête dans le tableau de bord est la première chose à faire réellement dans le tableau de bord. | + | * Check carefully the first output field of your query. it MUST be a primary key for your result. This is a special attention to observe when f.e. using GROUP BY clauses or using time range extractions. Think that the query will give result through the standard DB middleware library of moodle, that uses the first column as the results associative table as php output, so it needs being a unique key of your result, or you will loose data. |
+ | * Use some UNION or INTERSECT in which the Dashboard SQL post processing will NOT be able to find the clauses it needs rework. | ||
+ | * Use complex subqueries that multiplies the ORDER BY or GROUP BY clauses. | ||
- | - Passez le cours en mode édition | + | ==== Enter the query in the Dashboard configuration ==== |
- | - Editez les paramètres du bloc Tableau de Bord à configurer | + | |
- | - Dépliez la rubrique //Paramètres du tableau de bord// | + | |
- | - Cliquez sur //Accédez à la définition du tableau de bord// | + | |
- | Le premier onglet est là où vous allez poser la requête. | + | copy the query in the query text area of the dashboard is the effective first thing to do. |
- | ==== Détail des écrans de configuration ==== | + | - Switch to the course editing mode |
+ | - Edit the block's settings | ||
+ | - Expand the //Dashboard settings// form section | ||
+ | - Click on the //Access to dashboard settings// | ||
- | * [[:BlockDashboardConfigQuery|Configuration de la requête]] | + | The first panel shows the textarea where to put the query. |
- | * [[:BlockDashboardConfigUserParams|Configuration des paramètres utilisateur]] | + | |
- | * [[:BlockDashboardConfigOutputFields|Configuration des informations de sortie]] | + | |
- | * [[:BlockDashboardConfigOutputTabular|Paramètres supplémentaires des sorties en tables croisées]] | + | |
- | * [[:BlockDashboardConfigOutputTreeview|Paramètres supplémentaires des sorties en arbre hiérarchique]] | + | |
- | * [[:BlockDashboardConfigPlotting|Configuration de l'affichage en graphe]] | + | |
- | * [[:BlockDashboardConfigSummarizers|Configuration des sommateurs]] | + | |
- | * [[:BlockDashboardConfigColoring|Configuration de la colorisation de données]] | + | |
- | * [[:BlockDashboardConfigScheduling|Configuration du raffraichissement de données]] | + | |
- | * [[:BlockDashboardConfigFile|Configuration de la sortie sur fichier]] | + | |
- | [[:Blocks:Dashboard|Retour à l'index du bloc]] | + | ==== Dashboard configuration screen details ==== |
+ | |||
+ | * [[:BlockDashboardConfigQuery|Query]] | ||
+ | * [[:BlockDashboardConfigUserParams|User params]] | ||
+ | * [[:BlockDashboardConfigOutputFields|Data output]] | ||
+ | * [[:BlockDashboardConfigOutputTabular|Data matrix additional params]] | ||
+ | * [[:BlockDashboardConfigOutputTreeview|Data tree view additional params]] (Pro Version) | ||
+ | * [[:BlockDashboardConfigPlotting|Graphic output]] | ||
+ | * [[:BlockDashboardConfigPlotting|Additional GoogleMap parameters]] (Pro Version) | ||
+ | * [[:BlockDashboardConfigPlotting|Additional timeline parameters]] (Pro Version) | ||
+ | * [[:BlockDashboardConfigSummarizers|Summators and filters]] | ||
+ | * [[:BlockDashboardConfigColoring|Data coloring]] (Pro Version) | ||
+ | * [[:BlockDashboardConfigFile|Data export to files]] | ||
+ | * [[:BlockDashboardConfigScheduling|Data export sheduling]] (Pro Version) | ||
+ | |||
+ | [[:Blocks:Dashboard|Back to the plugin index]] |