<?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: One to many relationship in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/One-to-many-relationship/m-p/1060433#M935382</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think you have to flag all the active contract by asset i f there is &amp;gt;= 1 active contract (by asset)&lt;/P&gt;&lt;P&gt;or, if you don't have active, the last past&lt;/P&gt;&lt;P&gt;If you post some data, someone can try in the script.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 01 Mar 2016 19:25:32 GMT</pubDate>
    <dc:creator>maxgro</dc:creator>
    <dc:date>2016-03-01T19:25:32Z</dc:date>
    <item>
      <title>One to many relationship</title>
      <link>https://community.qlik.com/t5/QlikView/One-to-many-relationship/m-p/1060430#M935379</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am currently stuck on a logic for which I need help from you guys.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have two tables and there is one to many relationship between them. Please see below the table structure.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="116461" alt="Capture.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/116461_Capture.PNG" style="height: auto; width: auto;" /&gt;&lt;/P&gt;&lt;P&gt;One asset can have multiple contract.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to show everything in a straight table. In straight table I want to see 1 record for each asset. Please see below for the logic I am trying to implement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;An asset could have many different type of contracts associated with it. Please see below for the different scenario.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;An asset can have only one 'Active' contract -&amp;gt; in that case I want to show it.&lt;/LI&gt;&lt;LI&gt;An asset can have one 'Active', one 'Past', one 'future' contract -&amp;gt; in that case I only want to show active.&lt;/LI&gt;&lt;LI&gt;An asset can have more than one 'Past' contract -&amp;gt; in that case I only want to show the latest past contract.&lt;/LI&gt;&lt;LI&gt;An asset can have 2 'Active' contracts, 2 'Past' contract and 2 'Future' contract associated with it. -&amp;gt; in that case I only want to show 2 'Active' contracts.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;In summary, if an asset has 'Active' contract I only want to see all Active contracts for that asset but if an asset has no 'Active' contract and more than one 'past' contract than I only want to see latest past contract.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please let me know how to achieve this. I greatly appreciate your help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please let me know if you need any more information.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;Parth&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Mar 2016 15:20:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/One-to-many-relationship/m-p/1060430#M935379</guid>
      <dc:creator />
      <dc:date>2016-03-01T15:20:46Z</dc:date>
    </item>
    <item>
      <title>Re: One to many relationship</title>
      <link>https://community.qlik.com/t5/QlikView/One-to-many-relationship/m-p/1060431#M935380</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In the load script for your &lt;EM&gt;Table2 - Contract&lt;/EM&gt; I would create a &lt;EM&gt;Contract Status&lt;/EM&gt; Dimension for each for row with possible values of :&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Active&lt;/LI&gt;&lt;LI&gt;Past&lt;/LI&gt;&lt;LI&gt;Future&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then you should be able to visualize as per your wonts with Set Analysis.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Better though would be in your load script to add a flag for &lt;EM&gt;Display Asset&lt;/EM&gt; using Group By and the Peek() function.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Mar 2016 18:39:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/One-to-many-relationship/m-p/1060431#M935380</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-03-01T18:39:13Z</dc:date>
    </item>
    <item>
      <title>Re: One to many relationship</title>
      <link>https://community.qlik.com/t5/QlikView/One-to-many-relationship/m-p/1060432#M935381</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Bill,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your reply. Sorry as I didnt make it clear, Type field in Table 2 - Contract has these values -&amp;gt; Active, Past, Future.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I already created a flag called numberOfContracts which is the count(distinct contract_id) group by asset_id and left join with the contract table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, my Contract table now has one more field called &lt;SPAN style="font-size: 13.3333px;"&gt;numberOfContracts.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What should I do next ? how do I implement such logic which answers all the possible scenario I described?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you once again,&lt;/P&gt;&lt;P&gt;Parth&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Mar 2016 18:47:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/One-to-many-relationship/m-p/1060432#M935381</guid>
      <dc:creator />
      <dc:date>2016-03-01T18:47:12Z</dc:date>
    </item>
    <item>
      <title>Re: One to many relationship</title>
      <link>https://community.qlik.com/t5/QlikView/One-to-many-relationship/m-p/1060433#M935382</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think you have to flag all the active contract by asset i f there is &amp;gt;= 1 active contract (by asset)&lt;/P&gt;&lt;P&gt;or, if you don't have active, the last past&lt;/P&gt;&lt;P&gt;If you post some data, someone can try in the script.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Mar 2016 19:25:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/One-to-many-relationship/m-p/1060433#M935382</guid>
      <dc:creator>maxgro</dc:creator>
      <dc:date>2016-03-01T19:25:32Z</dc:date>
    </item>
    <item>
      <title>Re: One to many relationship</title>
      <link>https://community.qlik.com/t5/QlikView/One-to-many-relationship/m-p/1060434#M935383</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Maxgro,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please find the attached spreadsheet containing dummy data and the expected result. Please let me know if you have any questions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you so much for your help,&lt;/P&gt;&lt;P&gt;Parth !&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Mar 2016 21:53:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/One-to-many-relationship/m-p/1060434#M935383</guid>
      <dc:creator />
      <dc:date>2016-03-01T21:53:06Z</dc:date>
    </item>
  </channel>
</rss>

