<?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 Variable To Propoperly Read Field Selections in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Macro-Variable-To-Propoperly-Read-Field-Selections/m-p/430331#M160431</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Why are you using a macro instead of a field OnSelect trigger to set the variable? It's much easier to add a Set Variable action with your variable as target and GetFieldSelections([Source Choice] , ',' 99) as value. The OnSelect trigger action will also clear you variable if you clear the selections.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Nulls cannot be selected in Qlikview, so getfieldselections can't ever contain a null.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 12 Dec 2012 18:59:34 GMT</pubDate>
    <dc:creator>Gysbert_Wassenaar</dc:creator>
    <dc:date>2012-12-12T18:59:34Z</dc:date>
    <item>
      <title>Macro Variable To Propoperly Read Field Selections</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-Variable-To-Propoperly-Read-Field-Selections/m-p/430330#M160430</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to assign multiple field values from a ListBox to a variable using a macro.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Consequently I used:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ActiveDocument.Evaluate("GetFieldSelections([Source Choice] , ',' 99)")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However when I lookup the relevant variable in the list of QlikView variables, there is nothing assigned (only '-' ).&lt;/P&gt;&lt;P&gt;The above function works for single selection fields though.&lt;/P&gt;&lt;P&gt;What needs to be changed in the syntax ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Another issue with the above function is that when I deselect the field values, the relevant varaiable still contains the last selection. &lt;/P&gt;&lt;P&gt;Why does the GetFieldSelections function, not read a "null" field selection ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also instead of always declaring variables in QlikView then importing them into the macro editor, I tried:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set SourcChoiceValue = SourceChoiceTemp = ActiveDocument.Evaluate("GetFieldSelections([Source Choice])")&lt;/P&gt;&lt;P&gt;I get an objectb type error though whether or not I include the leading 'Set' keyword.&lt;/P&gt;&lt;P&gt;What needs to be changed ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Dec 2012 14:22:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-Variable-To-Propoperly-Read-Field-Selections/m-p/430330#M160430</guid>
      <dc:creator />
      <dc:date>2012-12-12T14:22:08Z</dc:date>
    </item>
    <item>
      <title>Re: Macro Variable To Propoperly Read Field Selections</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-Variable-To-Propoperly-Read-Field-Selections/m-p/430331#M160431</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Why are you using a macro instead of a field OnSelect trigger to set the variable? It's much easier to add a Set Variable action with your variable as target and GetFieldSelections([Source Choice] , ',' 99) as value. The OnSelect trigger action will also clear you variable if you clear the selections.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Nulls cannot be selected in Qlikview, so getfieldselections can't ever contain a null.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Dec 2012 18:59:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-Variable-To-Propoperly-Read-Field-Selections/m-p/430331#M160431</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2012-12-12T18:59:34Z</dc:date>
    </item>
  </channel>
</rss>

