<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 14 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link=blue vlink=purple><div class=WordSection1><p class=MsoNormal>All:<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>I have a case where I want to show data in a one-to-many relationship, but the related data are more than one table “away”, or perhaps expressed as one-to-many-to-many.<o:p></o:p></p><p class=MsoNormal> <o:p></o:p></p><p class=MsoNormal>For example, I have three tables: [sampling_point], [samples], [analytical_results]. <o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>[samples] is linked to [sampling_point] and <o:p></o:p></p><p class=MsoNormal>[analytical_results] is linked to [samples].<o:p></o:p></p><p class=MsoNormal>[samples] contains sample id, sampling date, etc., and <o:p></o:p></p><p class=MsoNormal>[analytical_results] contains the analytical names and results for each sample.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>I want to map each sampling point once, then I want to display the related analytical data as a table so that the data are “grouped” first by sampling point, then by sample id + sampling date, approximately like so:<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>[sampling_point_id1]<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>    [samples_id1] + [samples_date1]<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>        [analyte_name1] + [analyte_result1]<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>        [analyte_name2] + [analyte_result2]<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>        [analyte_name3] + [analyte_result3]<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>    [samples_id2] + [samples_date2]<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>        [analyte_name1] + [analyte_result1]<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>        [analyte_name2] + [analyte_result2]<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>        [analyte_name3] + [analyte_result3]<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>[sampling_point_id2]<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>    [samples_id1] + [samples_date1]<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>        [analyte_name1] + [analyte_result1]<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'><o:p> </o:p></span></p><p class=MsoNormal>Etc.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>I can successfully display the data at one level “shallower” by using the LAYER + JOIN structure and the associated templates, however I have only been able to accomplish this between one layer and one table, thus either losing the grouping of unique sample_id and associated sample_date, or including those fields with the analytical results and creating long displays of repeated id and date values for each analytical result like so:<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>[sampling_point_id1]<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>    [samples_id1] + [samples_date1] + [analyte_name1] + [analyte_result1]<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>    [samples_id1] + [samples_date1] + [analyte_name2] + [analyte_result2]<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>    [samples_id1] + [samples_date1] + [analyte_name3] + [analyte_result3]<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>    [samples_id2] + [samples_date2] + [analyte_name1] + [analyte_result1]<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>    [samples_id2] + [samples_date2] + [analyte_name2] + [analyte_result2]<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>    [samples_id2] + [samples_date2] + [analyte_name3] + [analyte_result3]<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>[sampling_point_id2]<o:p></o:p></span></p><p class=MsoNormal>Etc.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Please advise how I may accomplish this or redirect my thinking, whichever is necessary.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Thank you,<o:p></o:p></p><p class=MsoNormal>Johan<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p></div></body></html>