%%KPIAnalysis @column: <Symptom> // column using a smptom and its value @column: <Column-Name> = <expression> // column using a temporal expression @case: <Regex> // evaluates all matching cases @purge: <enabled|disabled> // enables usage of the purge strategy
To conduct a new KPI-Analysis for a d3web knowledge base, we recommend to create a new wiki page “KPI”. This wiki page can be used to define KPIs in the KPI markup and to extend the knowledge base to calculate special KPIs if needed.
In the following section a common way to define a KPI analysis is described. For most use cases a more plain configuration may be sufficient, as described in section 3.2
Not all KPIs will be available in the knowledge base as variables right away. Also, often the KPIs cannot simply be added to the regular knowledge base, because the knowledge base should stay unchanged for its integrity. Also the speed of the reasoning could be influenced negatively.
To work around this, the KPI analysis should be done in its own extended knowledge base, which will be compiled on a newly created page, for example with the name “KPI”.
As a first step, a new package will be set and used on this page. Again, for example “KPI“ can be used as the package name.
Next, the new knowledge base used for analyzing the KPIs has to be defined. It has to compile (@uses) the package used for the original knowledge base (in most cases “default”) and also the package used to extend the knowledge base with the KPI variables and calculations (“KPI”). This new knowledge base will then automatically be used in the generation of the KPI results. The original knowledge base will not be effected through this new knowledge base.
Using the new knowledgebase, as the next step the actual variables used in the KPI analysis can be collected and defined using the
%%Variable KPI_Date = firstChange(filter(Solution[], established))After execution, the history of a solution is filtered for the entries where the Solution was established. In combination with the function firstChange, the date of entry will be selected, where the solution was first set to established.
%%Variable KPI_Date = latestChange(filter(Solution[], established))
Minimum or maximum of a variable
A frequently needed KPI is the minimum or maximum of a variable during the execution of a case. The calculation can here be done simply with the following formula:
%%Variable KPI_Num = min(QuestionNum[]) %%Variable KPI_Num = max(QuestionNum[])
%%Variable KPI_Num = count(filter(QuestionNum[], '>', 25))The KPI variable KPI_Num will contain the amount of history entries of the variable QuestionNum, that are greater than 25.
%%Package KPI %%KnowledgeBase KPI-KB @uses: default @uses: KPI % !! KPI Definition %%Question KPI_Date [date] KPI_YN [yn] KPI_Choice [oc] KPI_Num [num] KPI_Text [text] % !! KPI Calculation %%Variable KPI_Date = firstChange(filter(Solution[], established)) %%Variable KPI_YN = QuestionNum[KPI_Date] > 15 %%Variable KPI_Num = count(filter(QuestionNum[], '>', 25)) %%Variable KPI_Text = QuestionText[KPI_Date] !! KPI Markup %%KPIAnalysis @column: KPI_Date @column: KPI_YN @column: KPI_Choice @column: KPI_Num @column: KPI_Text @case: Cases/2012031332 @case: Cases/2012070952 @case: Cases/2012035580 @case: Cases/2012066245 @case: Cases/2012119943 %
Instead of defining a new knowledge base for the KPI, the markup could also allow to define and calculate the KPIs in a similar way as they are otherwise defined in the and calculated in the
%%KPIAnalysis @column: KPI_Date = firstChange(filter(Solution[], established)) @column: KPI_YN = QuestionNum[KPI_Date] > 15 @column: KPI_Num = count(filter(QuestionNum[], '>', 25)) @column: KPI_Text = QuestionText[KPI_Date] @case: Cases/.* %
This way, the separate usage of the and markup would mostly be obsolete. The current knowledge base will not be changed in any way by definition and calculation of the columns directly inside the markup.
After the KPI page is set up correctly, the actual results for the analysis can be generated. To generate the results, to possibilities are given.