Back-fill Transaction Group with Tag History?

Hey folks,

I have a customer who is asking for some utility meter reporting and they have transaction groups that they began late 2016. However, they would like to access data going back as far as early 2014 in tag history format (sampled on the minute). The data needn’t be very high resolution, looking at weekly or monthly windows.

I’m inclined to try to extract the records I need from the tag history and amend the transaction group data tables. Is there a ‘best’ practice in this regard?

Many thanks,
Andrew

Personally, I think the best option would be to insert entries into the new transaction group table using the data from the trends.
You could semi-automate this process by creating a query which constructs the INSERT statements for you. It’s essentially only 1 step further than what you are suggesting anyway, but it would make the data much faster to retrieve and means you don’t have to complicate your return query.

2 Likes

The only gotcha is that the tag history system stores each value with its own timestamp, where a transaction group stores whole rows with one timestamp. You’ll have to carefully select your aggregation mode to produce one row per minute, then truncate or otherwise normalize the timestamp.

1 Like