Home
Analytics
Nested Table Woes
rtruban
I have a report that uses 3 nested tables. (Parent<--Child<--Grand Child)
The query for the grand-child table is written so it returns a value if there is a match in the child table OR in the parent table.
When ever there is a record that has a relationship directly from the grand child table to the parent table nothing is returned. I think I understand why this happens, because the row for child is null, the grand child table is not created.
Since the parameter bindings for the grand child table allow you to link to either the child table or the parent table, so I figured my technique would work (or what's the purpose of showing both tables?).
Is there way to force the grand child table to always instantiate? Or some other technique to get this OR to work?
Thanks in advance!
Rob
Find more posts tagged with
Comments
kclark
Can you create this with the sample db and post it please?
rtruban
I can not simulate the problem with the classic models database. Is there an easy way to modify the database and provide my modified version? I need to add a column to a couple of the tables to serve as foreign keys so I can have the parent-child-grandchild hierarchy described in my original post. I will also have to update some of the records to fill in values for the keys I create. <br />
<br />
Thanks!<br />
<br />
Rob<br />
<br />
<br />
<blockquote class='ipsBlockquote' data-author="'kclark'" data-cid="116289" data-time="1366926187" data-date="25 April 2013 - 02:43 PM"><p>
Can you create this with the sample db and post it please?<br /></p></blockquote>
Hans_vd
Maybe you can add a second table at the same level as the Child table that will fetch the Grand Child records that have a relationship directly to the Parent table. Because if the Grand Child has a direct relationship to the Parent, it is a Child, not a Grand Child, isn't it?
So you will have 4 tables:
- Parent
- Child
- Grand Child that has a relationship to the Child
- Grand Child that has a relationship to the Parent
Hope it helps
Hans