<?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 Small modification to a macro in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Small-modification-to-a-macro/m-p/629770#M1088794</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;I have a macro which cycles through the contents of a field, which works great. &lt;/P&gt;&lt;P&gt;What I would like to do is cycle through the items in the list that meet a criteris in another, i.e. for this, only cycle through the 'names' which have a 'Y' in another column. These columns are connected in a table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is this possible? Code below.&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sub SelectNext&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; set mySelections = ActiveDocument.fields("Name").GetSelectedValues(1)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ActiveDocument.Fields("Name").Clear&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if mySelections.Count = 0 then&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; set val=ActiveDocument.Fields("Name").GetPossibleValues(1)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ValueToSelect = val.Item(0).Text&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; else&lt;/P&gt;&lt;P&gt;&amp;nbsp; set val=ActiveDocument.Fields("Name").GetPossibleValues&lt;/P&gt;&lt;P&gt;&amp;nbsp; IamDone = " "&lt;/P&gt;&lt;P&gt;&amp;nbsp; for i=0 to val.Count-1&lt;/P&gt;&lt;P&gt;&amp;nbsp; ValueToSelect = val.Item(i).Text&lt;/P&gt;&lt;P&gt;&amp;nbsp; if IamDone = "X" then&lt;/P&gt;&lt;P&gt;&amp;nbsp; exit for&lt;/P&gt;&lt;P&gt;&amp;nbsp; end if&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if val.Item(i).Text = mySelections.Item(0).text then&lt;/P&gt;&lt;P&gt;&amp;nbsp; IamDone = "X"&lt;/P&gt;&lt;P&gt;&amp;nbsp; end if&lt;/P&gt;&lt;P&gt;&amp;nbsp; next&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; end if&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; ActiveDocument.Fields("Name").Select ValueToSelect&lt;/P&gt;&lt;P&gt;End Sub&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 27 May 2014 15:33:22 GMT</pubDate>
    <dc:creator />
    <dc:date>2014-05-27T15:33:22Z</dc:date>
    <item>
      <title>Small modification to a macro</title>
      <link>https://community.qlik.com/t5/QlikView/Small-modification-to-a-macro/m-p/629770#M1088794</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;I have a macro which cycles through the contents of a field, which works great. &lt;/P&gt;&lt;P&gt;What I would like to do is cycle through the items in the list that meet a criteris in another, i.e. for this, only cycle through the 'names' which have a 'Y' in another column. These columns are connected in a table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is this possible? Code below.&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sub SelectNext&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; set mySelections = ActiveDocument.fields("Name").GetSelectedValues(1)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ActiveDocument.Fields("Name").Clear&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if mySelections.Count = 0 then&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; set val=ActiveDocument.Fields("Name").GetPossibleValues(1)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ValueToSelect = val.Item(0).Text&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; else&lt;/P&gt;&lt;P&gt;&amp;nbsp; set val=ActiveDocument.Fields("Name").GetPossibleValues&lt;/P&gt;&lt;P&gt;&amp;nbsp; IamDone = " "&lt;/P&gt;&lt;P&gt;&amp;nbsp; for i=0 to val.Count-1&lt;/P&gt;&lt;P&gt;&amp;nbsp; ValueToSelect = val.Item(i).Text&lt;/P&gt;&lt;P&gt;&amp;nbsp; if IamDone = "X" then&lt;/P&gt;&lt;P&gt;&amp;nbsp; exit for&lt;/P&gt;&lt;P&gt;&amp;nbsp; end if&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if val.Item(i).Text = mySelections.Item(0).text then&lt;/P&gt;&lt;P&gt;&amp;nbsp; IamDone = "X"&lt;/P&gt;&lt;P&gt;&amp;nbsp; end if&lt;/P&gt;&lt;P&gt;&amp;nbsp; next&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; end if&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; ActiveDocument.Fields("Name").Select ValueToSelect&lt;/P&gt;&lt;P&gt;End Sub&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 May 2014 15:33:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Small-modification-to-a-macro/m-p/629770#M1088794</guid>
      <dc:creator />
      <dc:date>2014-05-27T15:33:22Z</dc:date>
    </item>
  </channel>
</rss>

