# Reporting: a table with unique data/calculations for each cell

**URL:** <https://forum.inductiveautomation.com/t/reporting-a-table-with-unique-data-calculations-for-each-cell/103495>\
**Category:** Ignition\
**Tags:** database, reporting\
**Created:** [March 11, 2025, 7:55am UTC](https://forum.inductiveautomation.com/t/reporting-a-table-with-unique-data-calculations-for-each-cell/103495 "2025-03-11T07:55:53Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![milton.stathakis](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/milton.stathakis/32/73561_2.png) [@milton.stathakis](https://forum.inductiveautomation.com/u/milton.stathakis)\
**Post date:** [March 11, 2025, 7:55am UTC](https://forum.inductiveautomation.com/t/reporting-a-table-with-unique-data-calculations-for-each-cell/103495/1 "2025-03-11T07:55:53Z")

</div>

![Example1](https://us1.discourse-cdn.com/inductiveautomation/original/3X/6/6/66c85f5b212e3c4973d43a05f4960e2294106233.png)

Hi everyone,

I am using Ignition reporting to create an auto-generating production report. What is the best practice to import the data as shown in the image. I tried using individual parameters for each cell in the top table, and in the bottom table I created a SQL query to do the same thing.

I am trying to do this for a dynamic range as the production period for each batch will vary, is the system.tag.queryTagCalculations or TagHistory more appropriate? Any further guidance would be very appreciated.

---

<div class="post-metadata">

**Author:** ![bschroeder](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bschroeder/32/13260_2.png) [@bschroeder](https://forum.inductiveautomation.com/u/bschroeder)\
**Post date:** [March 11, 2025, 12:04pm UTC](https://forum.inductiveautomation.com/t/reporting-a-table-with-unique-data-calculations-for-each-cell/103495/2 "2025-03-11T12:04:54Z")

</div>

How/where is the data being stored? That will probably determine how you accomplish this.

---

<div class="post-metadata">

**Author:** ![milton.stathakis](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/milton.stathakis/32/73561_2.png) [@milton.stathakis](https://forum.inductiveautomation.com/u/milton.stathakis)\
**Post date:** [March 11, 2025, 12:41pm UTC](https://forum.inductiveautomation.com/t/reporting-a-table-with-unique-data-calculations-for-each-cell/103495/3 "2025-03-11T12:41:11Z")

</div>

It's being stored in sqlt\_data\_1\_2025\_03 in a MS SQL database, each tag has the historian enabled so I am retrieving from there. I want to generate the report as the batch is running - so should I be retrieving data from elsewhere to have it running live?

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [March 11, 2025, 12:59pm UTC](https://forum.inductiveautomation.com/t/reporting-a-table-with-unique-data-calculations-for-each-cell/103495/4 "2025-03-11T12:59:32Z")

</div>

> [@milton.stathakis](#):
>
> I want to generate the report as the batch is running...

This seems odd. Normally reports are generated _after_ the batch is complete.  
An exception might be where you want a periodic report on a long-running batch.

Are you sure you shouldn't be using Vision or Perspective to show the current status of the batch?

---

<div class="post-metadata">

**Author:** ![bschroeder](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bschroeder/32/13260_2.png) [@bschroeder](https://forum.inductiveautomation.com/u/bschroeder)\
**Post date:** [March 11, 2025, 12:59pm UTC](https://forum.inductiveautomation.com/t/reporting-a-table-with-unique-data-calculations-for-each-cell/103495/5 "2025-03-11T12:59:57Z")

</div>

OK... so this is data from the history system.

Don't try and query the table directly.

You should be able to use a Tag Historian Query data source, and then use the reporting system to grab the min/max/avg from the datakeys. Make sure that you select the "Show Calculation".

If this is specific batching data, you may want to rethink how the data is going into the database to aid in this. Maybe log data using a transaction group or something similar that is tied to a batch record. Just a thought.

---

<div class="post-metadata">

**Author:** ![milton.stathakis](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/milton.stathakis/32/73561_2.png) [@milton.stathakis](https://forum.inductiveautomation.com/u/milton.stathakis)\
**Post date:** [March 11, 2025, 1:03pm UTC](https://forum.inductiveautomation.com/t/reporting-a-table-with-unique-data-calculations-for-each-cell/103495/6 "2025-03-11T13:03:50Z")

</div>

You're right, the report should be generated once the batch is complete. There is a 'batchnumber' OPC tag that I am monitoring; a tag value change triggers the batchStart and batchEnd times to give the range.

---

<div class="post-metadata">

**Author:** ![milton.stathakis](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/milton.stathakis/32/73561_2.png) [@milton.stathakis](https://forum.inductiveautomation.com/u/milton.stathakis)\
**Post date:** [March 11, 2025, 1:05pm UTC](https://forum.inductiveautomation.com/t/reporting-a-table-with-unique-data-calculations-for-each-cell/103495/7 "2025-03-11T13:05:18Z")

</div>

Appreciate the help, I will try using the Tag Historian Query.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [March 11, 2025, 1:39pm UTC](https://forum.inductiveautomation.com/t/reporting-a-table-with-unique-data-calculations-for-each-cell/103495/8 "2025-03-11T13:39:43Z")

</div>

If your setpoints and specification limits are set by recipes, you should probably be handling those in a separate table, and using separate queries to retrieve those per batch. Such time-coordinated values are not well-suited to the tag historian.
