<tt><font size=2>Hi all,</font></tt>
<br><tt><font size=2>I promised I would write up something on the differences
between Hierarchical and Parallel linkage in Quiz (and QTP), so here we
go. (And for those of you who know all this already, please forgive my
trip down memory lane.)</font></tt>
<br>
<br><tt><font size=2>Oh, and I'm assuming no bugs in the product regarding
syntax. :-)</font></tt>
<br>
<br><tt><font size=2>Differences between Hierarchical and Parallel linkage
in Quiz (and QTP)</font></tt>
<br>
<br><tt><font size=2>In all examples below, we will use 3 files. Assume
all are indexed files, keyed on Emp_No</font></tt>
<br><tt><font size=2>File Employees: 5 records;</font></tt>
<br><tt><font size=2>Emp_No &nbsp;Emp_Name</font></tt>
<br><tt><font size=2>1 &nbsp; &nbsp; &nbsp; Bob</font></tt>
<br><tt><font size=2>2 &nbsp; &nbsp; &nbsp; Mary</font></tt>
<br><tt><font size=2>3 &nbsp; &nbsp; &nbsp; Pat</font></tt>
<br><tt><font size=2>4 &nbsp; &nbsp; &nbsp; Kim</font></tt>
<br><tt><font size=2>5 &nbsp; &nbsp; &nbsp; Sean</font></tt>
<br>
<br><tt><font size=2>File Paychecks: 5 records</font></tt>
<br><tt><font size=2>Emp_No &nbsp;Pay_Date &nbsp; &nbsp;Amt</font></tt>
<br><tt><font size=2>1 &nbsp; &nbsp; &nbsp; 2015-01-01 &nbsp;100 &nbsp;
&nbsp; (Bob)</font></tt>
<br><tt><font size=2>1 &nbsp; &nbsp; &nbsp; 2015-01-15 &nbsp;200 &nbsp;
&nbsp; (Bob)</font></tt>
<br><tt><font size=2>2 &nbsp; &nbsp; &nbsp; 2015-01-01 &nbsp;300 &nbsp;
&nbsp; (Mary)</font></tt>
<br><tt><font size=2>2 &nbsp; &nbsp; &nbsp; 2015-01-15 &nbsp;400 &nbsp;
&nbsp; (Mary)</font></tt>
<br><tt><font size=2>3 &nbsp; &nbsp; &nbsp; 2015-01-15 &nbsp;600 &nbsp;
&nbsp; (Pat)</font></tt>
<br><tt><font size=2>Note: 4 Kim and 5 Sean just started and have not been
paid yet)</font></tt>
<br>
<br><tt><font size=2>File Dependents: 4 records;</font></tt>
<br><tt><font size=2>Emp_No &nbsp;Dep_Name</font></tt>
<br><tt><font size=2>1 &nbsp; &nbsp; &nbsp; Bob Jr &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp;(Bob's 1st dependent)</font></tt>
<br><tt><font size=2>1 &nbsp; &nbsp; &nbsp; Bobbie &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp;(Bob's 2nd dependent)</font></tt>
<br><tt><font size=2>2 &nbsp; &nbsp; &nbsp; Marie &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; (Mary's dependent)</font></tt>
<br><tt><font size=2>5 &nbsp; &nbsp; &nbsp; Shawn &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; (Sean's dependent)</font></tt>
<br><tt><font size=2>Note: 3 Pat and 4 Kim do not have any dependents</font></tt>
<br>
<br><tt><font size=2>This will be my Report statement for ALL examples:</font></tt>
<br><tt><font size=2>Report &amp;</font></tt>
<br><tt><font size=2>&nbsp; &nbsp; Emp_No of Employees &amp;</font></tt>
<br><tt><font size=2>&nbsp; &nbsp; Emp_Name of Employees &amp;</font></tt>
<br><tt><font size=2>&nbsp; &nbsp; Pay_Date of Paychecks &amp;</font></tt>
<br><tt><font size=2>&nbsp; &nbsp; Amt of Paychecks &amp;</font></tt>
<br><tt><font size=2>&nbsp; &nbsp; Dep_Name of Dependents</font></tt>
<br><tt><font size=2>&nbsp; &nbsp; </font></tt>
<br><tt><font size=2>First Hierarchical linkage:</font></tt>
<br><tt><font size=2>Access Employees &amp;</font></tt>
<br><tt><font size=2>&nbsp; &nbsp; Link Emp_No of Employees to Emp_No of
Paychecks &amp;</font></tt>
<br><tt><font size=2>&nbsp; &nbsp; Link Emp_No of Employees to Emp_No of
Dependents</font></tt>
<br>
<br><tt><font size=2>Emp_No &nbsp;Emp_Name &nbsp; &nbsp;Pay_Date &nbsp;
&nbsp;Amt &nbsp; &nbsp; Dep_Name</font></tt>
<br><tt><font size=2>1 &nbsp; &nbsp; &nbsp; Bob &nbsp; &nbsp; &nbsp; &nbsp;
2015-01-01 &nbsp;100 &nbsp; &nbsp; Bob Jr</font></tt>
<br><tt><font size=2>1 &nbsp; &nbsp; &nbsp; Bob &nbsp; &nbsp; &nbsp; &nbsp;
2015-01-01 &nbsp;100 &nbsp; &nbsp; Bobbie</font></tt>
<br><tt><font size=2>1 &nbsp; &nbsp; &nbsp; Bob &nbsp; &nbsp; &nbsp; &nbsp;
2015-01-15 &nbsp;200 &nbsp; &nbsp; Bob Jr</font></tt>
<br><tt><font size=2>1 &nbsp; &nbsp; &nbsp; Bob &nbsp; &nbsp; &nbsp; &nbsp;
2015-01-15 &nbsp;200 &nbsp; &nbsp; Bobbie</font></tt>
<br><tt><font size=2>2 &nbsp; &nbsp; &nbsp; Mary &nbsp; &nbsp; &nbsp; &nbsp;2015-01-01
&nbsp;300 &nbsp; &nbsp; Marie</font></tt>
<br><tt><font size=2>2 &nbsp; &nbsp; &nbsp; Mary &nbsp; &nbsp; &nbsp; &nbsp;2015-01-15
&nbsp;400 &nbsp; &nbsp; Marie</font></tt>
<br>
<br><tt><font size=2>Obvious problems. Pat, Kim, and Sean are not showing
up at all because no files are optional. I'm assuming the use of Optional
in hierarchical linkage is well understood so I won't go into that discussion
here. This post is about parallel linkage. :-)</font></tt>
<br>
<br><tt><font size=2>A bigger problem with the report is that paycheck
and dependent records are being duplicated. Hierarchical linkage is simply
wrong for this data; the results make no sense. </font></tt>
<br><tt><font size=2>&nbsp;</font></tt>
<br><tt><font size=2>Using hierarchical linkage for this data is essentially
saying, for each paycheck an employee has received, read down the list
of all their dependents. That makes no sense. Just as it would make no
sense to say, for each dependent an employee has, show me every time they
have been paid. &nbsp;The number of paychecks I receive is based on how
long I have worked for my employeer, not how many dependents I have. &nbsp;Similarly,
the number of dependents I have is not based on how long I have worked
for my employer. &nbsp;</font></tt>
<br><tt><font size=2>&nbsp;</font></tt>
<br><tt><font size=2>Paychecks and Dependents are both, obviously related
to Employees, but they are NOT RELATED TO ONE ANOTHER. &nbsp;</font></tt>
<br>
<br><tt><font size=2>Instead of one of these files &quot;driving&quot;
the other, they should be read in parallel; i.e. at the same time. &nbsp;THIS
is why we have parallel linkage. &nbsp;Parallel linkage is saying, for
each employee, show me each of their paychecks AND each of their dependents.</font></tt>
<br>
<br><tt><font size=2>Let's try parallel linkage in the Access statement
and what that does to our report results.</font></tt>
<br>
<br><tt><font size=2>Access Employees &amp;</font></tt>
<br><tt><font size=2>&nbsp; &nbsp; Link Emp_No of Employees to Emp_No of
Paychecks &amp;</font></tt>
<br><tt><font size=2>&nbsp; &nbsp; AND Emp_No of Employees to Emp_No of
Dependents </font></tt>
<br><tt><font size=2>&nbsp; &nbsp; </font></tt>
<br><tt><font size=2>Emp_No &nbsp;Emp_Name &nbsp; &nbsp;Pay_Date &nbsp;
&nbsp;Amt &nbsp; &nbsp; Dep_Name</font></tt>
<br><tt><font size=2>1 &nbsp; &nbsp; &nbsp; Bob &nbsp; &nbsp; &nbsp; &nbsp;
2015-01-01 &nbsp;100 &nbsp; &nbsp; Bob Jr</font></tt>
<br><tt><font size=2>1 &nbsp; &nbsp; &nbsp; Bob &nbsp; &nbsp; &nbsp; &nbsp;
2015-01-15 &nbsp;200 &nbsp; &nbsp; Bobbie</font></tt>
<br><tt><font size=2>2 &nbsp; &nbsp; &nbsp; Mary &nbsp; &nbsp; &nbsp; &nbsp;2015-01-01
&nbsp;300 &nbsp; &nbsp; Marie</font></tt>
<br><tt><font size=2>2 &nbsp; &nbsp; &nbsp; Mary &nbsp; &nbsp; &nbsp; &nbsp;2015-01-15
&nbsp;400</font></tt>
<br><tt><font size=2>3 &nbsp; &nbsp; &nbsp; Pat &nbsp; &nbsp; &nbsp; &nbsp;
2015-01-15 &nbsp;600</font></tt>
<br><tt><font size=2>5 &nbsp; &nbsp; &nbsp; Sean &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Shawn</font></tt>
<br>
<br><tt><font size=2>This makes more sense for this data. &nbsp;Each paycheck
is reported once and each dependent is reported once. &nbsp;</font></tt>
<br><tt><font size=2>Notice, as long as there is at least one record FROM
ANY of the parallel files you get a record complex returned. Parallel files
are, more or less, &quot;semi-optional&quot;.</font></tt>
<br>
<br><tt><font size=2>However, also notice employee 4 Kim was not reported.
&nbsp;This was because Kim did not have any paychecks (yet) or dependents.
If you want to see Kim on the report as well, make ANY of the parallel
files optional; it doesn't make any difference which one because of the
&quot;semi-optional&quot; nature of parallel files.</font></tt>
<br>
<br><tt><font size=2>Access Employees &amp;</font></tt>
<br><tt><font size=2>&nbsp; &nbsp; Link Emp_No of Employees to Emp_No of
Paychecks &amp;</font></tt>
<br><tt><font size=2>&nbsp; &nbsp; AND Emp_No of Employees to Emp_No of
Dependents Optional</font></tt>
<br><tt><font size=2>&nbsp; &nbsp; </font></tt>
<br><tt><font size=2>Emp_No &nbsp;Emp_Name &nbsp; &nbsp;Pay_Date &nbsp;
&nbsp;Amt &nbsp; &nbsp; Dep_Name</font></tt>
<br><tt><font size=2>1 &nbsp; &nbsp; &nbsp; Bob &nbsp; &nbsp; &nbsp; &nbsp;
2015-01-01 &nbsp;100 &nbsp; &nbsp; Bob Jr</font></tt>
<br><tt><font size=2>1 &nbsp; &nbsp; &nbsp; Bob &nbsp; &nbsp; &nbsp; &nbsp;
2015-01-15 &nbsp;200 &nbsp; &nbsp; Bobbie</font></tt>
<br><tt><font size=2>2 &nbsp; &nbsp; &nbsp; Mary &nbsp; &nbsp; &nbsp; &nbsp;2015-01-01
&nbsp;300 &nbsp; &nbsp; Marie</font></tt>
<br><tt><font size=2>2 &nbsp; &nbsp; &nbsp; Mary &nbsp; &nbsp; &nbsp; &nbsp;2015-01-15
&nbsp;400</font></tt>
<br><tt><font size=2>3 &nbsp; &nbsp; &nbsp; Pat &nbsp; &nbsp; &nbsp; &nbsp;
2015-01-15 &nbsp;600</font></tt>
<br><tt><font size=2>4 &nbsp; &nbsp; &nbsp; Kim</font></tt>
<br><tt><font size=2>5 &nbsp; &nbsp; &nbsp; Sean &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Shawn</font></tt>
<br>
<br><tt><font size=2>To be honest, parallel linkage is not that common.
It is fair to ask, &quot;If two files aren't related to one another, why
are you writing a report with both of them on it?&quot; &nbsp;But it does
have its uses from time to time.</font></tt>
<br><tt><font size=2>&nbsp;</font></tt>
<br><tt><font size=2>I hope that explanation helps. (It was fun writing
about good old Quiz again after all these years.)</font></tt>
<br><tt><font size=2>Cheers,</font></tt>
<br><tt><font size=2>Matt</font></tt>