<?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: Iterating through a hierarchy in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Populate-missing-data-by-Iterating-through-a-hierarchy/m-p/1185402#M383616</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;It is worth a browse of this document to see if anything useful pops out!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/docs/DOC-3786"&gt;Generating Missing Data In QlikView&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If not then as you say, this should be possible by some method&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Please remember to mark this as helpful or the correct answer if I have helped you or answered your question.&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 15 Sep 2016 09:19:52 GMT</pubDate>
    <dc:creator>adamdavi3s</dc:creator>
    <dc:date>2016-09-15T09:19:52Z</dc:date>
    <item>
      <title>Populate missing data by Iterating through a hierarchy</title>
      <link>https://community.qlik.com/t5/QlikView/Populate-missing-data-by-Iterating-through-a-hierarchy/m-p/1185401#M383615</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 have the following table below. The right-most columns is the required result. I have a sort of hierarchy, a child part that links to a parent part. I have Department (Dept) data for both child and parent. However a lot of this data is missing. In the expected result column I need to associate a Department with every Child Part.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are the three possible scenarios (refer to left-most column for scenario number):&lt;/P&gt;&lt;P&gt;1. if 'Child Dept' is available.. then return 'Child Dept'.&lt;/P&gt;&lt;P&gt;2. if 'Child Dept' is not available but parent department is available... then return parent department.&lt;/P&gt;&lt;P&gt;3. This is the challenge!! If both child and parent department are missing.... look for the Parent part in the Child Part column and keep iterating until a Parent Part with a Parent Dept is found. In this case Part A is related to E in the hierarchy, and E belongs to department 100. Thus I want A to be linked with department 100.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Part of he problem is that one child part can be related to multiple parents parts as in the case of part B.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="width: 451px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl64" height="17" width="95"&gt;Scenario&lt;/TD&gt;&lt;TD class="xl64" height="17" width="95"&gt;&lt;STRONG&gt;Child Part&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD class="xl64" width="93"&gt;&lt;STRONG&gt;Parent Part&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD class="xl64" width="77"&gt;&lt;STRONG&gt;Child Dept&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD class="xl64" width="78"&gt;&lt;STRONG&gt;Parent Dept&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD class="xl66" width="108"&gt;&lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt;Expected Result&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl67" height="17"&gt;1&lt;/TD&gt;&lt;TD class="xl67" height="17"&gt;F&lt;/TD&gt;&lt;TD&gt;G&lt;/TD&gt;&lt;TD class="xl63"&gt;066&lt;/TD&gt;&lt;TD class="xl63"&gt;110&lt;/TD&gt;&lt;TD class="xl65"&gt;066&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl67" height="17"&gt;2&lt;/TD&gt;&lt;TD class="xl67" height="17"&gt;H&lt;/TD&gt;&lt;TD&gt;I&lt;/TD&gt;&lt;TD class="xl63"&gt;-&lt;/TD&gt;&lt;TD class="xl63"&gt;077&lt;/TD&gt;&lt;TD class="xl65"&gt;077&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl67" height="17"&gt;&lt;SPAN style="color: #0000ff;"&gt;3&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl67" height="17"&gt;&lt;SPAN style="color: #0000ff;"&gt;A&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD&gt;&lt;SPAN style="color: #0000ff;"&gt;B&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl63"&gt;&lt;SPAN style="color: #0000ff;"&gt;-&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl63"&gt;&lt;SPAN style="color: #0000ff;"&gt;-&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl65"&gt;&lt;SPAN style="color: #0000ff;"&gt;100&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="17"&gt;&lt;SPAN style="color: #0000ff;"&gt;3&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD height="17"&gt;&lt;SPAN style="color: #0000ff;"&gt;B&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD&gt;&lt;SPAN style="color: #0000ff;"&gt;C&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl63"&gt;&lt;SPAN style="color: #0000ff;"&gt;-&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl63"&gt;&lt;SPAN style="color: #0000ff;"&gt;-&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl65"&gt;&lt;SPAN style="color: #0000ff;"&gt;100&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="17"&gt;&lt;SPAN style="color: #0000ff;"&gt;3&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD height="17"&gt;&lt;SPAN style="color: #0000ff;"&gt;B&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD&gt;&lt;SPAN style="color: #0000ff;"&gt;D&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl63"&gt;&lt;SPAN style="color: #0000ff;"&gt;-&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl63"&gt;&lt;SPAN style="color: #0000ff;"&gt;-&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl65"&gt;&lt;SPAN style="color: #0000ff;"&gt;100&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="17"&gt;&lt;SPAN style="color: #0000ff;"&gt;3&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD height="17"&gt;&lt;SPAN style="color: #0000ff;"&gt;D&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD&gt;&lt;SPAN style="color: #0000ff;"&gt;E&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl63"&gt;&lt;SPAN style="color: #0000ff;"&gt;-&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl63"&gt;&lt;SPAN style="color: #0000ff;"&gt;100&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl65"&gt;&lt;SPAN style="color: #0000ff;"&gt;100&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is this achievable within the script? I think it should involve some iterations/looping.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help is appreciated. Thanks &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Sep 2016 08:25:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Populate-missing-data-by-Iterating-through-a-hierarchy/m-p/1185401#M383615</guid>
      <dc:creator />
      <dc:date>2016-09-15T08:25:01Z</dc:date>
    </item>
    <item>
      <title>Re: Iterating through a hierarchy</title>
      <link>https://community.qlik.com/t5/QlikView/Populate-missing-data-by-Iterating-through-a-hierarchy/m-p/1185402#M383616</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;It is worth a browse of this document to see if anything useful pops out!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/docs/DOC-3786"&gt;Generating Missing Data In QlikView&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If not then as you say, this should be possible by some method&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Please remember to mark this as helpful or the correct answer if I have helped you or answered your question.&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Sep 2016 09:19:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Populate-missing-data-by-Iterating-through-a-hierarchy/m-p/1185402#M383616</guid>
      <dc:creator>adamdavi3s</dc:creator>
      <dc:date>2016-09-15T09:19:52Z</dc:date>
    </item>
  </channel>
</rss>

