<?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 table and creating Dynamic columns in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Looping-through-table-and-creating-Dynamic-columns/m-p/590629#M682456</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Micheal,&lt;/P&gt;&lt;P&gt; I looked at QVW and bit confused , can we do the same by the following lines ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[ORD_SUM]:&lt;/P&gt;&lt;P&gt;NoConcatenate load CUST_ID ,ORD_YEAR as Year, SUM(Amount) as Amount Resident ORDER group by&amp;nbsp; CUST_ID ,ORD_YEAR;&lt;/P&gt;&lt;P&gt;drop table ORDER;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What i am trying to do is get 1 record by CUST_ID , then years as column&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Aji&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 18 Mar 2014 18:12:13 GMT</pubDate>
    <dc:creator />
    <dc:date>2014-03-18T18:12:13Z</dc:date>
    <item>
      <title>Looping through table and creating Dynamic columns</title>
      <link>https://community.qlik.com/t5/QlikView/Looping-through-table-and-creating-Dynamic-columns/m-p/590623#M682440</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have the following table ORDER&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="width: 190px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl65" height="18" width="60"&gt;CUST_ID&lt;/TD&gt;&lt;TD class="xl65" style="border-left: none;" width="78"&gt;ORD_YEAR&lt;/TD&gt;&lt;TD class="xl65" style="border-left: none;" width="52"&gt;Amount&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="18" style="border-top: none;"&gt;A&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;2008&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;10&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="18" style="border-top: none;"&gt;A&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;2008&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;15&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl67" height="18" style="border-top: none;"&gt;A&lt;/TD&gt;&lt;TD align="right" class="xl67" style="border-top: none; border-left: none;"&gt;2009&lt;/TD&gt;&lt;TD align="right" class="xl67" style="border-top: none; border-left: none;"&gt;15&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="18" style="border-top: none;"&gt;A&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;2010&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;20&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl67" height="18" style="border-top: none;"&gt;A&lt;/TD&gt;&lt;TD align="right" class="xl67" style="border-top: none; border-left: none;"&gt;2012&lt;/TD&gt;&lt;TD align="right" class="xl67" style="border-top: none; border-left: none;"&gt;5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="18" style="border-top: none;"&gt;A&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;2014&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;10&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="18" style="border-top: none;"&gt;A&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;2014&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;20&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl67" height="18" style="border-top: none;"&gt;B&lt;/TD&gt;&lt;TD align="right" class="xl67" style="border-top: none; border-left: none;"&gt;2008&lt;/TD&gt;&lt;TD align="right" class="xl67" style="border-top: none; border-left: none;"&gt;10&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl67" height="18" style="border-top: none;"&gt;B&lt;/TD&gt;&lt;TD align="right" class="xl67" style="border-top: none; border-left: none;"&gt;2008&lt;/TD&gt;&lt;TD align="right" class="xl67" style="border-top: none; border-left: none;"&gt;5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl67" height="18" style="border-top: none;"&gt;B&lt;/TD&gt;&lt;TD align="right" class="xl67" style="border-top: none; border-left: none;"&gt;2008&lt;/TD&gt;&lt;TD align="right" class="xl67" style="border-top: none; border-left: none;"&gt;25&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="18" style="border-top: none;"&gt;B&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;2009&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;30&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl67" height="18" style="border-top: none;"&gt;B&lt;/TD&gt;&lt;TD align="right" class="xl67" style="border-top: none; border-left: none;"&gt;2013&lt;/TD&gt;&lt;TD align="right" class="xl67" style="border-top: none; border-left: none;"&gt;5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl67" height="18" style="border-top: none;"&gt;B&lt;/TD&gt;&lt;TD align="right" class="xl67" style="border-top: none; border-left: none;"&gt;2013&lt;/TD&gt;&lt;TD align="right" class="xl67" style="border-top: none; border-left: none;"&gt;10&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="18" style="border-top: none;"&gt;B&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;2014&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;5&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Would like to create a summary table as shown below ORD_SUMM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" width="358"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl65" height="17" width="60"&gt;CUST_ID&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-left: none;" width="78"&gt;2008&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-left: none;" width="52"&gt;2009&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-left: none;" width="35"&gt;2010&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-left: none;" width="42"&gt;2012&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-left: none;" width="42"&gt;2013&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-left: none;" width="49"&gt;2014&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="17" style="border-top: none;"&gt;A&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;25&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;15&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;20&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;5&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt; &lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;30&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="17" style="border-top: none;"&gt;B&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;40&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;30&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt; &lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt; &lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;15&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;5&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tried the for loop but its throwing error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;Let&lt;/SPAN&gt; vYRVal = &lt;SPAN style="color: #0000ff;"&gt;min&lt;/SPAN&gt;(ORD_YEAR);&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;for&lt;/SPAN&gt; i=&lt;SPAN style="color: #0000ff;"&gt;min&lt;/SPAN&gt;(ORD_YEAR) &lt;SPAN style="color: #0000ff;"&gt;to year&lt;/SPAN&gt;(Today(0))&lt;/P&gt;&lt;P&gt;ORD_SUMM:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;load &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CUST_ID, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SUM(Amount) as $(vYRVal)&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;Resident &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ORDER &lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;where &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ORD_YEAR = $(vYRVal)&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;group by &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CUST_ID;&lt;/P&gt;&lt;P&gt; vYRVal = $(vYRVal)+1;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;next&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;drop table&lt;/SPAN&gt; ORDER;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any Idea on how to do this?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Mar 2014 16:35:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Looping-through-table-and-creating-Dynamic-columns/m-p/590623#M682440</guid>
      <dc:creator />
      <dc:date>2014-03-18T16:35:37Z</dc:date>
    </item>
    <item>
      <title>Re: Looping through table and creating Dynamic columns</title>
      <link>https://community.qlik.com/t5/QlikView/Looping-through-table-and-creating-Dynamic-columns/m-p/590624#M682441</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Do you have to do it in the script?&amp;nbsp; If not, see attached.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Mar 2014 16:48:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Looping-through-table-and-creating-Dynamic-columns/m-p/590624#M682441</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-03-18T16:48:41Z</dc:date>
    </item>
    <item>
      <title>Re: Looping through table and creating Dynamic columns</title>
      <link>https://community.qlik.com/t5/QlikView/Looping-through-table-and-creating-Dynamic-columns/m-p/590625#M682442</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;And if you need a script based solution you can use a generic load. Optionally joining the resulting tables into one table. This can cause performance problems on large datasets. See attached qvw.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Mar 2014 16:57:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Looping-through-table-and-creating-Dynamic-columns/m-p/590625#M682442</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2014-03-18T16:57:29Z</dc:date>
    </item>
    <item>
      <title>Re: Looping through table and creating Dynamic columns</title>
      <link>https://community.qlik.com/t5/QlikView/Looping-through-table-and-creating-Dynamic-columns/m-p/590626#M682445</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks , But I need a resident table. I need to do some analysis on accounts and I am creating a summary table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;At the end I need to do an export of 300-400K records to CSV with 10-15 dimension and few facts. I am getting a out of memory error&amp;nbsp; if I do a pivot table . So I thought I will create a straight table with pre-calculated facts.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Mar 2014 16:58:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Looping-through-table-and-creating-Dynamic-columns/m-p/590626#M682445</guid>
      <dc:creator />
      <dc:date>2014-03-18T16:58:50Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Looping through table and creating Dynamic columns</title>
      <link>https://community.qlik.com/t5/QlikView/Looping-through-table-and-creating-Dynamic-columns/m-p/590627#M682451</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;One more version...&amp;nbsp; But I added multiple conditional expressions.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Mar 2014 17:31:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Looping-through-table-and-creating-Dynamic-columns/m-p/590627#M682451</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-03-18T17:31:50Z</dc:date>
    </item>
    <item>
      <title>Re: Looping through table and creating Dynamic columns</title>
      <link>https://community.qlik.com/t5/QlikView/Looping-through-table-and-creating-Dynamic-columns/m-p/590628#M682454</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Gysbert! The only thing is I need only 1 record per CUST_ID&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Mar 2014 18:06:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Looping-through-table-and-creating-Dynamic-columns/m-p/590628#M682454</guid>
      <dc:creator />
      <dc:date>2014-03-18T18:06:02Z</dc:date>
    </item>
    <item>
      <title>Re: Looping through table and creating Dynamic columns</title>
      <link>https://community.qlik.com/t5/QlikView/Looping-through-table-and-creating-Dynamic-columns/m-p/590629#M682456</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Micheal,&lt;/P&gt;&lt;P&gt; I looked at QVW and bit confused , can we do the same by the following lines ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[ORD_SUM]:&lt;/P&gt;&lt;P&gt;NoConcatenate load CUST_ID ,ORD_YEAR as Year, SUM(Amount) as Amount Resident ORDER group by&amp;nbsp; CUST_ID ,ORD_YEAR;&lt;/P&gt;&lt;P&gt;drop table ORDER;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What i am trying to do is get 1 record by CUST_ID , then years as column&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Aji&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Mar 2014 18:12:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Looping-through-table-and-creating-Dynamic-columns/m-p/590629#M682456</guid>
      <dc:creator />
      <dc:date>2014-03-18T18:12:13Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Looping through table and creating Dynamic columns</title>
      <link>https://community.qlik.com/t5/QlikView/Looping-through-table-and-creating-Dynamic-columns/m-p/590630#M682458</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ah, I missed that you had unaggregated detail records. Just sum those up first:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Temp:&lt;/P&gt;&lt;P&gt;Generic&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LOAD CUST_ID, ORD_YEAR, sum(Amount)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Group by CUST_ID, ORD_YEAR;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Load ...etc&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See attached qvw.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Mar 2014 18:19:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Looping-through-table-and-creating-Dynamic-columns/m-p/590630#M682458</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2014-03-18T18:19:59Z</dc:date>
    </item>
    <item>
      <title>Re: Looping through table and creating Dynamic columns</title>
      <link>https://community.qlik.com/t5/QlikView/Looping-through-table-and-creating-Dynamic-columns/m-p/590631#M682461</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, it is the same thing.&lt;/P&gt;&lt;P&gt;(I tried to "fix" your original script and got a more complex than it needs to be &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/grin.png" /&gt;)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I assume you want the complete table image in the data model.&amp;nbsp; That means it will be a table box on the front end, not a straight table.&amp;nbsp; Correct?&lt;/P&gt;&lt;P&gt;Still the question remains how dynamically add the columns, even in the table box.&amp;nbsp; So, I think the straight table with conditional expression is a working solution.&lt;/P&gt;&lt;P&gt;Let's see what Gysbert has...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Mar 2014 18:23:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Looping-through-table-and-creating-Dynamic-columns/m-p/590631#M682461</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-03-18T18:23:47Z</dc:date>
    </item>
    <item>
      <title>Re: Looping through table and creating Dynamic columns</title>
      <link>https://community.qlik.com/t5/QlikView/Looping-through-table-and-creating-Dynamic-columns/m-p/590632#M682463</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Actually your script helped. Made little change an look like working..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please see below&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MinMax:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; min(ORD_YEAR) as MinYear,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; max(ORD_YEAR) as MaxYear&lt;/P&gt;&lt;P&gt;RESIDENT ORDER;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ORD_SUM:&lt;/P&gt;&lt;P&gt;LOAD * INLINE [&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CUST_ID];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for i=peek('MinYear',0,'MinMax') to peek('MaxYear',0,'MinMax')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG style="text-decoration: underline;"&gt;join&lt;/STRONG&gt; (ORD_SUM)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; load&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CUST_ID,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; //&amp;nbsp;&amp;nbsp;&amp;nbsp; $(i) as Year,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //&amp;nbsp;&amp;nbsp; SUM(Amount) as Amount&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SUM(Amount) &lt;STRONG style="text-decoration: underline;"&gt;as $(i)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Resident&amp;nbsp; ORDER&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; where ORD_YEAR = $(i)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; group by CUST_ID, $(i);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;next&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;drop table ORDER, MinMax;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Mar 2014 18:37:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Looping-through-table-and-creating-Dynamic-columns/m-p/590632#M682463</guid>
      <dc:creator />
      <dc:date>2014-03-18T18:37:05Z</dc:date>
    </item>
    <item>
      <title>Re: Looping through table and creating Dynamic columns</title>
      <link>https://community.qlik.com/t5/QlikView/Looping-through-table-and-creating-Dynamic-columns/m-p/590633#M682464</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Gysbert!&lt;/P&gt;&lt;P&gt;Still the back end data has multiple records&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="jiveImage" src="https://community.qlik.com/legacyfs/online/55298_pastedImage_0.png" style="width: 620px; height: 380px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Mar 2014 18:42:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Looping-through-table-and-creating-Dynamic-columns/m-p/590633#M682464</guid>
      <dc:creator />
      <dc:date>2014-03-18T18:42:08Z</dc:date>
    </item>
    <item>
      <title>Re: Looping through table and creating Dynamic columns</title>
      <link>https://community.qlik.com/t5/QlikView/Looping-through-table-and-creating-Dynamic-columns/m-p/590634#M682465</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Makes sense.&lt;/P&gt;&lt;P&gt;(BTW, you don't need to group by &lt;EM&gt;$(i)&lt;/EM&gt; anymore, although no harm either.)&lt;/P&gt;&lt;P&gt;The only remaining question is what to do with the dynamic front end.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Mar 2014 18:45:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Looping-through-table-and-creating-Dynamic-columns/m-p/590634#M682465</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-03-18T18:45:13Z</dc:date>
    </item>
    <item>
      <title>Re: Looping through table and creating Dynamic columns</title>
      <link>https://community.qlik.com/t5/QlikView/Looping-through-table-and-creating-Dynamic-columns/m-p/590635#M682466</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That helps even better for 2011 there were no data and now I have blank column for that .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="jiveImage" src="https://community.qlik.com/legacyfs/online/55299_pastedImage_0.png" style="width: auto; height: auto;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Mar 2014 18:45:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Looping-through-table-and-creating-Dynamic-columns/m-p/590635#M682466</guid>
      <dc:creator />
      <dc:date>2014-03-18T18:45:31Z</dc:date>
    </item>
    <item>
      <title>Re: Looping through table and creating Dynamic columns</title>
      <link>https://community.qlik.com/t5/QlikView/Looping-through-table-and-creating-Dynamic-columns/m-p/590636#M682467</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is mostly&amp;nbsp; 1 time deal. But I have similar reports where I dont use year as column name rather the difference between the current year and order year prefixed with YR as column name and the title for YR_0 ( which is 2014)&amp;nbsp; will be year(Today()) and for YR_1 (i.e 2013) will be (year(Today())-1) and so forth. The table is limited to past 5 years.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Mar 2014 18:53:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Looping-through-table-and-creating-Dynamic-columns/m-p/590636#M682467</guid>
      <dc:creator />
      <dc:date>2014-03-18T18:53:32Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Looping through table and creating Dynamic columns</title>
      <link>https://community.qlik.com/t5/QlikView/Looping-through-table-and-creating-Dynamic-columns/m-p/590637#M682468</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are you sure you opened the correct version? Perhaps saving it under a different name helps.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Mar 2014 20:08:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Looping-through-table-and-creating-Dynamic-columns/m-p/590637#M682468</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2014-03-18T20:08:08Z</dc:date>
    </item>
    <item>
      <title>Re: Looping through table and creating Dynamic columns</title>
      <link>https://community.qlik.com/t5/QlikView/Looping-through-table-and-creating-Dynamic-columns/m-p/590638#M682469</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry, I was looking at the old one..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="jiveImage" src="https://community.qlik.com/legacyfs/online/55303_pastedImage_0.png" style="width: 620px; height: 454px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Mar 2014 22:09:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Looping-through-table-and-creating-Dynamic-columns/m-p/590638#M682469</guid>
      <dc:creator />
      <dc:date>2014-03-18T22:09:54Z</dc:date>
    </item>
  </channel>
</rss>

