<?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: Macro Loop through Sales Codes in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Macro-Loop-through-Sales-Codes/m-p/1962236#M1220172</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/220"&gt;@cwolf&lt;/a&gt;&amp;nbsp;.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I did not know that, but now I do - I just ran it and it works like a charm.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Looking at the two code options, is the one 'better' or more technically correct to use than the other?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for the solution.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 29 Jul 2022 09:40:07 GMT</pubDate>
    <dc:creator>johngouws</dc:creator>
    <dc:date>2022-07-29T09:40:07Z</dc:date>
    <item>
      <title>Macro Loop through Sales Codes</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-Loop-through-Sales-Codes/m-p/1962152#M1220168</link>
      <description>&lt;P&gt;Good morning.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have an existing working macro that distributes monthly reports to around 95 Clients. This month is the first time we exceed 100 Client Reports, 112 Clients. Unfortunately the generation of the pdf's end at 100 pdf's. At first I thought it was to do with our ISP, but even after commenting out the emailing portion, it only generates 100 pdf's.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;This portion of the code is what I have been using for a while:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Sub DistributeReports()&lt;BR /&gt;ActiveDocument.ClearAll True&lt;/P&gt;
&lt;P&gt;Set Custs = ActiveDocument.Fields("SCode").GetPossibleValues&lt;/P&gt;
&lt;P&gt;For i = 0 to Custs.count -1&lt;BR /&gt;ActiveDocument.Fields("SCode").Select Custs.item(i).Text&lt;/P&gt;
&lt;P&gt;Reports()&lt;BR /&gt;Next&lt;/P&gt;
&lt;P&gt;ActiveDocument.ClearAll True&lt;BR /&gt;&lt;BR /&gt;End Sub&lt;/P&gt;
&lt;P&gt;sub Reports&lt;/P&gt;
&lt;P&gt;.....&lt;/P&gt;
&lt;P&gt;End Sub&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;As an alternative, I have also tried this code:&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Sub DistributeReports()&lt;BR /&gt;ActiveDocument.ClearAll True&lt;/P&gt;
&lt;P&gt;Set Custs = ActiveDocument.Fields("SCode").GetPossibleValues&lt;/P&gt;
&lt;P&gt;Do while i &amp;lt; 120&lt;BR /&gt;i = i + 1&lt;BR /&gt;ActiveDocument.Fields("SCode").Select Custs.item(i).Text&lt;/P&gt;
&lt;P&gt;Reports()&lt;BR /&gt;&lt;BR /&gt;Loop&lt;/P&gt;
&lt;P&gt;End Sub&lt;/P&gt;
&lt;P&gt;sub Reports&lt;/P&gt;
&lt;P&gt;.....&lt;/P&gt;
&lt;P&gt;End Sub&lt;/P&gt;
&lt;P&gt;Unfortunately the results are the same. I know it's a bit of a weird one, but if anyone has any thought on how I can overcome this problem, I would appreciate it very much.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jul 2022 07:33:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-Loop-through-Sales-Codes/m-p/1962152#M1220168</guid>
      <dc:creator>johngouws</dc:creator>
      <dc:date>2022-07-29T07:33:01Z</dc:date>
    </item>
    <item>
      <title>Re: Macro Loop through Sales Codes</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-Loop-through-Sales-Codes/m-p/1962191#M1220170</link>
      <description>&lt;P&gt;Per default&amp;nbsp;&lt;SPAN&gt;GetPossibleValues returns 100 values. You have use it with a value of a maximum number you want to get. For example:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Set Custs = ActiveDocument.Fields("SCode").GetPossibleValues(1000)&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jul 2022 08:34:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-Loop-through-Sales-Codes/m-p/1962191#M1220170</guid>
      <dc:creator>cwolf</dc:creator>
      <dc:date>2022-07-29T08:34:53Z</dc:date>
    </item>
    <item>
      <title>Re: Macro Loop through Sales Codes</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-Loop-through-Sales-Codes/m-p/1962236#M1220172</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/220"&gt;@cwolf&lt;/a&gt;&amp;nbsp;.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I did not know that, but now I do - I just ran it and it works like a charm.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Looking at the two code options, is the one 'better' or more technically correct to use than the other?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for the solution.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jul 2022 09:40:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-Loop-through-Sales-Codes/m-p/1962236#M1220172</guid>
      <dc:creator>johngouws</dc:creator>
      <dc:date>2022-07-29T09:40:07Z</dc:date>
    </item>
    <item>
      <title>Re: Macro Loop through Sales Codes</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-Loop-through-Sales-Codes/m-p/1962258#M1220174</link>
      <description>&lt;P&gt;The 1st variant is correct and also better.&lt;BR /&gt;The 2nd variant is incorrect anyway.&lt;/P&gt;
&lt;P&gt;The second variant should look like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;Sub DistributeReports
    ActiveDocument.ClearAll True
    Set Custs = ActiveDocument.Fields("SCode").GetPossibleValues

    i=0
    Do while i &amp;lt; Custs.Count
        ActiveDocument.Fields("SCode").Select Custs.item(i).Text
        Reports()
        i = i + 1
    Loop
End Sub&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jul 2022 10:51:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-Loop-through-Sales-Codes/m-p/1962258#M1220174</guid>
      <dc:creator>cwolf</dc:creator>
      <dc:date>2022-07-29T10:51:29Z</dc:date>
    </item>
    <item>
      <title>Re: Macro Loop through Sales Codes</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-Loop-through-Sales-Codes/m-p/1962267#M1220175</link>
      <description>&lt;P&gt;Thanks a lot, I will stick to the first.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jul 2022 11:01:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-Loop-through-Sales-Codes/m-p/1962267#M1220175</guid>
      <dc:creator>johngouws</dc:creator>
      <dc:date>2022-07-29T11:01:54Z</dc:date>
    </item>
  </channel>
</rss>

