How to Save workorder information with transaction group

We are using the Ignition tag historian to save all the time-series data. To visualize it together with context we also get the MES data with workorder information. Currently we save it in the taghistorian as timeseries data, but that's not the best practice I assume. Can anyone share best practice here or refer to any material/documentation?

If not the next step would be to only record one line for every unique OrderNumber. The current setup is giving me a lot of rows with duplicated data for each ProducedQuantity update, but I only want it with the latest ProducedQuantity, when the order is finished. How would I build that transaction group?

To store the OrderNumber with all its information when a new order is started, and then only update the Produced Quantity field on that specific unique row, until a new unique OrderNumber is registered (i.e. the last one was finished and a new product started).

Probably quite a beginner question, but I find it hard to figure out on my own and get hands on material that provide the insight. Thanks for any help!

Transaction Group in Ignition:

Query from SQL db:

You'll want to use update/select under your transaction group settings. For which row to update, you'll need to choose "custom" and set up an expression or "key/value pair" (probably easier in this case) that matches your OrderNumber to the right table column, and then check "Insert row when not present" so that it will make a new row when you get a new OrderNumber.

https://docs.inductiveautomation.com/display/DOC81/Understanding+Transaction+Groups#UnderstandingTransactionGroups-ActionSettings

Let us know if you run into any issues.

Thanks, I got it set up and it works. I used "key/value pair".