Solutions
...
Interacting with Litmus Produc...
Reading Production Record Event Data Transposed with UTC timestamp
8 min
use cases returning event data recorded by litmus production record database through the use of these select statements can be used for example by any visualization platform which allows to integrate with mssql like; grafana powerbi tableau further can these queries be used by any other application which allows for an odbc connection such as excel c# net python r they can also be part of a larger stored procedure developed by users with t sql by default, litmus production record stores event items as rows and not individual columns there can be cases where users may want to transpose the default result table to turn event items into columns for this, litmus production record database provides a prepared way method as litmus production record makes use of the eav ( https //en wikipedia org/wiki/entity%e2%80%93attribute%e2%80%93value model model for databases, to allow for full flexibility for defining a data model, each data model item returned by the function described in the chapter docid\ zmrhs1q1rgiydzat6wf2z is an individual row in the result table to show the data in a table where each data model item is a column, the original result table needs to be pivoted to allow users to accomplish this task out of the box, litmus production record database offers the stored procedure prorec prorec gettransposedprorecdatautc the stored procedure will create a temporary table which holds the data, against which the user can then run a classic select statement, to allow users to ready the columns they are interested in by default the temporary table is called ##transposeprorecdata but can be changed to a custom table name, which is important if for example a dashboard has several panels which are getting data through the stored procedure rorec prorec gettransposedprorecdatautc input variables 166,127,225,219,133,114 true unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type how to use to query transposed production record event data, execute the stored procedure prorec prorec gettransposedprorecdatautc first providing all the required inputs first followed by a select statement against the table ##occurrencetransposeprorecdata below is an example using t sql in sql server management studio exec \[le productionrecord] \[dbo] \[ prorec prorec gettransposedprorecdatautc] @identifiers = n 'start time 1679655872013,asset\ l1 machine2 1 mb' select from ##transposeprorecdata; result the function returns a table as result additional options it is possible to reduce the number of columns returned by the select statement below is an example using t sql in sql server management studio exec \[le productionrecord] \[dbo] \[ prorec prorec gettransposedprorecdatautc] @identifiers = n'start time 1679655872013,asset\ l1 machine2 1 mb' select prorecid, asset,start time, end time,duration from ##transposeprorecdata; this will reduce the number of columns returned to only the three selected it is possible to group the data based on the time they are recorded exec \[le productionrecord] \[dbo] \[prorec prorec gettransposedprorecdatautc] @identifiers = n'start time 1679655872013,asset\ l1 machine2 1 mb', @withrecordtimes = 1 select from ##transposeprorecdata; the result will be a table, where the data in each column is displayed based on the time they where recorded