Reporting Module - Tag Historian Query - Max t_stamp

I’m working on a report that displays a daily max and when it happened. I’m using a Tag Historian Query and can successfully show the max value, but I’m unsure how get the associated t_stamp. In the preview mode I see the t_stamp and value in the xml so I know it’s there I just can’t get that row out of the xml dataset result.

Thanks for any advice

Hmmm… I don’t have any problems accessing the t_stamp. In the Design panel, on the left, under Key Browers, expand Datasources, expand the name of your tag history query, and t_stamp should be one of the columns available to you.

If that’s not the case, you might need to contact support and do a screen share with them so they can see what’s going on.


Thank you for the reply. Yes I confirm the t_stamp column, but I am specifically looking for the t_stamp when the max value occurred. I can’t quite figure out how to filter the dataset. I’m just looking for the max value and when it happened. Basically get t_stamp when value = max(value)

Ah, I see what you mean now. Unfortunately, although the tag calculation query gives you the max value, it doesn’t give you when that happened.

I see two ways you could do it. One is to query the tag history database yourself. That could get ugly if you need to query across partitions, but it’s doable.

The other way would be to do a tag history query, then have a script datasource below it to loop through the tag history results and look for the timestamp of the max value. The docs have an example of how to loop through a previous datasource with a script datasource.

Understood. Thank you for options.