<?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 Script with Variables in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Looping-Script-with-Variables/m-p/500174#M689113</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Maybe similar to this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;For i = 0 to 39&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Let vMonthYear = date(AddMonths(makedate(2010),$(i)),'MMMYYYY');&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Table:&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Load Sum(Sales)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp; Dept,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp; only(MonthYr) as MonthYr,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Resident Production&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Group by Dept&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Where MonthYr = '$(vMonthYear)';&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Next i&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 09 Nov 2013 00:37:49 GMT</pubDate>
    <dc:creator>swuehl</dc:creator>
    <dc:date>2013-11-09T00:37:49Z</dc:date>
    <item>
      <title>Looping Script with Variables</title>
      <link>https://community.qlik.com/t5/QlikView/Looping-Script-with-Variables/m-p/500173#M689112</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;I need to write a script that creates a table for every month using variables:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Basically what I need is to run the following script for every month through Oct2013. (40+ times!). Each table would be concatentated with the previous (so would have one big table at end). How can this be done so I loop through each month? I am trying to avoid writing this code 40 different times...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table:&lt;/P&gt;&lt;P&gt;Load Sum(Sales)&lt;/P&gt;&lt;P&gt;Dept&lt;/P&gt;&lt;P&gt;MonthYr,&lt;/P&gt;&lt;P&gt;Resident Production&lt;/P&gt;&lt;P&gt;Group by Dept&lt;/P&gt;&lt;P&gt;Where MonthYr = Jan2010;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 09 Nov 2013 00:27:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Looping-Script-with-Variables/m-p/500173#M689112</guid>
      <dc:creator>zagzebski</dc:creator>
      <dc:date>2013-11-09T00:27:21Z</dc:date>
    </item>
    <item>
      <title>Re: Looping Script with Variables</title>
      <link>https://community.qlik.com/t5/QlikView/Looping-Script-with-Variables/m-p/500174#M689113</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Maybe similar to this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;For i = 0 to 39&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Let vMonthYear = date(AddMonths(makedate(2010),$(i)),'MMMYYYY');&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Table:&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Load Sum(Sales)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp; Dept,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp; only(MonthYr) as MonthYr,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Resident Production&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Group by Dept&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Where MonthYr = '$(vMonthYear)';&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Next i&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 09 Nov 2013 00:37:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Looping-Script-with-Variables/m-p/500174#M689113</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2013-11-09T00:37:49Z</dc:date>
    </item>
    <item>
      <title>Re: Looping Script with Variables</title>
      <link>https://community.qlik.com/t5/QlikView/Looping-Script-with-Variables/m-p/500175#M689114</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;other way is keep all files in one folder and then access from by ising '*' them like eg below&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Temp_Production:&lt;/P&gt;&lt;P&gt;load *&lt;/P&gt;&lt;P&gt;from PATH/*;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Production&lt;/SPAN&gt;_Final:&lt;/P&gt;&lt;P&gt;noconcatenate&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Load Sum(Sales)&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Dept&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;MonthYr,&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Resident Temp_Production&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Group by Dept,MonthYr;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;drop table Temp_Production;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 09 Nov 2013 00:46:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Looping-Script-with-Variables/m-p/500175#M689114</guid>
      <dc:creator>preminqlik</dc:creator>
      <dc:date>2013-11-09T00:46:00Z</dc:date>
    </item>
    <item>
      <title>Re: Looping Script with Variables</title>
      <link>https://community.qlik.com/t5/QlikView/Looping-Script-with-Variables/m-p/500176#M689115</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you're really loading all the months from the same resident table "Production" why not simply group by Dept and MonthYr and eliminate the need for the loop?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 09 Nov 2013 02:38:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Looping-Script-with-Variables/m-p/500176#M689115</guid>
      <dc:creator>andrewpettit</dc:creator>
      <dc:date>2013-11-09T02:38:45Z</dc:date>
    </item>
    <item>
      <title>Re: Looping Script with Variables</title>
      <link>https://community.qlik.com/t5/QlikView/Looping-Script-with-Variables/m-p/500177#M689116</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There is actually alot more to what I am trying to do - just didnt show it all. I am basically creating aggragated cubes that have the each dept's sales as a percent of the total sales for every month. It was way to hard to do on the front end.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 09 Nov 2013 16:12:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Looping-Script-with-Variables/m-p/500177#M689116</guid>
      <dc:creator>zagzebski</dc:creator>
      <dc:date>2013-11-09T16:12:29Z</dc:date>
    </item>
  </channel>
</rss>

