Custom Reporting

    Custom Reporting


    Article summary

    Steelhead provides an extremely flexible reporting interface to allow you to quickly track, graph, and export your plant's data.

    The reporting tool leverages a sandboxed SQLite database that allows you to perform complex queries in - by far - the most commonly used query language in use today. For some basic tutorials on SQLite, visit sqlitetutorial.net/sqlite-select/ (link out).

    Reporting version 2 in Steelhead uses DuckDB to run. Here is their User Documentation.

    Native reporting features like Insights, for historical data, and the Watch Tower, for active data, are also available for common queries.


    Creating a Report

    Navigate to Reports.

    Here you will see an interface that will allow you to create a new query for your data. Data that you can query (tables) are listed on the left hand side.


    Run a simple query

    In the query editor window enter:

    select * from users;
    

    And click "Run Query" in the toolbar at the top of the page. You will see a result of your users in the plant. This simple query by itself isn't particularily useful, however, it can be used to join with other data to get per-user metrics.

    image.png

    To quickly generate a select * from query for a table, right click on the table and click "Run Select All Query".

    image.png

    You can download your result by clicking "Download Data" in the toolbar and it will download a CSV file, these files can easily be imported into excel.


    JSON Queries

    Custom inputs (for example operator inputs on part transfers) are stored as JSON. These inputs can be queried using the json_extract function of SQLite.

    The example below shows a list of parts transfers that have a custom field created on it with a "pH" entry.

    image.png

    To create a report of the pH at a specific process node over time we can use a query like the following snippet where derived_from is the id of the process node you are interested in generating a report for.

    select json_extract(from_node_custom_input,'$.pH') as pH 
        from parts_transfer where from_recipe_node_id 
        in (select id from recipe_node where derived_from = 2)
    

    In the result below you can see the pH level and the time that pH level was taken.

    image.png


    Charting

    Using the example above, we can generate a chart to show this data. To create a chart, click on the "Charts" tab and click "Add Chart".

    image.png

    Fill out your desired data, chart type, etc. and choose which fields you would like on your x and y-axis.

    image.png

    Click "Update Chart" and you will see your chart appear.

    image.png

    View mode can be activated with the toggle on the top right of the chart editor. View mode allows you to hide the editor and just view the charts. Saved charts are loaded in this mode to start.
    Here is a video on the more advanced reporting view options that Steelhead offers.

    Downloading charts can be done by clicking the cloud icon on the top right of the chart you wish to save as an image.


    Saving

    Reports can be saved using the "Save Report" button in the toolbar. Give the chart a name in the popup dialog.

    image.png


    Loading Saved Reports

    Saved reports can be loaded by clicking the report in the bottom left.

    image.png

    Reports can also by found by searching by name in the global search.

    image.png


    Was this article helpful?