Use cases & Reporting
Batch Reporting
Batch comparison dashboard
introduction this document describes how to set up a more advanced batch comparison dashboard it allows operators and process engineers to select multiple batches and compare their process signals, energy usage, and step durations side by side audience process engineers, shift leads purpose batch level analysis and performance comparison dashboard layout batch selection table process signal trend (per batch) energy & power comparison step duration breakdown step by step creating variables $line , $mixer , $recipe , $batchid , $property and $step this dashboard relies on a cascade of variables the selected line drives the mixer, which then determines which recipes and batches are available two additional variables control which property and which batch steps are visualised in the lower panels create variables $line and $mixer follow the same steps as described in the docid\ tczshwhbcgwzhm5gvsbk9 guide to create the $line and $mixer variables the configuration is identical create variable $recipe this variable populates from the distinct recipe property values found in mixing batch events, so the user can filter the batch list by recipe general name recipe label recipe query options query type event property values asset $mixer event type mixing batch property recipe selection options deselect 'allow custom values' create variable $batchid this is a multi value variable that lets the user pick one or more batches to compare it is filtered by the currently selected $recipe general name batchid label batch id query options query type event property values asset $mixer event type mixing batch property batchid property filter recipe = $recipe override time range checked (this ensures all historical batch ids are returned, not just those within the dashboard time range ) selection options multi value checked deselect 'allow custom values' sort alphabetical (desc) (most recent batch ids surface first) create variable $property this variable lets the user choose which numeric asset property to plot in the trend panel general name property label property query options query type asset property asset $mixer datatypes number selection options multi value checked deselect 'allow custom values' create variable $step this variable controls which batch sub steps are included in the step duration chart general name step label step query options query type event type filter by keyword /step$/ (matches filling step, mixing step and emptying step ) selection options multi value checked deselect 'allow custom values' add a table visualisation batch list this panel is the central navigation element of the dashboard it lists all mixing batch events for the selected recipe and time range, and highlights the currently selected batches so the user always knows which ones are being compared in the other panels click > visualisation and select data source factry historian datasource configure query in — selected batches tab events query type simple assets $mixer event types mixing batch property filter recipe = $recipe batchid in $batchid add a second query not in — unselected batches duplicate the first query and change the batchid filter to not in $batchid this separation is what enables row highlighting the in query results get a background colour via a calculatefield (index) transformation, while not in rows remain unstyled add transformations calculate field mode row index , applied only to the in query (filter by ref id) this creates a row column whose presence marks selected batches merge series/tables combines the in and not in results into one table filter fields by name keep batchid , starttime , stoptime , duration sort by field starttime reverse checked change visualisation to table and configure panel options panel options title mixing batch $recipe field overrides batchid enable column filtering ( filterable checked ), set a fixed column width row cell type → color background (basic) , apply to entire row checked , map >= 0 to a highlight colour (e g #25cd9399 ), hide the column from the visualisation ( hide from viz checked ) data links on batchid add to graph → links to the same dashboard passing ${{ all variables}}\&var batchid=${ data fields batchid} this will refresh the dashboard with the current variables selected but the new batchid added as well see https //grafana com/docs/grafana/latest/visualizations/dashboards/build dashboards/create dashboard url variables/#variables as query parameters for details add a trend visualisation process signal per batch this panel overlays the selected process property (e g temperature, rpm) for each selected batch on a common time axis so the shapes can be compared directly, independent of when each batch ran click > visualisation and select data source factry historian datasource query options time range override now 1y to now (prevents the dashboard time picker from clipping the data if the selected event is not in the time window ) hide time override checked configure the data source tab events query type periodic assets $mixer event types mixing batch asset properties $property aggregation mean , period 1m property filter batchid in $batchid override assets $mixer fetch asset properties checked enabling fetch asset properties tells the query to also return an asset's properties alongside the properties stored on the event this is what makes the $property variable actually work as a selector here so select $property from $mixer here add transformation filter fields by name identifier ^(?!level ) this excludes the event property level which is stored on the event if we don't do this the level property will always be show, regardless of the setting of $property , which is undesired here change visualisation to trend the trend panel type is required here because the data is periodic (index based) rather than time series configure panel options panel options title $property transparent background checked default display name ${ field labels\["batchid"]} ${ field labels\["property"]} legend mode table values first (not null) , diff , last (not null) add bar gauge visualisations energy & power per batch two side by side bar gauges give a quick energy summary across the selected batches add the total energy usage bar gauge click > visualisation and select data source factry historian datasource tab events query type simple assets $mixer event types mixing batch property filter batchid in $batchid add transformation grouping to matrix column field batchid row field asset value field total energy usage change visualisation to bar gauge and configure orientation horizontal display mode lcd name placement left reduce last (not null) title total energy usage transparent background checked add the average power bar gauge duplicate the total energy usage panel change only grouping to matrix value field average power title average power name placement hidden (the batch ids are already shown in the adjacent total energy panel) width narrow add a bar chart visualisation step duration breakdown this panel shows how long each batch step (filling, mixing, emptying) took for each selected batch, stacked horizontally click > visualisation and select data source factry historian datasource configure the data source tab events query type simple assets $mixer event types $step include parent info checked property filter (parent) parent\ batchid in $batchid using include parent info and filtering on the parent's batchid property links each step event back to its parent mixing batch, so the chart can be grouped correctly add transformations merge series/tables grouping to matrix column field eventtype row field parent batchid value field duration organize fields reorder columns so the steps appear in the logical process order filling step , mixing step , emptying step change visualisation to bar chart and configure panel options panel options title duration $step bar chart options orientation horizontal stacking normal bar width 0 97 show value auto legend visibility unchecked (the step names are already visible as bar segments) field overrides assign consistent colours filling step → #9977ff mixing step → #25cd93 emptying step → text (default) end result the finished dashboard provides a complete batch comparison workflow select a recipe with $recipe to filter the batch list pick one or more batches in the table (highlighted rows = selected) or via the $batchid variable switch properties with $property to compare temperature, rpm, energy usage, etc in the trend panel toggle steps with $step to focus the duration chart on specific phases the dashboard refreshes every 30 seconds, so it remains useful during an active batch as well as for post batch analysis