Use cases & Reporting
Batch Reporting
Weekly report dashboard
introduction this document describes how to set up a weekly production report dashboard it gives shift leads and production managers a week by week overview of batch throughput, energy consumption and quality results across both production lines audience shift leads, production managers purpose weekly production review and cross line quality tracking dashboard layout batch throughput (by line, by recipe) average energy per batch by recipe quality results per mixer key design decisions before building, two aspects of this dashboard are worth understanding because they shape how everything is wired together all variables are hidden unlike the operator or batch comparison dashboards, $line , $mixer are all hidden from the dashboard header both lines are selected by default, all recipes are included by default, and the user never needs to touch a variable the only control exposed to the user is the time picker , which is pre configured with weekly quick ranges so the user can step back week by week with a single click the quality panels use $mixer with repeat rather than duplicating panels for line 1 and line 2, the donut and stat panels are configured to repeat vertically once per value of the $mixer variable this means the quality section automatically scales if a third line is ever added step by step creating variables $line and $mixer create variable $line follow the same steps as in the guide, but with one difference set hide to variable so it does not appear in the dashboard header both lines should be selected by default general name line label line hide variable query options query type asset filter by asset path /^line/ parent assets no parent selection options multi value checked deselect 'allow custom values' create variable $mixer same as the operator dashboard guide, but also hidden general name mixer label mixer hide variable query options query type asset filter by asset path /mixer$/ parent assets $line use asset path as value checked (this is important the asset path rather than the asset name is used as the value, because both mixers are called "mixer", which could lead to confusion ) selection options include all option checked multi value checked deselect 'allow custom values' configure the time picker rather than a variable, week navigation is handled entirely through the time picker the default time range and week start day can be set through the grafana ui, but you can also set custom quick ranges by editing the dashboard json directly set the default time range and week start in dashboard settings > time options week start monday open the dashboard json model in dashboard settings > json model , find the timepicker object by default it looks like this "timepicker" {} replace the timepicker object with the custom quick ranges "timepicker" { "quick ranges" \[ { "display" "this week", "from" "now/w", "to" "now/w+1w" }, { "display" "last week", "from" "now 1w/w", "to" "now/w" }, { "display" "2 weeks ago", "from" "now 2w/w", "to" "now 1w/w" }, { "display" "3 weeks ago", "from" "now 3w/w", "to" "now 2w/w" }, { "display" "4 weeks ago", "from" "now 4w/w", "to" "now 3w/w" } ] } save the dashboard the time picker dropdown will now show these five options instead of grafana's default ranges, making it immediately clear to any user how to navigate between weeks adding quick ranges replaces grafana's built in quick ranges entirely if you want to keep any of the defaults (e g "last 7 days"), add them explicitly to the list alongside the weekly options add a time series visualisation total batches by day by line this panel shows how many batches ran each day, with each series representing one recipe on one line click > visualisation and select data source factry historian datasource configure the data source tab events query type simple assets $mixer event types mixing batch properties / add transformations this is the most involved transformation pipeline in the dashboard each step is necessary format time format starttime as dd mm yyyy (browser timezone) this strips the time component so events on the same day can be grouped together correctly in the next step group by group by starttime and assetpath , aggregate eventuuid as count this gives a row per day per line with a batch count partition by values partition by recipe and assetpath this splits the single table into one series per recipe+line combination, which is what the time series panel needs to draw separate lines convert field type convert starttime from string back to time using format dd mm yyyy the format time step turned it into a string; this step turns it back into a proper timestamp so the time series panel can place it on the time axis correctly rename by regex regex ( line \d) , rename pattern $1 this trims the asset path down to just the line name (e g faketory/line 1/mixer becomes line 1 ) to keep the legend readable change visualisation to time series and configure panel options panel options title total batches by day by line transparent background checked graph styles draw style line fill opacity 0 (default) stacking normal decimals 0 (batch counts are whole numbers) legend mode table values sum placement right width 350 field overrides fields matching / line 2/ set fill opacity to 0 and color to #505050 (this visually separates the two lines — line 1 gets a filled area, line 2 gets a plain dark line ) add a time series visualisation total batches by day by recipe this panel shows the same data but partitioned by recipe instead of by line, so the viewer can see which recipes drove throughput on any given day click > visualisation and select data source factry historian datasource use the same query as the previous panel $mixer , event type mixing batch , property filter recipe in $recipe add transformations the pipeline is the same as the "by line" panel with two differences format time — same as before group by — group by starttime and recipe , aggregate recipe as count (group by recipe this time, not assetpath ) sort by — sort by recipe before partitioning to ensure a consistent series order partition by values — partition by recipe and assetpath convert field type — same as before rename by regex — regex ( recipe \d) , rename pattern $1 change visualisation to time series and configure panel options panel options title total batches by day by recipe transparent background checked graph styles draw style bars bar width factor 0 3 fill opacity 40 stacking normal legend mode table values sum placement right width 350 field overrides fields matching /energy/ set draw style to line , unit to kwh , fill opacity to 0 (a future overlay of energy data would automatically render as a line rather than a bar ) add a bar chart visualisation avg energy per batch by recipe this panel sits to the right of the two throughput panels and spans both rows it shows the average energy consumed per batch, grouped by recipe, with one bar per line this makes it easy to compare whether line 1 and line 2 are equally efficient for the same recipe click > visualisation and select data source factry historian datasource configure the data source tab events query type simple assets $mixer event types mixing batch properties total energy usage , recipe add transformations group by group by assetpath and recipe , aggregate total energy usage as mean organize fields rename total energy usage (mean) to avg energy usage sort by sort by recipe for consistent column ordering grouping to matrix column field recipe , row field assetpath , value field avg energy usage (this pivots the data so each recipe becomes a column and each line becomes a row this becomes the shape the bar chart needs to draw grouped bars ) sort by sort by the field assetpath\\ to ensure lines appear in a consistent order change visualisation to bar chart and configure panel options panel options title avg energy per batch by recipe transparent background checked bar chart options x field assetpath orientation auto bar width 0 6 show value auto text size 30 legend visibility unchecked (recipe names are already the bar group labels) field overrides assign consistent colours by recipe number fields matching / 1$/ → #25cd93 fields matching / 2$/ → #9977ff fields matching / 3$/ → #cd9b25 add a pie chart visualisation visual inspection results this donut chart shows the split of pass , fail and needs review outcomes for the visual inspection quality check it is configured to repeat per mixer , so one donut automatically appears for each line click > visualisation and select data source factry historian datasource configure the data source tab events query type simple assets $mixer event types emptying step properties visual inspection result add transformations filter by value exclude rows where visual inspection result is null without this, batches where the field was not filled in would count as a third outcome and distort the percentages group by group by visual inspection result , aggregate as count this gives a row per outcome value with its count transpose pivots the result values into columns ( pass , fail , needs review ) with their counts as values the pie chart expects one column per slice change visualisation to pie chart and configure panel options panel options title $mixer transparent background checked pie chart options pie type donut display labels name , percent sort desc field overrides assign consistent colours field pass → #25cd93 field fail → dark red field needs review → #cd9b25 configure panel repeat in the panel options, under repeat options repeat by variable mixer repeat direction vertical this creates one donut per mixer value (i e one per line) stacked vertically, without needing to duplicate the panel add stat visualisations color check and clarity pass rates these two stat panels show the pass rate (as a percentage) for the color check and clarity quality properties both use the same transformation pattern and are also configured to repeat per mixer click > visualisation and select data source factry historian datasource configure for color check first, then duplicate for clarity tab events query type simple assets $mixer event types emptying step properties color check add transformations this pipeline computes pass count / total count to produce a percentage filter by value exclude rows where color check is null group by group by color check , aggregate as count this gives one row per outcome value transpose pivots outcome values into columns (e g normal , abnormal ) with counts as values calculate field leave options empty this step adds a total column by summing all existing value columns calculate field mode binary operation left normal operator / right total alias normal replace all fields checked this divides the count of normal results by the total to produce a rate between 0 and 1 change visualisation to stat and configure panel options panel options title $mixer color check pass rate transparent background checked value options fields /^normal$/ reduce last (not null) standard options unit percent (0–1) min 0 , max 1 no value no data stat styles color mode none graph mode area configure panel repeat same as the donut panel repeat by variable mixer repeat direction vertical duplicate for clarity duplicate the panel and make two changes query property clarity instead of color check title $mixer clarity check pass rate in the filter by value transformation change the field from color check to clarity in the binary calculate field transformation change both the left operand and alias from normal to clear (the clarity field uses clear as its passing value rather than normal ) add a table visualisation failed quality checks this full width table at the bottom of the dashboard lists every emptying step event across both lines where the visual inspection result was not pass it gives reviewers a direct list of batches that need follow up, including which recipe the failed batch belonged to click > visualisation and select data source factry historian datasource configure the data source tab events query type simple assets $mixer event types emptying step properties visual inspection result , color check , clarity , sample taken , sample id , parent\ recipe include parent info checked property filter visual inspection result != pass enabling include parent info and adding parent\ recipe to the properties list pulls the recipe name from the parent mixing batch event into each emptying step row this lets reviewers immediately see which recipe was involved without having to navigate to the batch detail add transformations organize fields hide all internal fields asset , assetuuid , duration , eventtype , eventtypeuuid , eventuuid , parenteventuuid , stoptime , and all parent fields except parent recipe rename parent recipe to recipe keep assetpath and starttime visible sort by field starttime , reverse checked change visualisation to table and configure panel options panel options title failed quality checks field overrides visual inspection result cell type → pill , map fail → dark red , needs review → #cd9b25 color check cell type → pill , map normal → #25cd93 clarity cell type → pill , map clear → #25cd93 end result the finished dashboard gives a complete weekly production summary in three sections use the quick ranges in the time picker ( last week , 2 weeks ago , etc ) to step back through previous weeks all variables are hidden the only user facing control is the time picker itself