<?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 Assign MultiBox Value To Variable in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Macro-To-Assign-MultiBox-Value-To-Variable/m-p/427181#M159169</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to assign the MultiBox selection of a field to a variable (the user selected field value in the list should be assigned to a varaible for later calculations).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After seraching around, I created 2 empty varaibles in the load script as well as the following macro (sheet object trigger)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sub Set_Product_Value&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set ProductTemp = ActiveDocument.Variables("Product_Temp")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set ProductValue = ActiveDocument.Variables("Product_Value")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set ProductTemp = ActiveDocument.Fields("Product").GetSelectedValues&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ProductValue.SetContent ProductTemp ,true&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End Sub&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However I get the following error: Type mismatch: 'ProductValue.SetContent'&lt;/P&gt;&lt;P&gt;I am trying to have the value assigned to the variable 'Product_Value' in the document.&lt;/P&gt;&lt;P&gt;What is wrong ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 11 Dec 2012 15:37:47 GMT</pubDate>
    <dc:creator />
    <dc:date>2012-12-11T15:37:47Z</dc:date>
    <item>
      <title>Macro To Assign MultiBox Value To Variable</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-To-Assign-MultiBox-Value-To-Variable/m-p/427181#M159169</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to assign the MultiBox selection of a field to a variable (the user selected field value in the list should be assigned to a varaible for later calculations).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After seraching around, I created 2 empty varaibles in the load script as well as the following macro (sheet object trigger)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sub Set_Product_Value&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set ProductTemp = ActiveDocument.Variables("Product_Temp")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set ProductValue = ActiveDocument.Variables("Product_Value")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set ProductTemp = ActiveDocument.Fields("Product").GetSelectedValues&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ProductValue.SetContent ProductTemp ,true&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End Sub&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However I get the following error: Type mismatch: 'ProductValue.SetContent'&lt;/P&gt;&lt;P&gt;I am trying to have the value assigned to the variable 'Product_Value' in the document.&lt;/P&gt;&lt;P&gt;What is wrong ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Dec 2012 15:37:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-To-Assign-MultiBox-Value-To-Variable/m-p/427181#M159169</guid>
      <dc:creator />
      <dc:date>2012-12-11T15:37:47Z</dc:date>
    </item>
    <item>
      <title>Re: Macro To Assign MultiBox Value To Variable</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-To-Assign-MultiBox-Value-To-Variable/m-p/427182#M159170</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #737373; font-family: Arial; background-color: #ffffff;"&gt;GetSelectedValues is a list (can say as array) of value&lt;/SPAN&gt;s. you cannot assign it to a QV variable.&lt;/P&gt;&lt;P&gt;You need to use &lt;/P&gt;&lt;P&gt;activedocument.Evaluate("GetFieldSelections(Product, ',', 99)")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it helps&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Dec 2012 15:55:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-To-Assign-MultiBox-Value-To-Variable/m-p/427182#M159170</guid>
      <dc:creator>CELAMBARASAN</dc:creator>
      <dc:date>2012-12-11T15:55:28Z</dc:date>
    </item>
    <item>
      <title>Re: Macro To Assign MultiBox Value To Variable</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-To-Assign-MultiBox-Value-To-Variable/m-p/427183#M159171</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for the quick answer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I updated the concerned line with:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set ProductTemp = ActiveDocument.Evaluate([string:"GetFieldSelections(Product)"])&lt;/P&gt;&lt;P&gt;Only one value is possible, so I omitted the extra varaibles in the GetFieldSelections function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As you can see I also added [string: "-"], as I get an error message.&lt;/P&gt;&lt;P&gt;The items in the 'Product' list are effectively multi-word.&lt;/P&gt;&lt;P&gt;How would I assign this acorrectly in the macro ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Dec 2012 16:05:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-To-Assign-MultiBox-Value-To-Variable/m-p/427183#M159171</guid>
      <dc:creator />
      <dc:date>2012-12-11T16:05:52Z</dc:date>
    </item>
    <item>
      <title>Re: Macro To Assign MultiBox Value To Variable</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-To-Assign-MultiBox-Value-To-Variable/m-p/427184#M159172</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Simply you can use as&lt;/P&gt;&lt;P&gt;ProductTemp = ActiveDocument.Evaluate("GetFieldSelections(&lt;SPAN style="color: #737373; font-family: Arial; background-color: #ffffff;"&gt;Product&lt;/SPAN&gt;)")&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Dec 2012 17:30:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-To-Assign-MultiBox-Value-To-Variable/m-p/427184#M159172</guid>
      <dc:creator>CELAMBARASAN</dc:creator>
      <dc:date>2012-12-11T17:30:38Z</dc:date>
    </item>
  </channel>
</rss>

