<?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 Problem with self-referencing table in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Problem-with-self-referencing-table/m-p/1774200#M454771</link>
    <description>&lt;P&gt;I have a problem with a self-referencing table. This is my first time working with it. I have included an example below and attached a file. I am really struggling with this.&lt;/P&gt;&lt;P&gt;The lower table is self-referencing&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="qw_johan_0-1610572627148.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/46946i314029A61D2BA410/image-size/medium?v=v2&amp;amp;px=400" role="button" title="qw_johan_0-1610572627148.png" alt="qw_johan_0-1610572627148.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Some contract numbers have a reference to a parent contract (reference no). And a few of those contract numbers has a second parent contract (reference no). It is like a hierarchy of contracts you could say. Unfortunately, the parent contract doesn’t have a direct connection to a customer, only through a reference no.&lt;/P&gt;&lt;P&gt;For example customer no 22 has contract no 21. No problem this far.&lt;BR /&gt;Contract no 21 have a reference to another contract, number 588.&lt;BR /&gt;Contract no 588 references contract number 527.&lt;BR /&gt;Contract 527 is a multi-level SLA with no parent.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I in my example create a key between customer 22 and contract numbers 588 and 527 ?&lt;/P&gt;&lt;P&gt;What I would like to achieve is either a table with one row per customer or a table that shows customer and all contract numbers linked to that customer. &amp;nbsp;&lt;/P&gt;&lt;P&gt;Like I said, I am really struggling with this. So, any help is appreciated. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
    <pubDate>Sat, 16 Nov 2024 17:36:57 GMT</pubDate>
    <dc:creator>qw_johan</dc:creator>
    <dc:date>2024-11-16T17:36:57Z</dc:date>
    <item>
      <title>Problem with self-referencing table</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-self-referencing-table/m-p/1774200#M454771</link>
      <description>&lt;P&gt;I have a problem with a self-referencing table. This is my first time working with it. I have included an example below and attached a file. I am really struggling with this.&lt;/P&gt;&lt;P&gt;The lower table is self-referencing&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="qw_johan_0-1610572627148.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/46946i314029A61D2BA410/image-size/medium?v=v2&amp;amp;px=400" role="button" title="qw_johan_0-1610572627148.png" alt="qw_johan_0-1610572627148.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Some contract numbers have a reference to a parent contract (reference no). And a few of those contract numbers has a second parent contract (reference no). It is like a hierarchy of contracts you could say. Unfortunately, the parent contract doesn’t have a direct connection to a customer, only through a reference no.&lt;/P&gt;&lt;P&gt;For example customer no 22 has contract no 21. No problem this far.&lt;BR /&gt;Contract no 21 have a reference to another contract, number 588.&lt;BR /&gt;Contract no 588 references contract number 527.&lt;BR /&gt;Contract 527 is a multi-level SLA with no parent.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I in my example create a key between customer 22 and contract numbers 588 and 527 ?&lt;/P&gt;&lt;P&gt;What I would like to achieve is either a table with one row per customer or a table that shows customer and all contract numbers linked to that customer. &amp;nbsp;&lt;/P&gt;&lt;P&gt;Like I said, I am really struggling with this. So, any help is appreciated. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 17:36:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-self-referencing-table/m-p/1774200#M454771</guid>
      <dc:creator>qw_johan</dc:creator>
      <dc:date>2024-11-16T17:36:57Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with self-referencing table</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-self-referencing-table/m-p/1774765#M454793</link>
      <description>&lt;P&gt;Hi Qw_johan,&lt;/P&gt;&lt;P&gt;Have you solved this question by yourself ?&lt;/P&gt;&lt;P&gt;If you don't, I may give a suggestion: create a improved temporary table for your .QVW and fill it in script time:&lt;/P&gt;&lt;P&gt;Customer;Contract;Level&lt;/P&gt;&lt;P&gt;22;21;1&lt;/P&gt;&lt;P&gt;22;588;2&lt;/P&gt;&lt;P&gt;22;527;3&lt;/P&gt;&lt;P&gt;With that you will easily achieve what you need, won't you ?&lt;/P&gt;&lt;P&gt;Good luck!&lt;/P&gt;</description>
      <pubDate>Fri, 15 Jan 2021 12:04:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-self-referencing-table/m-p/1774765#M454793</guid>
      <dc:creator>Marcos_Ferreira_dos_Santos</dc:creator>
      <dc:date>2021-01-15T12:04:13Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with self-referencing table</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-self-referencing-table/m-p/1774780#M454794</link>
      <description>&lt;P&gt;Hi Marcos&lt;/P&gt;&lt;P&gt;No I have not yet solved it. So any help is still very much appreciated.&lt;/P&gt;&lt;P&gt;How would I create this improved temp table from the two existing tables in script?&lt;BR /&gt;I can't seem to figure out how to script a relation between 22-&amp;gt;588 and 22-&amp;gt;527.&lt;span class="lia-unicode-emoji" title=":thinking_face:"&gt;🤔&lt;/span&gt;&lt;BR /&gt;I know there is a relationship between 21-&amp;gt;588 in the second table (and also 588-&amp;gt;527), I should be able to use that connection somehow.&lt;BR /&gt;But so far I haven't been able to create this in script.&amp;nbsp;&lt;/P&gt;&lt;P&gt;//Johan&lt;/P&gt;</description>
      <pubDate>Fri, 15 Jan 2021 13:18:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-self-referencing-table/m-p/1774780#M454794</guid>
      <dc:creator>qw_johan</dc:creator>
      <dc:date>2021-01-15T13:18:09Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with self-referencing table</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-self-referencing-table/m-p/1775081#M454800</link>
      <description>&lt;P&gt;I think I figured it out. Here is my solution.&lt;/P&gt;&lt;P&gt;t1:&lt;BR /&gt;NoConcatenate LOAD Customer, [Contract No] Resident CUSTOMERS;&lt;BR /&gt;LEFT JOIN (t1) LOAD [Contract No], [Contract No] as [Contract No 1], [Reference No] as [Reference No 1] Resident CONTRACTS;&lt;/P&gt;&lt;P&gt;t2:&lt;BR /&gt;NoConcatenate LOAD Customer, [Reference No 1] as [Contract No], [Contract No 1], [Reference No 1] Resident t1;&lt;BR /&gt;LEFT JOIN (t2) LOAD [Contract No], [Reference No] as [Reference No 2] Resident CONTRACTS;&lt;/P&gt;&lt;P&gt;t3:&lt;BR /&gt;NoConcatenate&lt;BR /&gt;LOAD Customer, if(not IsNull([Reference No 2]), [Contract No 1]&amp;amp;'_'&amp;amp;[Reference No 1]&amp;amp;'_'&amp;amp;[Reference No 2],&lt;BR /&gt;if(not IsNull([Reference No 1]), [Contract No 1]&amp;amp;'_'&amp;amp;[Reference No 1],&lt;BR /&gt;If(not IsNull([Contract No 1]),[Contract No 1]))) as [Contract No]&lt;BR /&gt;Resident t2&lt;BR /&gt;;&lt;/P&gt;&lt;P&gt;drop tables CUSTOMERS, CONTRACTS, t1, t2;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This will end up with the following table.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="qw_johan_0-1610914576620.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/47208i6A5A77235F87C96B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="qw_johan_0-1610914576620.png" alt="qw_johan_0-1610914576620.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 17 Jan 2021 20:17:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-self-referencing-table/m-p/1775081#M454800</guid>
      <dc:creator>qw_johan</dc:creator>
      <dc:date>2021-01-17T20:17:04Z</dc:date>
    </item>
  </channel>
</rss>

