<?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 Macro to select fields from getfieldselections in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Macro-to-select-fields-from-getfieldselections/m-p/154399#M31031</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 need a macro to select all fields with the same name in 2 ListBox.&lt;/P&gt;&lt;P&gt;For example, if I select 16/11/2008 and 17/11/2008 in the date1 listbox, the macro have to auto-select the same fields for date2.&lt;/P&gt;&lt;P&gt;I tested 2 solutions :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE ___default_attr="plain" class="jive_text_macro jive_macro_code" jivemacro="code"&gt;&lt;BR /&gt;sub Select_dates&lt;BR /&gt;&lt;BR /&gt;ActiveDocument.getField("date2").ToggleSelect "getfieldselections(date1)"&lt;BR /&gt;&lt;BR /&gt;end sub&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;sub Select_dates2&lt;BR /&gt;&lt;BR /&gt;set fselected = ActiveDocument.Fields("date1").GetSelectedValues&lt;BR /&gt;ActiveDocument.Fields("date2").ToggleSelect fselected&lt;BR /&gt;&lt;BR /&gt;end sub&lt;BR /&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;Thanks in advance&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 17 Nov 2009 18:17:01 GMT</pubDate>
    <dc:creator />
    <dc:date>2009-11-17T18:17:01Z</dc:date>
    <item>
      <title>Macro to select fields from getfieldselections</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-to-select-fields-from-getfieldselections/m-p/154399#M31031</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 need a macro to select all fields with the same name in 2 ListBox.&lt;/P&gt;&lt;P&gt;For example, if I select 16/11/2008 and 17/11/2008 in the date1 listbox, the macro have to auto-select the same fields for date2.&lt;/P&gt;&lt;P&gt;I tested 2 solutions :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE ___default_attr="plain" class="jive_text_macro jive_macro_code" jivemacro="code"&gt;&lt;BR /&gt;sub Select_dates&lt;BR /&gt;&lt;BR /&gt;ActiveDocument.getField("date2").ToggleSelect "getfieldselections(date1)"&lt;BR /&gt;&lt;BR /&gt;end sub&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;sub Select_dates2&lt;BR /&gt;&lt;BR /&gt;set fselected = ActiveDocument.Fields("date1").GetSelectedValues&lt;BR /&gt;ActiveDocument.Fields("date2").ToggleSelect fselected&lt;BR /&gt;&lt;BR /&gt;end sub&lt;BR /&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;Thanks in advance&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Nov 2009 18:17:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-to-select-fields-from-getfieldselections/m-p/154399#M31031</guid>
      <dc:creator />
      <dc:date>2009-11-17T18:17:01Z</dc:date>
    </item>
    <item>
      <title>Macro to select fields from getfieldselections</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-to-select-fields-from-getfieldselections/m-p/154400#M31032</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I found a solution but it work only for 1 slection, no mutliple selections.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;&lt;BR /&gt;sub Select_dates&lt;BR /&gt;&lt;BR /&gt;ActiveDocument.Fields("date2").Select ActiveDocument.Evaluate("getfieldselections(date1)")&lt;BR /&gt;&lt;BR /&gt;end sub&lt;BR /&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Nov 2009 21:33:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-to-select-fields-from-getfieldselections/m-p/154400#M31032</guid>
      <dc:creator />
      <dc:date>2009-11-17T21:33:34Z</dc:date>
    </item>
    <item>
      <title>Macro to select fields from getfieldselections</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-to-select-fields-from-getfieldselections/m-p/154401#M31033</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This should work for you:&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;sub NewSelect&lt;BR /&gt; list = ActiveDocument.Variables("vDate1").GetContent.String&lt;BR /&gt; test = Split(list, ", ")&lt;BR /&gt;&lt;BR /&gt; set fld = ActiveDocument.Fields("date2")&lt;BR /&gt;&lt;BR /&gt; fld.Select test(0)&lt;BR /&gt;&lt;BR /&gt; for i = 1 to UBOUND(test)&lt;BR /&gt; fld.ToggleSelect test(i)&lt;BR /&gt; next&lt;BR /&gt;End Sub&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;That takes the GetFieldSelections values for date1 using a variable. It then uses the VB command split, to separate that into array elements. For the first item, we use the normal select, which should select only that one. Then we use ToggleSelect for the rest to get the current selection and this one.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Nov 2009 21:59:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-to-select-fields-from-getfieldselections/m-p/154401#M31033</guid>
      <dc:creator />
      <dc:date>2009-11-17T21:59:51Z</dc:date>
    </item>
    <item>
      <title>Macro to select fields from getfieldselections</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-to-select-fields-from-getfieldselections/m-p/154402#M31034</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your answer.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Nov 2009 22:25:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-to-select-fields-from-getfieldselections/m-p/154402#M31034</guid>
      <dc:creator />
      <dc:date>2009-11-17T22:25:51Z</dc:date>
    </item>
    <item>
      <title>Macro to select fields from getfieldselections</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-to-select-fields-from-getfieldselections/m-p/154403#M31035</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You were on the right track with the example you uploaded. It's a one-liner.&lt;/P&gt;&lt;P&gt;ActiveDocument.Fields("date2").SelectValues ActiveDocument.Fields("date1").GetSelectedValues&lt;/P&gt;&lt;P&gt;With V9, I think you can do it without a macro but I'm not sure of the Action specifics. Anyone?&lt;/P&gt;&lt;P&gt;-Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Nov 2009 04:31:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-to-select-fields-from-getfieldselections/m-p/154403#M31035</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2009-11-18T04:31:01Z</dc:date>
    </item>
  </channel>
</rss>

