<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Many-to-many mapping problem in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Many-to-many-mapping-problem/m-p/670118#M676253</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Alex,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As per knowledge in qlikview, we need to follow &lt;STRONG&gt;one to one&lt;/STRONG&gt; relationship between the table which is the best practice we follow in most of the projects. In your case the tables are&amp;nbsp; connected using two key that's why its forming&amp;nbsp; the circular loop.In your case connect the&amp;nbsp; Contact and Activities table directly using one key without the use of mapping table(in this case not needed) if u want to connect the other key as well use a linking table.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 14 Jul 2014 10:45:32 GMT</pubDate>
    <dc:creator>avinashelite</dc:creator>
    <dc:date>2014-07-14T10:45:32Z</dc:date>
    <item>
      <title>Many-to-many mapping problem</title>
      <link>https://community.qlik.com/t5/QlikView/Many-to-many-mapping-problem/m-p/670117#M676252</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have two tables; Contacts and Activities which have a many-to-many relationship. The many-to-many relationship is defined by the ActivityContactMapping table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However the results I am getting are only showing one activity per contact.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As you can see below there is a loop created due to the Activity.ContactId field being present in other tables as well, which i &lt;EM&gt;think&lt;/EM&gt; may be causing the issue. What am I doing wrong?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My script is below&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="mapping issue.png" class="jive-image" src="/legacyfs/online/62363_mapping issue.png" style="width: 620px; height: 230px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;QUALIFY *;&lt;/P&gt;&lt;P&gt;UNQUALIFY OwnerId;&lt;/P&gt;&lt;P&gt;UNQUALIFY Activity.ContactId;&lt;/P&gt;&lt;P&gt;UNQUALIFY ActivityId;&lt;/P&gt;&lt;P&gt;UNQUALIFY Activity.CalendarDate;&lt;/P&gt;&lt;P&gt;Activities:&lt;/P&gt;&lt;P&gt;LOAD Id AS ActivityId,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; WhoId AS Activity.ContactId,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Subject,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ActivityDate AS Activity.CalendarDate,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; OwnerId,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; AccountId,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; number_of_individual_activities__c,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Activity_type__c;&lt;/P&gt;&lt;P&gt;SQL SELECT *&lt;/P&gt;&lt;P&gt;FROM Task&lt;/P&gt;&lt;P&gt;WHERE Type NOT IN ('Email','Call','RM/ Bloomberg Chat','Minor communication') AND Status = 'Completed';&lt;/P&gt;&lt;P&gt;UNQUALIFY *;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;QUALIFY *;&lt;/P&gt;&lt;P&gt;UNQUALIFY ActivityId;&lt;/P&gt;&lt;P&gt;UNQUALIFY Activity.ContactId;&lt;/P&gt;&lt;P&gt;ActivityContactMapping:&lt;/P&gt;&lt;P&gt;LOAD Id AS MappingId,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; RelationId AS Activity.ContactId,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; TaskId AS ActivityId;&lt;/P&gt;&lt;P&gt;SQL SELECT *&lt;/P&gt;&lt;P&gt;FROM TaskRelation;&lt;/P&gt;&lt;P&gt;UNQUALIFY *;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;QUALIFY *;&lt;/P&gt;&lt;P&gt;UNQUALIFY Activity.ContactRecordTypeId;&lt;/P&gt;&lt;P&gt;UNQUALIFY Activity.AccountId;&lt;/P&gt;&lt;P&gt;UNQUALIFY Activity.ContactId;&lt;/P&gt;&lt;P&gt;UNQUALIFY Activity.Department_Role__c;&lt;/P&gt;&lt;P&gt;UNQUALIFY Activity.Business__c;&lt;/P&gt;&lt;P&gt;Contacts:&lt;/P&gt;&lt;P&gt;LOAD Id as Activity.ContactId,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; AccountId AS Activity.AccountId,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Name,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; RecordTypeId AS Activity.ContactRecordTypeId,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CreatedDate,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Department_Role__c AS Activity.Department_Role__c,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Business__c AS Activity.Business__c,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Asset_Class__c,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Inactive_Contact__c,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Fusion_user__c,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Region__c;&lt;/P&gt;&lt;P&gt;SQL SELECT *&lt;/P&gt;&lt;P&gt;FROM Contact&lt;/P&gt;&lt;P&gt;WHERE RecordTypeId NOT IN ('012w000000063XQ','012w000000063qu');&lt;/P&gt;&lt;P&gt;UNQUALIFY *;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Jul 2014 10:36:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Many-to-many-mapping-problem/m-p/670117#M676252</guid>
      <dc:creator />
      <dc:date>2014-07-14T10:36:24Z</dc:date>
    </item>
    <item>
      <title>Re: Many-to-many mapping problem</title>
      <link>https://community.qlik.com/t5/QlikView/Many-to-many-mapping-problem/m-p/670118#M676253</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Alex,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As per knowledge in qlikview, we need to follow &lt;STRONG&gt;one to one&lt;/STRONG&gt; relationship between the table which is the best practice we follow in most of the projects. In your case the tables are&amp;nbsp; connected using two key that's why its forming&amp;nbsp; the circular loop.In your case connect the&amp;nbsp; Contact and Activities table directly using one key without the use of mapping table(in this case not needed) if u want to connect the other key as well use a linking table.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Jul 2014 10:45:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Many-to-many-mapping-problem/m-p/670118#M676253</guid>
      <dc:creator>avinashelite</dc:creator>
      <dc:date>2014-07-14T10:45:32Z</dc:date>
    </item>
    <item>
      <title>Re: Many-to-many mapping problem</title>
      <link>https://community.qlik.com/t5/QlikView/Many-to-many-mapping-problem/m-p/670119#M676254</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;this will create a circular reference in your schema, you need to create a link table, or create a complex key in the activities table which makes it one to one relationship.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Jul 2014 11:10:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Many-to-many-mapping-problem/m-p/670119#M676254</guid>
      <dc:creator>maleksafa</dc:creator>
      <dc:date>2014-07-14T11:10:51Z</dc:date>
    </item>
    <item>
      <title>Re: Many-to-many mapping problem</title>
      <link>https://community.qlik.com/t5/QlikView/Many-to-many-mapping-problem/m-p/670120#M676255</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You need to check for circular loops.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Jul 2014 11:14:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Many-to-many-mapping-problem/m-p/670120#M676255</guid>
      <dc:creator>sujeetsingh</dc:creator>
      <dc:date>2014-07-14T11:14:49Z</dc:date>
    </item>
  </channel>
</rss>

