Or... is there a restriction on having 2 dimensions on the same fact table with same primary key/foreign key?<br><br>specifically we have:<br><br>&lt;Dimension name=&quot;Period2&quot; foreignKey=&quot;pillangoperiodid&quot;&gt;
<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;Hierarchy hasAll=&quot;true&quot; allMemberName=&quot;All Periods&quot; primaryKey=&quot;id&quot;&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;Table name=&quot;plan_periodgroups_olap_view&quot;/&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;Level name=&quot;Plan Period Group&quot; column=&quot;itemgroupid&quot; nameColumn=&quot;itemgroupname&quot; uniqueMembers=&quot;true&quot;/&gt;
<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;Level name=&quot;Period&quot; column=&quot;periodname&quot; ordinalColumn=&quot;startdate&quot; uniqueMembers=&quot;false&quot;/&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/Hierarchy&gt;<br>&nbsp;&nbsp;&nbsp; &lt;/Dimension&gt;<br><br>&nbsp;&nbsp;&nbsp; &lt;Dimension name=&quot;Period&quot; foreignKey=&quot;pillangoperiodid&quot;&gt;
<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;Hierarchy hasAll=&quot;true&quot; allMemberName=&quot;All Periods&quot; primaryKey=&quot;id&quot;&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;Table name=&quot;period&quot;/&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;Level name=&quot;Year&quot; column=&quot;yearname&quot; uniqueMembers=&quot;true&quot;/&gt;
<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;Level name=&quot;Period&quot; column=&quot;name&quot; ordinalColumn=&quot;startdate&quot; uniqueMembers=&quot;true&quot;/&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/Hierarchy&gt;<br>&nbsp;&nbsp;&nbsp; &lt;/Dimension&gt;<br><br>where the &quot;plan_periodgroups_olap_view&quot; table is a view on the &quot;period&quot; table (and a grouping table) that allows us to create whatever selections of periods are desired (in a &#39;group&#39;)..&nbsp;&nbsp; the PK id in both case is the same id from the &quot;period&quot; table and the FK is the same column in the fact table.
<br><br>in each case, the AggGen outputs this as one of the aggregate tables:<br><br>CREATE TABLE agg_l_XXX_invoice_and_item (<br>&nbsp;&nbsp;&nbsp; ledgerid INT8,<br>&nbsp;&nbsp;&nbsp; pillangoperiodid INT8,<br>&nbsp;&nbsp;&nbsp; amount FLOAT8,<br>&nbsp;&nbsp;&nbsp; fact_count INTEGER NOT NULL
<br>);<br><br>20:40:50,930 INFO&nbsp; [STDOUT] insertIntoLost:<br>INSERT INTO agg_l_XXX_invoice_and_item (<br>&nbsp;&nbsp;&nbsp; ledgerid,<br>&nbsp;&nbsp;&nbsp; pillangoperiodid,<br>&nbsp;&nbsp;&nbsp; amount,<br>&nbsp;&nbsp;&nbsp; fact_count)<br>SELECT<br>&nbsp;&nbsp;&nbsp; &quot;invoice_and_item&quot;.&quot;ledgerid&quot; AS &quot;ledgerid&quot;,
<br>&nbsp;&nbsp;&nbsp; &quot;invoice_and_item&quot;.&quot;pillangoperiodid&quot; AS &quot;pillangoperiodid&quot;,<br>&nbsp;&nbsp;&nbsp; SUM(&quot;INVOICE_AND_ITEM&quot;.&quot;AMOUNT&quot;) AS &quot;amount&quot;,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;--- this caps seems to be a bug for any case sensitive rdbms.. btw :)
<br>&nbsp;&nbsp;&nbsp; COUNT(*) AS &quot;fact_count&quot;<br>FROM<br>&nbsp;&nbsp;&nbsp; &quot;invoice_and_item&quot; &quot;invoice_and_item&quot;<br>GROUP BY<br>&nbsp;&nbsp;&nbsp; &quot;invoice_and_item&quot;.&quot;ledgerid&quot;,<br>&nbsp;&nbsp;&nbsp; &quot;invoice_and_item&quot;.&quot;pillangoperiodid&quot;;
<br><br><br>I&#39;ll try to do something similar with Foodmart... as long as you can confirm that we&#39;re not doing something that should not be allowed (the MDX runs fine, data ouput is correct etc.. just the agg tables don&#39;t work..)
<br><br>Cheers<br>Ati<br><br><br><div><span class="gmail_quote">On 10/18/07, <b class="gmail_sendername">Julian Hyde</b> &lt;<a href="mailto:julianhyde@speakeasy.net">julianhyde@speakeasy.net</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">




<div>
<div dir="ltr" align="left"><span><font color="#000080" face="Verdana" size="2">Can you clarify? Period and Period2 are based on the same 
dimension table, with the same primary key, and the same foreign key from the 
fact table? </font></span></div>
<div dir="ltr" align="left"><span><font color="#000080" face="Verdana" size="2"></font></span>&nbsp;</div>
<div dir="ltr" align="left"><span><font color="#000080" face="Verdana" size="2">At this point, it sounds like a bug in the aggregate table 
recognizer algorithm. There may be a bug logged already. If you can convert into 
a&nbsp;testcase on the foodmart schema that would help.</font></span></div>
<div dir="ltr" align="left"><span><font color="#000080" face="Verdana" size="2"></font></span>&nbsp;</div>
<div dir="ltr" align="left"><span><font color="#000080" face="Verdana" size="2">Julian</font></span></div><br>
<blockquote style="border-left: 2px solid rgb(0, 0, 128); padding-left: 5px; margin-left: 5px; margin-right: 0px;">
  <div dir="ltr" align="left" lang="en-us">
  <hr>
  <font face="Tahoma" size="2"><b>From:</b> <a href="mailto:mondrian-bounces@pentaho.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">mondrian-bounces@pentaho.org</a> 
  [mailto:<a href="mailto:mondrian-bounces@pentaho.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">mondrian-bounces@pentaho.org</a>] <b>On Behalf Of </b>Ati 
  Rosselet<br><b>Sent:</b> Thursday, October 18, 2007 2:58 AM<br><b>To:</b> 
  <a href="mailto:mondrian@pentaho.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">mondrian@pentaho.org</a><br><b>Subject:</b> [Mondrian] Problem with aggregate 
  tables..<br></font><br></div><div><span class="e" id="q_115b426283953e3c_1">
  <div></div>Hi, I&#39;ll try to be clear here.&nbsp; <br>We are running mondrian 
  2.4 with the Aggregate query generation turned on at the moment and we have 
  the following, odd situation:<br><br>We have 2 dimensions (Period and 
  Period2), both of which reference the same set of id&#39;s <br>We have also 
  created the appropriate aggregate table for a certain level, and all works 
  fine.. kind of.<br><br>The problem is that when the query using &quot;Period&quot; runs, 
  the aggregate table we created is shown on the console, and the database logs 
  show that it used, and consequently everything is FAST!!&nbsp; However, when 
  using the &quot;Period2&quot; dimension, although the EXACT SAME table is shown on the 
  console as a suggested aggregate table..&nbsp; it is never used. <br><br>I 
  could understand if it was finding a &#39;better&#39; table and using that instead, 
  but rather it is not using any aggregate table at all.&nbsp; 
  ??????<br><br>What situation could cause the processing of an MDX query to 
  list &quot;suggested&quot; tables, and then NOT use one of them if it exists? <br>We&#39;ve 
  been trying, tweaking etc.. and no change..&nbsp;&nbsp; at a complete loss 
  here... any ideas?<br><br>Cheers<br>Ati<br><br><br>(Julian... just found the 
  new mailing list&nbsp; - thnx... did you shut down the old spamful one?) 
<br></span></div></blockquote></div>
<br>_______________________________________________<br>Mondrian mailing list<br><a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:Mondrian@pentaho.org">Mondrian@pentaho.org</a><br><a onclick="return top.js.OpenExtLink(window,event,this)" href="http://lists.pentaho.org/mailman/listinfo/mondrian" target="_blank">
http://lists.pentaho.org/mailman/listinfo/mondrian</a><br><br></blockquote></div><br>