<?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: Looping through SQL data in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Looping-through-SQL-data/m-p/1602442#M596093</link>
    <description>&lt;P&gt;Have you used&amp;nbsp;HierarchyBelongsTo for all hierarhy in Qlik already?&lt;/P&gt;&lt;P&gt;1) temp1:&lt;/P&gt;&lt;P class="Code"&gt;HierarchyBelongsTo (NodeID, AncestorID, NodeName, AncestorID, AncestorName, DepthDiff)&lt;/P&gt;&lt;P class="Code"&gt;LOAD *&amp;nbsp;&lt;SPAN&gt;LoadIntoList&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="Code"&gt;&lt;SPAN&gt;2) Leave only ISNULL(AncestorName) = 1&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="Code"&gt;&lt;SPAN&gt;3) for each i in FieldValueList (NodeID)&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="Code"&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 15 Jul 2019 18:28:47 GMT</pubDate>
    <dc:creator>Nadi_Clarke</dc:creator>
    <dc:date>2019-07-15T18:28:47Z</dc:date>
    <item>
      <title>Looping through SQL data</title>
      <link>https://community.qlik.com/t5/QlikView/Looping-through-SQL-data/m-p/1601904#M596091</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;after some help here, as i'm not sure where to start - and i hope i explain it properly too &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I have a SQL data source, and it represents a tree style structure, something like:&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;ID&lt;/TD&gt;&lt;TD&gt;SerialNumber&lt;/TD&gt;&lt;TD&gt;ParentSerialNumber&lt;/TD&gt;&lt;TD&gt;Name&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;12345&lt;/TD&gt;&lt;TD&gt;4444&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Test 1&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;67892&lt;/TD&gt;&lt;TD&gt;3333&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Test 2&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;77645&lt;/TD&gt;&lt;TD&gt;4444&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Test 3&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;TD&gt;4444&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Parent 1&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;TD&gt;3333&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Parent 2&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, looking at the sample data above&amp;nbsp; there are two "parents" with 1 having 2 sub entries and the second only having 1.&lt;/P&gt;&lt;P&gt;Hopefully that is the structure explained OK.&lt;/P&gt;&lt;P&gt;I can import the data OK, however i am wanting to do other things with the data, So, my question is, what syntax do i need to loop through each record that has a "ParentSerialNumber" of 4444 for instance.&lt;/P&gt;&lt;P&gt;Thanks for any help&lt;/P&gt;&lt;P&gt;Jason&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 03:01:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Looping-through-SQL-data/m-p/1601904#M596091</guid>
      <dc:creator>jasonwills</dc:creator>
      <dc:date>2024-11-16T03:01:19Z</dc:date>
    </item>
    <item>
      <title>Re: Looping through SQL data</title>
      <link>https://community.qlik.com/t5/QlikView/Looping-through-SQL-data/m-p/1601963#M596092</link>
      <description>&lt;P&gt;Hi All, just wanting to expand a little to help explain.&lt;/P&gt;&lt;P&gt;i have a SQL table - i am importing it through the script as so:&lt;/P&gt;&lt;P&gt;LoadIntoList:&lt;/P&gt;&lt;P&gt;Sql SELECT&lt;BR /&gt;t.SerialNumber as SerialNumber&lt;BR /&gt;FROM&lt;BR /&gt;tableName as t&lt;BR /&gt;WHERE t.&lt;SPAN&gt;ParentSerialNumber&lt;/SPAN&gt;= '4444';&lt;/P&gt;&lt;P&gt;So this will give me a list of all records who have a ParentSerialNumber of 4444.&lt;/P&gt;&lt;P&gt;What i'd then like to do is to run another SQL statement to import other records from a different table, but looping through and using each 'SerialNumber' obtained from the previous statement as a variable.&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;Jason&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jul 2019 20:50:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Looping-through-SQL-data/m-p/1601963#M596092</guid>
      <dc:creator>jasonwills</dc:creator>
      <dc:date>2019-07-12T20:50:57Z</dc:date>
    </item>
    <item>
      <title>Re: Looping through SQL data</title>
      <link>https://community.qlik.com/t5/QlikView/Looping-through-SQL-data/m-p/1602442#M596093</link>
      <description>&lt;P&gt;Have you used&amp;nbsp;HierarchyBelongsTo for all hierarhy in Qlik already?&lt;/P&gt;&lt;P&gt;1) temp1:&lt;/P&gt;&lt;P class="Code"&gt;HierarchyBelongsTo (NodeID, AncestorID, NodeName, AncestorID, AncestorName, DepthDiff)&lt;/P&gt;&lt;P class="Code"&gt;LOAD *&amp;nbsp;&lt;SPAN&gt;LoadIntoList&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="Code"&gt;&lt;SPAN&gt;2) Leave only ISNULL(AncestorName) = 1&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="Code"&gt;&lt;SPAN&gt;3) for each i in FieldValueList (NodeID)&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="Code"&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Jul 2019 18:28:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Looping-through-SQL-data/m-p/1602442#M596093</guid>
      <dc:creator>Nadi_Clarke</dc:creator>
      <dc:date>2019-07-15T18:28:47Z</dc:date>
    </item>
    <item>
      <title>Re: Looping through SQL data</title>
      <link>https://community.qlik.com/t5/QlikView/Looping-through-SQL-data/m-p/1602572#M596094</link>
      <description>&lt;P&gt;hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/67973"&gt;@Nadi_Clarke&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;i wasn't even aware of this - thanks for the pointers, i will investigate and have a look.&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Jason&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jul 2019 07:55:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Looping-through-SQL-data/m-p/1602572#M596094</guid>
      <dc:creator>jasonwills</dc:creator>
      <dc:date>2019-07-16T07:55:20Z</dc:date>
    </item>
  </channel>
</rss>

