Tag History via TagID

Hi all

Recently while troubleshooting another issue, I changed a few tags historical settings (specifically sample mode) and also restarted the tag historisation module a couple of times.

This resulted in the tag details changing within sqlth_te, with old rows becoming retired - and new rows, with new tagid values, being created.

This means that now when I try to view historical data associated with these tags in a chart element, via Tag Pens, I can only see data historized after the new tagid was allocated to the tag - as this tagid is what is used to filter data from the sqlt_data_3_2024_06, as I understand it.

Is there some way that a Tag Pen can return data for all of a tags past and present tagids? I'm now in a position where although my data is not lost, thankfully, I cannot easily view this data all together on one chart using tag pens.

Would using DB pens instead with a where clause specifying the tagpath instead of tagid be an alternative for the time being?

Thank you

No

I would strongly advise against going down this route, particularly if you have partitioning configured.

The solution is to go through any of the sqlt_data_* tables and run a query, which replaces the retired id with the newly assigned ID.

3 Likes

I have since had a good remote session with IA and thought it may be useful to pass along my learnings. I had previously assumed that because of new tagids being created, data associated with retired tagids would not be displayed when querying a database, to populate a chart, for example.

In fact, the lack of data shown was due to the partitioning error that was identified and resolved in a remote session. Ignition handles data queries with multiple tagids-per-tag quite intelligently.

When querying the historical data, ignition considers the timeframe of data requested. It then checks the created and retired values of the specified tagpaths, and pulls all of the tagids that have been active during the timeframe requested - even if they have since been retired. These tagids are used to filter the historical data tables and return data points to populate the chart/table etc.

2 Likes