Reporting - Dynamic Historical Tags

Searching the online documentation I found that you may have pseudo-dynamic historical tags configured for your Tag Historian Query on your reports. And I say pseudo because a fixed set of tags must be configured.

This works when all of the devices share the same set of tags, but what if they don’t? What to do then?

Take this for example:

Ovens
  - Oven 1
    - Z1
  - Oven 2
    - Z1
    - Z2
  - Oven 3
    - Z1
    - Z2
    - Z3

If I created a single report and use indirection (as suggested in the docs), I would have to manually create three tags and replace the oven number with a parameter I’d bind to the report. But this would mean that Ovens 1, and 2 would show tags that don’t even exist for them (Z2, and Z3 for Oven 1, and Z3 for Oven 2).

Does this mean that I definitely have no other choice but to create a report for each oven? :sweat:


On the other hand, I’ve been considering manually querying historical information from the database, retrieving data from two tables as needed (in case I am using monthly partitions, and wanted to retrieve data from the final days of one month, and the first day of the subsequent month), and plot that onto the XY Chart. But then, how to format the date values on the X axis from “Epoch” onto human-readable dates?

Thoughts anyone?

Thanks!

You can use a scripting datasource (even a nested one) to perform your tag history query in a dynamic way and nest the results.

See this topic for ideas:

2 Likes

I guess I forgot to mention that I intend to plot the historical data onto a Timeseries Chart.

I am thinking about using system.tag.queryTagHistory on my Script Data Source. But the Pens on any charting component appear to be static (or pseudo-dynamic).

I’m not able to dynamically bind pens to any of them. Unless I am missing something or maybe Ignition does not currently offer a way to handle this scenario.

Could I bind the Pens via the configureChart function?

Or is my approach not the most appropriate?

The actual pens are static, but as of 7.9.7 the configureChart function does have access to the other datasources on the report - so it would be possible to manually bridge between Ignition datasets and JFree datasets. Not trivial, but possible.

1 Like

Due to time constraints I guess my only option is creating individual reports, but this is something that I will add on the ideas portal.

Thank you all for your input.

1 Like

This will create a dynamic timeseries chart, given that all possible pens are pre-defined. (legend items for pens not used will be hidden):