<?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 Running Bucket of Selected Values in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Running-Bucket-of-Selected-Values/m-p/221861#M74618</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've been looking for a way to do the following on a QVW that has, say, a list box of Products and a chart showing those Products Sales over some time period:&lt;/P&gt;&lt;P&gt;- have a button that says "Add Selected Product to LIst" (ie. an array)&lt;/P&gt;&lt;P&gt;- have a button that says "Select all Products from List" (ie, force the array of vales into a selection for a list box)&lt;/P&gt;&lt;P&gt;- now I'd like to be able to:&lt;/P&gt;&lt;P&gt;1. select a Product from the List Box&lt;/P&gt;&lt;P&gt;2. click the "Add to List" button (putting the selected value in an array)&lt;/P&gt;&lt;P&gt;3. clear all selections&lt;/P&gt;&lt;P&gt;4. select another Product from the List Box&lt;/P&gt;&lt;P&gt;5. click the "Add to List" button. (now my behind the scenes array has 2 products in it.)&lt;/P&gt;&lt;P&gt;6. click the "Select all Products from List". (this would now show my 2 chosen products on my chart as if I had just selected both of them from my List Box.)&lt;/P&gt;&lt;P&gt;What I'm trying to accomplish is a "running bucket of selections" that can be accumulated during a session where you are selecting and deselecting multiples items. The running list can at some point then be used to select all of the chosen values at once.&lt;/P&gt;&lt;P&gt;Thanks for any suggestions,&lt;/P&gt;&lt;P&gt;-Jeff&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 25 Jan 2010 23:08:31 GMT</pubDate>
    <dc:creator>jlassell</dc:creator>
    <dc:date>2010-01-25T23:08:31Z</dc:date>
    <item>
      <title>Running Bucket of Selected Values</title>
      <link>https://community.qlik.com/t5/QlikView/Running-Bucket-of-Selected-Values/m-p/221861#M74618</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've been looking for a way to do the following on a QVW that has, say, a list box of Products and a chart showing those Products Sales over some time period:&lt;/P&gt;&lt;P&gt;- have a button that says "Add Selected Product to LIst" (ie. an array)&lt;/P&gt;&lt;P&gt;- have a button that says "Select all Products from List" (ie, force the array of vales into a selection for a list box)&lt;/P&gt;&lt;P&gt;- now I'd like to be able to:&lt;/P&gt;&lt;P&gt;1. select a Product from the List Box&lt;/P&gt;&lt;P&gt;2. click the "Add to List" button (putting the selected value in an array)&lt;/P&gt;&lt;P&gt;3. clear all selections&lt;/P&gt;&lt;P&gt;4. select another Product from the List Box&lt;/P&gt;&lt;P&gt;5. click the "Add to List" button. (now my behind the scenes array has 2 products in it.)&lt;/P&gt;&lt;P&gt;6. click the "Select all Products from List". (this would now show my 2 chosen products on my chart as if I had just selected both of them from my List Box.)&lt;/P&gt;&lt;P&gt;What I'm trying to accomplish is a "running bucket of selections" that can be accumulated during a session where you are selecting and deselecting multiples items. The running list can at some point then be used to select all of the chosen values at once.&lt;/P&gt;&lt;P&gt;Thanks for any suggestions,&lt;/P&gt;&lt;P&gt;-Jeff&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Jan 2010 23:08:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Running-Bucket-of-Selected-Values/m-p/221861#M74618</guid>
      <dc:creator>jlassell</dc:creator>
      <dc:date>2010-01-25T23:08:31Z</dc:date>
    </item>
    <item>
      <title>Running Bucket of Selected Values</title>
      <link>https://community.qlik.com/t5/QlikView/Running-Bucket-of-Selected-Values/m-p/221862#M74619</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You could use a QlikView variable to store your list. No need for an array, a comma separated list will work fine (I believe you can use the VB function split in VBScript, but haven't verified that). You would probably also want a variable set to GetFieldSelections(Field) to be used by your macro. Then:&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;Sub Add2List&lt;BR /&gt; oldList = ActiveDocument.Variables("vProdList").GetContent.String&lt;BR /&gt; newItems = ActiveDocument.Variables("vGetFieldSelections").GetContent.String&lt;BR /&gt; ActiveDocument.Variables("vProdList").SetContent oldList &amp;amp; "," &amp;amp; newItems, true&lt;BR /&gt;End Sub&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;I haven't tested any of that, but the logic should handle what you are looking for.&lt;/P&gt;&lt;P&gt;EDIT: I forgot the hard part. &lt;IMG alt="Big Smile" src="http://community.qlik.com/emoticons/emotion-2.gif" /&gt; Here is the sub to select your value list:&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;Sub Selector&lt;BR /&gt; valueList = ActiveDocument.Variables("vProdList").GetContent.String&lt;BR /&gt; valueAry = Split(valueList, ",")&lt;BR /&gt;&lt;BR /&gt; ActiveDocument.Fields("Customer").Select valueAry(0)&lt;BR /&gt; For i = 1 to UBound(valueAry)&lt;BR /&gt; ActiveDocument.Fields("Customer").ToggleSelect valueAry(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;You'll probably need some logic to make sure at least one value is selected (GetSelectedCount(FIELD)).&lt;/P&gt;&lt;P&gt;EDIT 2: GetFieldSelections uses a comma space. You can either change the SetContent in the first sub to ", " and the split to a ", " or do a trim on the valueAry array values. I'd probably do the latter and use:&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;ActiveDocument.Fields("Customer").Select Trim(valueAry(0))&lt;BR /&gt;...&lt;BR /&gt;ActiveDocument.Fields("Customer").ToggleSelect Trim(valueAry(i))&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Jan 2010 23:26:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Running-Bucket-of-Selected-Values/m-p/221862#M74619</guid>
      <dc:creator />
      <dc:date>2010-01-25T23:26:34Z</dc:date>
    </item>
  </channel>
</rss>

