# Table Grouping in Reporting Module

**URL:** <https://forum.inductiveautomation.com/t/table-grouping-in-reporting-module/55116>\
**Category:** Ignition\
**Tags:** ignition80, ignition81\
**Created:** [January 18, 2022, 3:50pm UTC](https://forum.inductiveautomation.com/t/table-grouping-in-reporting-module/55116 "2022-01-18T15:50:15Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gaurav.Shitole](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/gaurav.shitole/32/72050_2.png) [@Gaurav.Shitole](https://forum.inductiveautomation.com/u/Gaurav.Shitole)\
**Post date:** [January 18, 2022, 3:50pm UTC](https://forum.inductiveautomation.com/t/table-grouping-in-reporting-module/55116/1 "2022-01-18T15:50:15Z")

</div>

Hi there.,  
I am using Reporting module with table grouping and nested query. I am facing following issues with it:

1. Why does it take long time to load the report with Nested query? It takes almost 2-3 minutes to load the report it shows loading… only
2. I have 5 cols, of which 1-2 & 5 are from parent table and 3-4 cols uses child table data key. When data from child key presents on table component of report, it adds one blank cell on parent details row. pl suggest

---

<div class="post-metadata">

**Author:** ![dkhayes117](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dkhayes117/32/68344_2.png) [@dkhayes117](https://forum.inductiveautomation.com/u/dkhayes117)\
**Post date:** [January 18, 2022, 4:26pm UTC](https://forum.inductiveautomation.com/t/table-grouping-in-reporting-module/55116/2 "2022-01-18T16:26:09Z")

</div>

For part 1 I would steer clear of nested queries. A nested query will run for every row of the parent query, depending on the setup, you could end up running way more queries that you think. I had this problem a while back, and I found that I could completely get rid of nested queries with table joins and made the report exponentially faster.

For part 2, I’m not sure. It might be helpful to post a picture of the table.

---

<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:** [January 18, 2022, 4:29pm UTC](https://forum.inductiveautomation.com/t/table-grouping-in-reporting-module/55116/3 "2022-01-18T16:29:54Z")

</div>

If you want a variable report format, where parts of the report vanish when not needed, you **must** use nested queries. Or, get a nested query structure via script. That is, query efficiently with joins, then reformat into a new data key with nested keys programmatically. See this topic for the basic procedure:

> [@Report with Scripted Nested Data](https://forum.inductiveautomation.com/t/report-with-scripted-nested-data/11801):
>
> The report datasource scripting examples explain how to access the nested data in another key for use constructing a custom dataset. What I don’t see is how to construct nested data that would be suitable for use with a child table in a table group. I have a parent dataset that I’m constructing via script due to annoying limitations of an ancient SQL Server 2000 instance. I need a subquery for each row that could be done with a normal query, but there’s no way to add a regular subquery to a s…

---

<div class="post-metadata">

**Author:** ![Gaurav.Shitole](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/gaurav.shitole/32/72050_2.png) [@Gaurav.Shitole](https://forum.inductiveautomation.com/u/Gaurav.Shitole)\
**Post date:** [January 18, 2022, 4:53pm UTC](https://forum.inductiveautomation.com/t/table-grouping-in-reporting-module/55116/4 "2022-01-18T16:53:30Z")

</div>

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/a/4/a41db2cbfde388a8b2aef17fb2ad5c526b5f0c87.png)

Here is a pic.,  
number #25 is data coming from Parent Table and line below is from child table
