<?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: For each variable loop through code in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/For-each-variable-loop-through-code/m-p/604562#M1105598</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;/P&gt;&lt;P&gt;And so, what is the problem ? It seems that writing a loop on VB is not a QlikView question.&lt;/P&gt;&lt;P&gt;Use loop, one set of variables and string functions to dynamically get the variable names 'variableN'.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 04 Apr 2014 19:04:41 GMT</pubDate>
    <dc:creator>whiteline</dc:creator>
    <dc:date>2014-04-04T19:04:41Z</dc:date>
    <item>
      <title>For each variable loop through code</title>
      <link>https://community.qlik.com/t5/QlikView/For-each-variable-loop-through-code/m-p/604561#M1105597</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;/P&gt;&lt;P&gt;In my load script I set a certain number of variables which I load from an excel file, &lt;A _jive_internal="true" href="https://community.qlik.com/message/502687?et=watches.email.thread#502687" title="http://community.qlik.com/message/502687?et=watches.email.thread#502687"&gt;like_this.&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Currently there are always 10 variables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I then have a macro which creates an excel file for each of the stores (the variables). But I currently use the same code 10 times to create the 10 different files. I need to cater for the fact that there can be any number of variables in the excel file, so I need to loop through this same code as many times as there are variables, and each time increase the number shown in red below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;EM&gt;ActiveDocument.Fields("Store Number").Select vStore&lt;SPAN style="color: #ff0000;"&gt;1&lt;/SPAN&gt;.GetContent.String&lt;/EM&gt;&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;SPAN style="color: #00ff00; font-size: 8pt;"&gt;&lt;EM&gt;'Select 1st Store&lt;/EM&gt;&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;EM&gt;File&lt;SPAN style="color: #ff0000;"&gt;1&lt;/SPAN&gt; = Location &amp;amp; "Referred Apps Store "&amp;amp; vStore&lt;SPAN style="color: #ff0000;"&gt;1&lt;/SPAN&gt;.GetContent.String &amp;amp; " - " &amp;amp; strYear &amp;amp; strMonth &amp;amp; strDay&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;EM&gt; obj.ExportBiff File&lt;SPAN style="color: #ff0000;"&gt;1&lt;/SPAN&gt; &amp;amp; ".xls"&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;EM&gt;ActiveDocument.Fields("Store Number").Select vStore&lt;SPAN style="color: #ff0000;"&gt;2&lt;/SPAN&gt;.GetContent.String&lt;/EM&gt;&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;SPAN style="color: #00ff00; font-size: 8pt;"&gt;&lt;EM&gt;'Select 2nd Store&lt;/EM&gt;&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;EM&gt;File&lt;SPAN style="color: #ff0000;"&gt;2&lt;/SPAN&gt; = Location &amp;amp; "Referred Apps Store "&amp;amp; vStore&lt;SPAN style="color: #ff0000;"&gt;2&lt;/SPAN&gt;.GetContent.String &amp;amp; " - " &amp;amp; strYear &amp;amp; strMonth &amp;amp; strDay&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;EM&gt; obj.ExportBiff File&lt;SPAN style="color: #ff0000;"&gt;2&lt;/SPAN&gt; &amp;amp; ".xls"&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;I've attached the full macro for reference. If someone could perhaps edit the code in the txt file it will really help a lot.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Thanks,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Gerhard&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Apr 2014 15:49:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/For-each-variable-loop-through-code/m-p/604561#M1105597</guid>
      <dc:creator>gerhardl</dc:creator>
      <dc:date>2014-04-04T15:49:55Z</dc:date>
    </item>
    <item>
      <title>Re: For each variable loop through code</title>
      <link>https://community.qlik.com/t5/QlikView/For-each-variable-loop-through-code/m-p/604562#M1105598</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;/P&gt;&lt;P&gt;And so, what is the problem ? It seems that writing a loop on VB is not a QlikView question.&lt;/P&gt;&lt;P&gt;Use loop, one set of variables and string functions to dynamically get the variable names 'variableN'.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Apr 2014 19:04:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/For-each-variable-loop-through-code/m-p/604562#M1105598</guid>
      <dc:creator>whiteline</dc:creator>
      <dc:date>2014-04-04T19:04:41Z</dc:date>
    </item>
    <item>
      <title>Re: For each variable loop through code</title>
      <link>https://community.qlik.com/t5/QlikView/For-each-variable-loop-through-code/m-p/604563#M1105599</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;/P&gt;&lt;P&gt;I would not have asked if I knew how to do that. And there are literally hundreds of VB questions on here, because it is VB on QlikView. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your answer is a little vague for me but I appreciate the response. If someone could help me with the code I would appreciate that even more. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Apr 2014 19:26:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/For-each-variable-loop-through-code/m-p/604563#M1105599</guid>
      <dc:creator>gerhardl</dc:creator>
      <dc:date>2014-04-04T19:26:47Z</dc:date>
    </item>
    <item>
      <title>Re: For each variable loop through code</title>
      <link>https://community.qlik.com/t5/QlikView/For-each-variable-loop-through-code/m-p/604564#M1105600</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;/P&gt;&lt;P&gt;Yes, but your question is really refer to VB syntax.&lt;/P&gt;&lt;P&gt;Post your tries with the loop.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 05 Apr 2014 10:05:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/For-each-variable-loop-through-code/m-p/604564#M1105600</guid>
      <dc:creator>whiteline</dc:creator>
      <dc:date>2014-04-05T10:05:16Z</dc:date>
    </item>
    <item>
      <title>Re: For each variable loop through code</title>
      <link>https://community.qlik.com/t5/QlikView/For-each-variable-loop-through-code/m-p/604565#M1105601</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hallo Gerhard,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;what are you doing with those variables?&lt;/P&gt;&lt;P&gt;Maybe there is a solution without creating multiple variables?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Marco&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 05 Apr 2014 18:44:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/For-each-variable-loop-through-code/m-p/604565#M1105601</guid>
      <dc:creator>MarcoWedel</dc:creator>
      <dc:date>2014-04-05T18:44:41Z</dc:date>
    </item>
    <item>
      <title>Re: For each variable loop through code</title>
      <link>https://community.qlik.com/t5/QlikView/For-each-variable-loop-through-code/m-p/604566#M1105602</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Marco,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The variables are store numbers, and for each of the stores a report listing all outstanding applications are created every morning and then emailed to each store individually.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We have hundreds of stores, but this report goes only to 10 or so stores (those with the most applications), so I want business users to be able to choose which stores get the reports - they can do this simply by updating the store number and email address in the excel file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It works perfectly, except that it HAS to be 10 stores at the moment - I want the user to be able to add or remove stores, so the QlikView macro needs to loop X number of times, based on how many variables were loaded.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Gerhard&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Apr 2014 06:20:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/For-each-variable-loop-through-code/m-p/604566#M1105602</guid>
      <dc:creator>gerhardl</dc:creator>
      <dc:date>2014-04-07T06:20:19Z</dc:date>
    </item>
    <item>
      <title>Re: For each variable loop through code</title>
      <link>https://community.qlik.com/t5/QlikView/For-each-variable-loop-through-code/m-p/1525924#M1105603</link>
      <description>&lt;P&gt;In case anyone else finds this via google.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Use: Document.GetVariableDescriptions&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;APIGuide has an example (attached)&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="APIGuide GetVariableDescriptions.PNG" style="width: 740px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/2946i7DDA389D46D0CD92/image-size/large?v=v2&amp;amp;px=999" role="button" title="APIGuide GetVariableDescriptions.PNG" alt="APIGuide GetVariableDescriptions.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Jan 2019 15:51:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/For-each-variable-loop-through-code/m-p/1525924#M1105603</guid>
      <dc:creator>mattydolan</dc:creator>
      <dc:date>2019-01-03T15:51:25Z</dc:date>
    </item>
  </channel>
</rss>

