<?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 Selecting multiple values in a field using a macro in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Selecting-multiple-values-in-a-field-using-a-macro/m-p/189335#M52258</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Maybe you can use the &lt;I&gt;toggleselect&lt;/I&gt; function.&lt;BR /&gt;I used it and it works for me:&lt;BR /&gt;&lt;BR /&gt;Here is an example of what I used:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-style: italic"&gt;sub NameSub&lt;/P&gt;&lt;P&gt;&lt;I&gt;set FIELDNAME = activedocument.fields("&lt;/I&gt;FIELDNAME")&lt;/P&gt;&lt;P&gt;&lt;I&gt;&lt;/I&gt;FIELDNAME.select "20200" ' clears all in &lt;I&gt;FIELDNAME&lt;/I&gt; and selects 20200&lt;/P&gt;&lt;P&gt;&lt;I&gt;&lt;/I&gt;FIELDNAME.toggleselect "50300" ' selects 50300&lt;/P&gt;&lt;P&gt;&lt;I&gt;&lt;/I&gt;FIELDNAME.toggleselect "60200" ' selects 60200&lt;/P&gt;&lt;P style="font-style: italic"&gt;end sub&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 30 Mar 2011 09:53:02 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2011-03-30T09:53:02Z</dc:date>
    <item>
      <title>Selecting multiple values in a field using a macro</title>
      <link>https://community.qlik.com/t5/QlikView/Selecting-multiple-values-in-a-field-using-a-macro/m-p/189334#M52257</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I would like to create a macro which is triggered when a variable is changed through an inputbox. Therefore I have created the following simple macro.&lt;/P&gt;&lt;P&gt;&lt;CODE&gt;Sub SwitchFieldSelection&lt;BR /&gt; set vVariable = ActiveDocument.Variables("v_Switch")&lt;BR /&gt; IF vVariable.GetContent.String = "Yes" THEN&lt;BR /&gt; set objField = ActiveDocument.Fields("Type")&lt;BR /&gt; set objFieldValues = objField.GetNoValues&lt;BR /&gt; objField.Unlock&lt;BR /&gt; objFieldValues.Add&lt;BR /&gt; objFieldValues.Add&lt;BR /&gt; objFieldValues(0).Text = "Type1"&lt;BR /&gt; objFieldValues(0).IsNumeric = false&lt;BR /&gt; objFieldValues(1).Text = "Type"&lt;BR /&gt; objFieldValues(1).IsNumeric = false&lt;BR /&gt; objField.SelectValues objFieldValues&lt;BR /&gt; objField.Lock&lt;BR /&gt; ELSE&lt;BR /&gt; set objField = ActiveDocument.Fields("Type")&lt;BR /&gt; objField.Unlock&lt;BR /&gt; objField.Clear&lt;BR /&gt; objField.Lock&lt;BR /&gt; END IF&lt;BR /&gt;End Sub&lt;BR /&gt;&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;The problem is that only the second value is selected in the field, so in this case 'Type2'&lt;/P&gt;&lt;P&gt;Am I doing something wrong or is it simply not possible this way?&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;B&gt;EDIT&lt;/B&gt;: Found the solution, was just a simple typo in the value which in want to select. So this is solved.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Mar 2011 09:11:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Selecting-multiple-values-in-a-field-using-a-macro/m-p/189334#M52257</guid>
      <dc:creator />
      <dc:date>2011-03-30T09:11:42Z</dc:date>
    </item>
    <item>
      <title>Selecting multiple values in a field using a macro</title>
      <link>https://community.qlik.com/t5/QlikView/Selecting-multiple-values-in-a-field-using-a-macro/m-p/189335#M52258</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Maybe you can use the &lt;I&gt;toggleselect&lt;/I&gt; function.&lt;BR /&gt;I used it and it works for me:&lt;BR /&gt;&lt;BR /&gt;Here is an example of what I used:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-style: italic"&gt;sub NameSub&lt;/P&gt;&lt;P&gt;&lt;I&gt;set FIELDNAME = activedocument.fields("&lt;/I&gt;FIELDNAME")&lt;/P&gt;&lt;P&gt;&lt;I&gt;&lt;/I&gt;FIELDNAME.select "20200" ' clears all in &lt;I&gt;FIELDNAME&lt;/I&gt; and selects 20200&lt;/P&gt;&lt;P&gt;&lt;I&gt;&lt;/I&gt;FIELDNAME.toggleselect "50300" ' selects 50300&lt;/P&gt;&lt;P&gt;&lt;I&gt;&lt;/I&gt;FIELDNAME.toggleselect "60200" ' selects 60200&lt;/P&gt;&lt;P style="font-style: italic"&gt;end sub&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Mar 2011 09:53:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Selecting-multiple-values-in-a-field-using-a-macro/m-p/189335#M52258</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-03-30T09:53:02Z</dc:date>
    </item>
    <item>
      <title>Selecting multiple values in a field using a macro</title>
      <link>https://community.qlik.com/t5/QlikView/Selecting-multiple-values-in-a-field-using-a-macro/m-p/189336#M52259</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;See my response closer to the end of this: &lt;A href="http://community.qlik.com/forums/t/43234.aspx"&gt;http://community.qlik.com/forums/t/43234.aspx&lt;/A&gt;&lt;BR /&gt;Very simple macro, also with toggleselect, as from Dennis.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Mar 2011 10:34:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Selecting-multiple-values-in-a-field-using-a-macro/m-p/189336#M52259</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-03-30T10:34:29Z</dc:date>
    </item>
  </channel>
</rss>

