<?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: Loop Macro in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Loop-Macro/m-p/1955410#M1219892</link>
    <description>&lt;P&gt;&lt;STRONG&gt;It works thank you very much Rob&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Sautations&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Sofiane&lt;/STRONG&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 13 Jul 2022 18:10:49 GMT</pubDate>
    <dc:creator>444sofiane</dc:creator>
    <dc:date>2022-07-13T18:10:49Z</dc:date>
    <item>
      <title>Loop Macro</title>
      <link>https://community.qlik.com/t5/QlikView/Loop-Macro/m-p/1955325#M1219886</link>
      <description>&lt;P&gt;Hello Everybody,&lt;/P&gt;
&lt;P&gt;I tried to do a macro pressing x times a button (here x is a field selection in a table of values)&lt;BR /&gt;but when i use a non constant variable (here v) in the loop for it doesn't work for some reason :&lt;/P&gt;
&lt;P&gt;sub Active&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;set v=ActiveDocument.Fields("NbValues").GetSelectedValues&lt;BR /&gt;if v.Count &amp;gt; 0 then&lt;BR /&gt;&amp;nbsp; &amp;nbsp; for i=1 to v&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ActiveDocument.GetSheetObject("BU09").Press&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;for j=1 to 1000&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;next&lt;BR /&gt;&amp;nbsp; &amp;nbsp; next&lt;BR /&gt;end if&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;end Sub&lt;/P&gt;
&lt;P&gt;Any idea how to solve this ?&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jul 2022 14:54:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Loop-Macro/m-p/1955325#M1219886</guid>
      <dc:creator>444sofiane</dc:creator>
      <dc:date>2022-07-13T14:54:01Z</dc:date>
    </item>
    <item>
      <title>Re: Loop Macro</title>
      <link>https://community.qlik.com/t5/QlikView/Loop-Macro/m-p/1955337#M1219887</link>
      <description>&lt;P&gt;&lt;SPAN&gt;for i=1 to v.&lt;STRONG&gt;Count&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;-Rob&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jul 2022 15:12:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Loop-Macro/m-p/1955337#M1219887</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2022-07-13T15:12:54Z</dc:date>
    </item>
    <item>
      <title>Re: Loop Macro</title>
      <link>https://community.qlik.com/t5/QlikView/Loop-Macro/m-p/1955369#M1219890</link>
      <description>&lt;P&gt;Hello Rob&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would like to stop the for loop when I reach the value in field "NbValues" not when I reach the Number of Selections in the ffield "NbValues" dont know if its clear&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jul 2022 16:12:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Loop-Macro/m-p/1955369#M1219890</guid>
      <dc:creator>444sofiane</dc:creator>
      <dc:date>2022-07-13T16:12:01Z</dc:date>
    </item>
    <item>
      <title>Re: Loop Macro</title>
      <link>https://community.qlik.com/t5/QlikView/Loop-Macro/m-p/1955400#M1219891</link>
      <description>&lt;P&gt;&lt;SPAN&gt;ActiveDocument.Fields("NbValues").GetSelectedValues returns an Array so you would have to select an array item and get it's value. To get the value of the first item:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;v.Item(0).Number&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;You may find it simpler to use the Evaluate function which allows you to use Qlik expressions.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;for i=1 to ActiveDocument.Evaluate("=Min(NbValues)")&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;-Rob&lt;BR /&gt;&lt;A href="http://www.easyqlik.com" target="_blank"&gt;http://www.easyqlik.com&lt;/A&gt;&lt;BR /&gt;&lt;A href="http://masterssummit.com" target="_blank"&gt;http://masterssummit.com&lt;/A&gt;&lt;BR /&gt;&lt;A href="http://qlikviewcookbook.com" target="_blank"&gt;http://qlikviewcookbook.com&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jul 2022 17:41:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Loop-Macro/m-p/1955400#M1219891</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2022-07-13T17:41:21Z</dc:date>
    </item>
    <item>
      <title>Re: Loop Macro</title>
      <link>https://community.qlik.com/t5/QlikView/Loop-Macro/m-p/1955410#M1219892</link>
      <description>&lt;P&gt;&lt;STRONG&gt;It works thank you very much Rob&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Sautations&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Sofiane&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jul 2022 18:10:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Loop-Macro/m-p/1955410#M1219892</guid>
      <dc:creator>444sofiane</dc:creator>
      <dc:date>2022-07-13T18:10:49Z</dc:date>
    </item>
  </channel>
</rss>

