<?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 to create string from selected field values in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Macro-to-create-string-from-selected-field-values/m-p/1367077#M418275</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Woops, just learned of the Evaluate() method.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;concatString = "(""" &amp;amp; ActiveDocument.Evaluate(&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;concat({state1}DISTINCT ENTITY_NAME, '""|""') &amp;amp; "")"&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 11 Jul 2017 20:48:38 GMT</pubDate>
    <dc:creator>dselgo_eidex</dc:creator>
    <dc:date>2017-07-11T20:48:38Z</dc:date>
    <item>
      <title>Macro to create string from selected field values</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-to-create-string-from-selected-field-values/m-p/1367076#M418274</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello, I'm trying to make a search string to store into a variable for later use via a macro. I already have an action on a button that is doing this, but I'm trying to make a macro to do this instead (the reason is that I want a number of variables to be set according to which button was pushed, and I think it will be easier to maintain in a macro rather than in 10+ Set Variable actions). Currently my Select in Field action is doing this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;='("' &amp;amp; concat({state1}DISTINCT ENTITY_NAME, '"|"') &amp;amp; '")'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm trying to get a macro to form the same string value (i.e. ("A"|"B")). Currently I have this in my macro:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Set fieldSelections = ActiveDocument.Fields("ENTITY_NAME", "state1").GetSelectedValues()&lt;/P&gt;&lt;P&gt;Set concatString = "(""" &amp;amp; Join(fieldSelections, """|""") &amp;amp; """)"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but I am receiving an error on the second line. From what I've read, the Join function in VBScript is meant to take an array and delimiter and return a string value (&lt;A href="https://www.w3schools.com/asp/func_join.asp" title="https://www.w3schools.com/asp/func_join.asp"&gt;VBScript Join Function&lt;/A&gt;). However, the GetSelectedValues() method returns an object of the IArrayOfFieldValue class, which I assume works like an array. Is there any way that I can concatenate the values returned by GetSelectedValues()?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Jul 2017 20:23:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-to-create-string-from-selected-field-values/m-p/1367076#M418274</guid>
      <dc:creator>dselgo_eidex</dc:creator>
      <dc:date>2017-07-11T20:23:18Z</dc:date>
    </item>
    <item>
      <title>Re: Macro to create string from selected field values</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-to-create-string-from-selected-field-values/m-p/1367077#M418275</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Woops, just learned of the Evaluate() method.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;concatString = "(""" &amp;amp; ActiveDocument.Evaluate(&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;concat({state1}DISTINCT ENTITY_NAME, '""|""') &amp;amp; "")"&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Jul 2017 20:48:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-to-create-string-from-selected-field-values/m-p/1367077#M418275</guid>
      <dc:creator>dselgo_eidex</dc:creator>
      <dc:date>2017-07-11T20:48:38Z</dc:date>
    </item>
  </channel>
</rss>

