<?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 the database for repeating headers in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Looping-through-the-database-for-repeating-headers/m-p/664435#M241970</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Really! Nobody has dealt with a similar problem before? Kindly&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt; help if anybody have dealt with something like this before.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;S&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 21 Oct 2014 13:15:46 GMT</pubDate>
    <dc:creator>sunny_talwar</dc:creator>
    <dc:date>2014-10-21T13:15:46Z</dc:date>
    <item>
      <title>Looping through the database for repeating headers</title>
      <link>https://community.qlik.com/t5/QlikView/Looping-through-the-database-for-repeating-headers/m-p/664431#M241966</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi there community experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to upload from a excel database which is not like the other database I have dealt with, so I need some expert advice. The database looks something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="69298" alt="DB.jpg" class="jive-image" src="https://community.qlik.com/legacyfs/online/69298_DB.jpg" style="width: 620px; height: 298px;" /&gt;&lt;/P&gt;&lt;P&gt;This is what I am trying to do:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="69323" alt="db1.jpg" class="jive-image" src="https://community.qlik.com/legacyfs/online/69323_db1.jpg" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is what I tried to do thus far with the scripting:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Agent:&lt;/P&gt;&lt;P&gt;LOAD * INLINE [&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Agent&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Agent1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Agent2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Agent3&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AgentCount:&lt;/P&gt;&lt;P&gt;LOAD Count(DISTINCT Agent) as AgentCount&lt;/P&gt;&lt;P&gt;Resident Agent;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LET vAgentCount = Peek('AgentCount', 0, 'AgentCount') - 1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AgentTable:&lt;/P&gt;&lt;P&gt;LOAD [Record No.],&lt;/P&gt;&lt;P&gt;&amp;nbsp; abc,&lt;/P&gt;&lt;P&gt;&amp;nbsp; def,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ghi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Peek('Agent', 0, 'Agent') as AgentName&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;&lt;C&gt;&lt;/C&gt;&lt;/P&gt;&lt;P&gt;(ooxml, embedded labels, header is 1 lines, table is Sheet1);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For i = 1 to vAgentCount&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Concatenate(AgentTable)&lt;/P&gt;&lt;P&gt;&amp;nbsp; LOAD [Record No.],&lt;/P&gt;&lt;P&gt;&amp;nbsp; abc,&lt;/P&gt;&lt;P&gt;&amp;nbsp; def,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ghi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Peek('Agent', $(i), 'Agent') as AgentName&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;&lt;C&gt;&lt;/C&gt;&lt;/P&gt;&lt;P&gt;(ooxml, embedded labels, header is 1 lines, table is Sheet1);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem is QV reads the repeating headers as following;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Agent 1 :abc, def, ghi&lt;/P&gt;&lt;P&gt;Agent 2: abc1, def1, ghi1&lt;/P&gt;&lt;P&gt;Agent 3: abc2, def2, ghi2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What would be a workaround or is there another (better) way to get this done?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note: Number of Agent's may increase and that is why I thought of using For loop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance for any help provided,&lt;/P&gt;&lt;P&gt;S&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Updating the output image because the one right now might be a little confusing as I still have Agent 1 at the top. The new output image file is attached below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="db1.jpg" class="jive-image" src="https://community.qlik.com/legacyfs/online/69324_db1.jpg" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Sunny T&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Oct 2014 17:20:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Looping-through-the-database-for-repeating-headers/m-p/664431#M241966</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2014-10-20T17:20:05Z</dc:date>
    </item>
    <item>
      <title>Re: Looping through the database for repeating headers</title>
      <link>https://community.qlik.com/t5/QlikView/Looping-through-the-database-for-repeating-headers/m-p/664432#M241967</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I suggest using a CROSSTABLE load instead of a standard load. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CROSSTABLE allows you to turn field headers into 1 field with different data values (like a pivot).&amp;nbsp; The oposite of a crosstable load is the generic load which turns unique values in one field into multiple fields. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Oct 2014 17:22:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Looping-through-the-database-for-repeating-headers/m-p/664432#M241967</guid>
      <dc:creator>JonnyPoole</dc:creator>
      <dc:date>2014-10-20T17:22:38Z</dc:date>
    </item>
    <item>
      <title>Re: Looping through the database for repeating headers</title>
      <link>https://community.qlik.com/t5/QlikView/Looping-through-the-database-for-repeating-headers/m-p/664433#M241968</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for a very quick response.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I attach my example in a qvw file, would u be able to show me how it would work?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;S&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Oct 2014 17:25:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Looping-through-the-database-for-repeating-headers/m-p/664433#M241968</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2014-10-20T17:25:52Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Looping through the database for repeating headers</title>
      <link>https://community.qlik.com/t5/QlikView/Looping-through-the-database-for-repeating-headers/m-p/664434#M241969</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;PFA the qwv and the accompanying Excel file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;S&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Oct 2014 17:32:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Looping-through-the-database-for-repeating-headers/m-p/664434#M241969</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2014-10-20T17:32:07Z</dc:date>
    </item>
    <item>
      <title>Re: Looping through the database for repeating headers</title>
      <link>https://community.qlik.com/t5/QlikView/Looping-through-the-database-for-repeating-headers/m-p/664435#M241970</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Really! Nobody has dealt with a similar problem before? Kindly&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt; help if anybody have dealt with something like this before.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;S&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Oct 2014 13:15:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Looping-through-the-database-for-repeating-headers/m-p/664435#M241970</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2014-10-21T13:15:46Z</dc:date>
    </item>
  </channel>
</rss>

