<?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 iterate the variables in macro in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/iterate-the-variables-in-macro/m-p/1234827#M392956</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi guys,&lt;/P&gt;&lt;P&gt;Is there any way to iterate the variables in macro?&lt;/P&gt;&lt;P&gt;Just to be clear, I am not asking how to write a loop in VBScript.&lt;/P&gt;&lt;P&gt;Right now i have a code like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Set vStore1 = ActiveDocument.Variables("vStore1")&amp;nbsp; &lt;/P&gt;&lt;P&gt;Set vStore2 = ActiveDocument.Variables("vStore2") &lt;/P&gt;&lt;P&gt;Set vStore3 = ActiveDocument.Variables("vStore3") &lt;/P&gt;&lt;P&gt;Set vStore4 = ActiveDocument.Variables("vStore4") &lt;/P&gt;&lt;P&gt;Set vStore5 = ActiveDocument.Variables("vStore5") &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and what i want is&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for each var in ActiveDocument.Variables&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // do something with var&lt;/P&gt;&lt;P&gt;next&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I know ActiveDocument.Variables can not be used this way. it is just to show the solution i want.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Jean&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 28 Nov 2016 08:35:00 GMT</pubDate>
    <dc:creator>jduluc12</dc:creator>
    <dc:date>2016-11-28T08:35:00Z</dc:date>
    <item>
      <title>iterate the variables in macro</title>
      <link>https://community.qlik.com/t5/QlikView/iterate-the-variables-in-macro/m-p/1234827#M392956</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi guys,&lt;/P&gt;&lt;P&gt;Is there any way to iterate the variables in macro?&lt;/P&gt;&lt;P&gt;Just to be clear, I am not asking how to write a loop in VBScript.&lt;/P&gt;&lt;P&gt;Right now i have a code like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Set vStore1 = ActiveDocument.Variables("vStore1")&amp;nbsp; &lt;/P&gt;&lt;P&gt;Set vStore2 = ActiveDocument.Variables("vStore2") &lt;/P&gt;&lt;P&gt;Set vStore3 = ActiveDocument.Variables("vStore3") &lt;/P&gt;&lt;P&gt;Set vStore4 = ActiveDocument.Variables("vStore4") &lt;/P&gt;&lt;P&gt;Set vStore5 = ActiveDocument.Variables("vStore5") &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and what i want is&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for each var in ActiveDocument.Variables&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // do something with var&lt;/P&gt;&lt;P&gt;next&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I know ActiveDocument.Variables can not be used this way. it is just to show the solution i want.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Jean&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Nov 2016 08:35:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/iterate-the-variables-in-macro/m-p/1234827#M392956</guid>
      <dc:creator>jduluc12</dc:creator>
      <dc:date>2016-11-28T08:35:00Z</dc:date>
    </item>
    <item>
      <title>Re: iterate the variables in macro</title>
      <link>https://community.qlik.com/t5/QlikView/iterate-the-variables-in-macro/m-p/1234828#M392957</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It's not quite clear for what do you want to do. But this snippet from the APIGuide.qvw should be helpful for you:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;rem ** Show name of all variables in document **&lt;/P&gt;&lt;P&gt;set vars = ActiveDocument.GetVariableDescriptions&lt;/P&gt;&lt;P&gt;for i = 0 to vars.Count - 1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; set v = vars.Item(i) &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; msgbox(v.Name)&lt;/P&gt;&lt;P&gt;next&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Nov 2016 12:32:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/iterate-the-variables-in-macro/m-p/1234828#M392957</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2016-11-28T12:32:37Z</dc:date>
    </item>
  </channel>
</rss>

