<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">You define the key once, at the table level. You define the foreign key in each link, i.e. each time the table is used as a dimension.&nbsp;<div class=""><br class=""></div><div class="">I can’t imagine how any less information would suffice, because each reference is probably from a different fact table, and therefore the foreign keys are different.</div><div class=""><br class=""></div><div class="">Julian</div><div class=""><br class=""><div class=""><div><blockquote type="cite" class=""><div class="">On May 25, 2016, at 6:46 AM, Isaias Sanchez &lt;<a href="mailto:isaias.sanchez.l@gmail.com" class="">isaias.sanchez.l@gmail.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class="">
  
    <meta content="text/html; charset=windows-1252" http-equiv="Content-Type" class="">
  
  <div bgcolor="#FFFFFF" text="#000000" class="">
    I think that's not possible by now.<br class="">
    <br class="">
    <div class="moz-cite-prefix">Jian Zhong wrote on 25/05/16 12:30:<br class="">
    </div>
    <blockquote cite="mid:CAPb8LCYmf1iOSmMFnuTCofVbLmcgSvko12V7f5Fp3g18QHqDSQ@mail.gmail.com" type="cite" class="">
      <div dir="ltr" class="">one more question,
        <div class=""><br class="">
        </div>
        <div class="">since the join relation is between tables.</div>
        <div class=""><br class="">
        </div>
        <div class="">in mondrian schema, i need to define composite keys in
          every dimension from the table.<br class="">
        </div>
        <div class=""><br class="">
        </div>
        <div class="">which cause many duplicate code.<br class="">
        </div>
        <div class=""><br class="">
        </div>
        <div class="">Can I define composite key at table level?</div>
        <div class=""><br class="">
        </div>
        <div class="">thanks!</div>
        <div class=""><br class="">
        </div>
        <div class=""><br class="">
        </div>
      </div>
      <div class="gmail_extra"><br class="">
        <div class="gmail_quote">On Wed, May 25, 2016 at 3:21 PM, Jian
          Zhong <span dir="ltr" class="">&lt;<a moz-do-not-send="true" href="mailto:hellowode110@gmail.com" target="_blank" class="">hellowode110@gmail.com</a>&gt;</span>
          wrote:<br class="">
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex">
            <div dir="ltr" class="">Thank you Isaias !
              <div class=""><br class="">
              </div>
              <div class="">you saved my day.</div>
            </div>
            <div class="HOEnZb">
              <div class="h5">
                <div class="gmail_extra"><br class="">
                  <div class="gmail_quote">On Tue, May 24, 2016 at 4:28
                    PM, Isaias Sanchez <span dir="ltr" class="">&lt;<a moz-do-not-send="true" href="mailto:isaias.sanchez.l@gmail.com" target="_blank" class=""></a><a class="moz-txt-link-abbreviated" href="mailto:isaias.sanchez.l@gmail.com">isaias.sanchez.l@gmail.com</a>&gt;</span>
                    wrote:<br class="">
                    <blockquote class="gmail_quote" style="margin:0 0 0
                      .8ex;border-left:1px #ccc solid;padding-left:1ex">
                      <div bgcolor="#FFFFFF" text="#000000" class=""> I guess:<br class="">
                        <br class="">
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;Table
                        name="KYLIN_CATEGORY_GROUPINGS"&gt;<br class="">
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;key&gt;<br class="">
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;column
                        name="LEAF_CATEG_ID"/&gt;<br class="">
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/key&gt;<br class="">
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/Table&gt;&nbsp; <br class="">
                        <br class="">
                        or <br class="">
                        <br class="">
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;Table
                        name="KYLIN_CATEGORY_GROUPINGS"&gt;<br class="">
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/Table&gt;&nbsp; <br class="">
                        <br class="">
                        Will do the job.<br class="">
                        <br class="">
                        The composite key leave it only in dimension
                        part.<br class="">
                        <br class="">
                        Cheers,<br class="">
                        <br class="">
                        Isaias S.<br class="">
                        <br class="">
                        <div class="">Jian Zhong wrote on 24/05/16 10:12:<br class="">
                        </div>
                        <div class="">
                          <div class="">
                            <blockquote type="cite" class="">
                              <div dir="ltr" class="">Julian,
                                <div class=""><br class="">
                                </div>
                                <div class="">Thank you!
                                  <div class=""><br class="">
                                  </div>
                                  <div class="">I'm using Mondrian 4.4, I follow
                                    the guide. and I get error log like</div>
                                  <div class=""><br class="">
                                  </div>
                                  <div class=""><p class=""><span class="">016-05-24 15:07:47,851
                                        ERROR
                                        [org.saiku.web.core.SecurityAwareConnectionManager]
                                        Error connecting:
                                        kylin_sales_cal_compos_test</span></p><p class=""><span class="">mondrian.rolap.RolapSchema$MondrianSchemaException:

                                        Key must have precisely one
                                        column; key
                                        [KYLIN_CATEGORY_GROUPINGS.LEAF_CATEG_ID,
                                        KYLIN_CATEGORY_GROUPINGS.SITE_ID]
                                        in table
                                        'KYLIN_CATEGORY_GROUPINGS'. (in
                                        Key) (at line 0, column 275)</span></p><p class=""><span class="">We have table KYLIN_SALES
                                        and KYLIN_CATEGORY_GROUPINGS.</span></p><p class="">the join relation like this.</p><div class=""><span class=""></span><br class="webkit-block-placeholder"></div>
                                    <ul class="">
                                      <li class=""><code class="">DEFAULT.KYLIN_SALES.LEAF_CATEG_ID

                                          =
                                          DEFAULT.KYLIN_CATEGORY_GROUPINGS.LEAF_CATEG_ID</code>&nbsp;</li>
                                      <li class=""><code class="">DEFAULT.KYLIN_SALES.LSTG_SITE_ID

                                          =
                                          DEFAULT.KYLIN_CATEGORY_GROUPINGS.SITE_ID</code></li>
                                    </ul><p class=""><span class="">Enclosure is the schema
                                        file.</span></p><p class="">Coulld you coorect me?</p><p class="">Thanks.</p>
                                  </div>
                                </div>
                              </div>
                              <div class="gmail_extra"><br class="">
                                <div class="gmail_quote">On Tue, May 24,
                                  2016 at 11:57 AM, Julian Hyde <span dir="ltr" class="">&lt;<a moz-do-not-send="true" href="mailto:julianhyde@gmail.com" target="_blank" class=""></a><a class="moz-txt-link-abbreviated" href="mailto:julianhyde@gmail.com">julianhyde@gmail.com</a>&gt;</span>
                                  wrote:<br class="">
                                  <blockquote class="gmail_quote" style="margin:0 0 0
                                    .8ex;border-left:1px #ccc
                                    solid;padding-left:1ex">
                                    <div style="word-wrap:break-word" class="">Are
                                      you using Mondrian version 3 or 4?
                                      Mondrian 4 supports composite
                                      keys. Define a composite primary
                                      key for the dimension table, and
                                      include multiple columns in the
                                      ForeignKeyLink.
                                      <div class=""><br class="">
                                      </div>
                                      <div class="">See&nbsp;<a moz-do-not-send="true" href="http://mondrian.pentaho.com/head/documentation/schema.php#Measures" target="_blank" class="">http://mondrian.pentaho.com/head/documentation/schema.php#Measures</a>,
                                        towards the end of the section.</div>
                                      <div class=""><br class="">
                                      </div>
                                      <div class="">Neither version of Mondrian
                                        supports left join. Can you
                                        describe what you hope would
                                        happen? If a record in the
                                        “sales" fact table has a
                                        “productId” value that doesn’t
                                        exist in the “product" table,
                                        would you expect that that fact
                                        to be counted against a “null”
                                        member of the [Product]
                                        hierarchy? Each hierarchy has a
                                        null member, but the system
                                        removes them from axes. So you’d
                                        need a user-defined “other”
                                        member.</div>
                                      <div class=""><br class="">
                                      </div>
                                      <div class="">Julian</div>
                                      <div class=""><br class="">
                                        <div class=""><br class="">
                                          <div class="">
                                            <blockquote type="cite" class="">
                                              <div class="">
                                                <div class="">
                                                  <div class="">On May 23, 2016,
                                                    at 7:21 PM, Jian
                                                    Zhong &lt;<a moz-do-not-send="true" href="mailto:zhongjian@apache.org" target="_blank" class=""></a><a class="moz-txt-link-abbreviated" href="mailto:zhongjian@apache.org">zhongjian@apache.org</a>&gt;

                                                    wrote:</div>
                                                  <br class="">
                                                </div>
                                              </div>
                                              <div class="">
                                                <div class="">
                                                  <div class="">
                                                    <div dir="ltr" class="">
                                                      <div style="font-size:12.8px" class="">Hi
                                                        all,</div>
                                                      <div style="font-size:12.8px" class=""><span style="font-size:12.8px" class=""><br class="">
                                                        </span></div>
                                                      <div style="font-size:12.8px" class=""><span style="font-size:12.8px" class="">I'm a developer of apache kylin.</span></div>
                                                      <div style="font-size:12.8px" class=""><span style="font-size:12.8px" class=""><br class="">
                                                        </span></div>
                                                      <div style="font-size:12.8px" class=""><span style="font-size:12.8px" class="">I'm trying to write a tool generate mondrian
                                                          schema for
                                                          Apache Kylin
                                                          cubes.</span><br class="">
                                                      </div>
                                                      <div style="font-size:12.8px" class=""><br class="">
                                                      </div>
                                                      <div style="font-size:12.8px" class="">As
                                                        I know, mondrian
                                                        does not support
                                                        left join, and
                                                        for composite
                                                        key.</div>
                                                      <div style="font-size:12.8px" class=""><br class="">
                                                      </div>
                                                      <div style="font-size:12.8px" class="">If
                                                        two tables join
                                                        with more than
                                                        one column,it
                                                        seems not well
                                                        supported.</div>
                                                      <div style="font-size:12.8px" class=""><br class="">
                                                      </div>
                                                      <div style="font-size:12.8px" class="">I'm
                                                        blocked on how
                                                        to define
                                                        multiple columns
                                                        join for tables.</div>
                                                      <div style="font-size:12.8px" class=""><br class="">
                                                      </div>
                                                      <div style="font-size:12.8px" class="">Could
                                                        anyone give me
                                                        some guide?<br class="">
                                                      </div>
                                                      <div style="font-size:12.8px" class=""><br class="">
                                                      </div>
                                                      <div style="font-size:12.8px" class="">Thanks</div>
                                                      <div style="font-size:12.8px" class=""><br class="">
                                                      </div>
                                                      <div style="font-size:12.8px" class="">Best

                                                        Regards!</div>
                                                    </div>
                                                  </div>
                                                </div>
_______________________________________________<br class="">
                                                Mondrian mailing list<br class="">
                                                <a moz-do-not-send="true" href="mailto:Mondrian@pentaho.org" target="_blank" class=""></a><a class="moz-txt-link-abbreviated" href="mailto:Mondrian@pentaho.org">Mondrian@pentaho.org</a><br class="">
                                                <a moz-do-not-send="true" href="http://lists.pentaho.org/mailman/listinfo/mondrian" target="_blank" class=""></a><a class="moz-txt-link-freetext" href="http://lists.pentaho.org/mailman/listinfo/mondrian">http://lists.pentaho.org/mailman/listinfo/mondrian</a><br class="">
                                              </div>
                                            </blockquote>
                                          </div>
                                          <br class="">
                                        </div>
                                      </div>
                                    </div>
                                    <br class="">
_______________________________________________<br class="">
                                    Mondrian mailing list<br class="">
                                    <a moz-do-not-send="true" href="mailto:Mondrian@pentaho.org" target="_blank" class="">Mondrian@pentaho.org</a><br class="">
                                    <a moz-do-not-send="true" href="http://lists.pentaho.org/mailman/listinfo/mondrian" rel="noreferrer" target="_blank" class="">http://lists.pentaho.org/mailman/listinfo/mondrian</a><br class="">
                                    <br class="">
                                  </blockquote>
                                </div>
                                <br class="">
                              </div>
                              <br class="">
                              <fieldset class=""></fieldset>
                              <br class="">
                              <pre class="">_______________________________________________
Mondrian mailing list
<a moz-do-not-send="true" href="mailto:Mondrian@pentaho.org" target="_blank" class="">Mondrian@pentaho.org</a>
<a moz-do-not-send="true" href="http://lists.pentaho.org/mailman/listinfo/mondrian" target="_blank" class="">http://lists.pentaho.org/mailman/listinfo/mondrian</a>
</pre>
                            </blockquote>
                            <br class="">
                          </div>
                        </div>
                      </div>
                      <br class="">
                      _______________________________________________<br class="">
                      Mondrian mailing list<br class="">
                      <a moz-do-not-send="true" href="mailto:Mondrian@pentaho.org" target="_blank" class="">Mondrian@pentaho.org</a><br class="">
                      <a moz-do-not-send="true" href="http://lists.pentaho.org/mailman/listinfo/mondrian" rel="noreferrer" target="_blank" class="">http://lists.pentaho.org/mailman/listinfo/mondrian</a><br class="">
                      <br class="">
                    </blockquote>
                  </div>
                  <br class="">
                </div>
              </div>
            </div>
          </blockquote>
        </div>
        <br class="">
      </div>
      <br class="">
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br class="">
      <pre wrap="" class="">_______________________________________________
Mondrian mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Mondrian@pentaho.org">Mondrian@pentaho.org</a>
<a class="moz-txt-link-freetext" href="http://lists.pentaho.org/mailman/listinfo/mondrian">http://lists.pentaho.org/mailman/listinfo/mondrian</a>
</pre>
    </blockquote>
    <br class="">
  </div>

_______________________________________________<br class="">Mondrian mailing list<br class=""><a href="mailto:Mondrian@pentaho.org" class="">Mondrian@pentaho.org</a><br class="">http://lists.pentaho.org/mailman/listinfo/mondrian<br class=""></div></blockquote></div><br class=""></div></div></body></html>