<?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: Listbox selection order in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Listbox-selection-order/m-p/269755#M706589</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The data I'm using is confidential so I can't post the original.&amp;nbsp; Let me see if I can create a mockup example of it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 23 Feb 2012 13:36:56 GMT</pubDate>
    <dc:creator />
    <dc:date>2012-02-23T13:36:56Z</dc:date>
    <item>
      <title>Listbox selection order</title>
      <link>https://community.qlik.com/t5/QlikView/Listbox-selection-order/m-p/269749#M706583</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;Hi,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I currently have a macro that displays the selected values of a field in a listbox.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;set s = ActiveDocument.Fields("DrillField").GetSelectedValues&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;for i = 0 to s.Count-1&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;msgbox(s.Item(i).Text)&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;next &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;However, no matter the order I select the values in the list box, the array of selected values always comes back the same as the listbox's sort order.&amp;nbsp; Is there a way to retrieve the selected values of the field in the order that they were selected?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;James&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;﻿&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Feb 2012 20:24:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Listbox-selection-order/m-p/269749#M706583</guid>
      <dc:creator />
      <dc:date>2012-02-09T20:24:50Z</dc:date>
    </item>
    <item>
      <title>Re: Listbox selection order</title>
      <link>https://community.qlik.com/t5/QlikView/Listbox-selection-order/m-p/269750#M706584</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What I'm trying to do is the following:&amp;nbsp; I want to be able to dynamically drill a pivot by adding and removing dimensions.&amp;nbsp; But I need a way for the user to choose the dimension to breakdown the pivot by and the order of the dimensions.&amp;nbsp; To that end, I have a data island that lists the dimensions to drill into, the field name of the dimension and the drill order.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have the macro able to trigger when an option in the listbox is checked (using Windows checkmark box style).&amp;nbsp; The macro sets all unselected dimensions' drill order to 0 and then attempts to add 1 to the drill order of all selected fields.&amp;nbsp; The theory is that a selected field increments in the order of its selection.&amp;nbsp; So, the first field to be selected will always have the highest Drill Order.&amp;nbsp; The last, the lowest.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;sub DrillTo &lt;BR /&gt;' Set Drill Order of unselected fields to 0&lt;BR /&gt;set p = ActiveDocument.Fields("DrillField").GetAlternativeValues&lt;BR /&gt;for i = 0 to p.Count-1&lt;BR /&gt;set Result = ActiveDocument.DynamicUpdateCommand("UPDATE * SET DrillOrder = 0 WHERE DrillField='"&amp;amp;p.Item(i).Text&amp;amp;"'")&lt;BR /&gt;next&lt;BR /&gt;&lt;BR /&gt;' Increase Drill order for all selected fields&lt;BR /&gt;set s = ActiveDocument.Fields("DrillField").GetSelectedValues&lt;BR /&gt;for i = 0 to s.Count-1&lt;BR /&gt;MsgBox(s.Item(i).Text)&lt;BR /&gt;set Result = ActiveDocument.DynamicUpdateCommand("UPDATE * SET DrillOrder = DrillOrder + 1 WHERE DrillField='"&amp;amp;s.Item(i).Text&amp;amp;"'")&lt;BR /&gt;next&lt;BR /&gt;&lt;BR /&gt;' Get Selected values in Drill Order&lt;BR /&gt;' Add to Pivot using AddDimension()&lt;BR /&gt;end sub &lt;/P&gt;&lt;P&gt;&lt;A&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This really isn't working though.&amp;nbsp; The second DynamicUpdate doesn't seem to work becaue the listbox which is ordered by DrillOrder and is displaying the value of the field, does not change.&amp;nbsp; Can anyone tell me if there is a better way to do this?&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;﻿&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;﻿&lt;/SPAN&gt;Thank you.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;﻿&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;﻿&lt;/SPAN&gt;James&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Feb 2012 18:52:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Listbox-selection-order/m-p/269750#M706584</guid>
      <dc:creator />
      <dc:date>2012-02-15T18:52:37Z</dc:date>
    </item>
    <item>
      <title>Re: Listbox selection order</title>
      <link>https://community.qlik.com/t5/QlikView/Listbox-selection-order/m-p/269751#M706585</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi James,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; In macro the listbox dynamic selection always select the value based on the Load order of the listbox.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ashok&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Feb 2012 06:11:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Listbox-selection-order/m-p/269751#M706585</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-02-16T06:11:49Z</dc:date>
    </item>
    <item>
      <title>Re: Listbox selection order</title>
      <link>https://community.qlik.com/t5/QlikView/Listbox-selection-order/m-p/269752#M706586</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Thanks, Ashok.&amp;nbsp; That explains the order from the listbox.&amp;nbsp; Now, I need to figure out how to get the DynamicUpdate to work.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Feb 2012 13:50:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Listbox-selection-order/m-p/269752#M706586</guid>
      <dc:creator />
      <dc:date>2012-02-16T13:50:00Z</dc:date>
    </item>
    <item>
      <title>Re: Listbox selection order</title>
      <link>https://community.qlik.com/t5/QlikView/Listbox-selection-order/m-p/269753#M706587</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;After a lot of banging my head against a wall, my macro is working.&amp;nbsp; I have Qlikview dynamically drilling in a pivot so that the end user just needs to check and/or uncheck any dimensions in any order and the pivot will update to breakdown the numbers in the same order.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Feb 2012 20:30:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Listbox-selection-order/m-p/269753#M706587</guid>
      <dc:creator />
      <dc:date>2012-02-22T20:30:51Z</dc:date>
    </item>
    <item>
      <title>Listbox selection order</title>
      <link>https://community.qlik.com/t5/QlikView/Listbox-selection-order/m-p/269754#M706588</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That would be an interesting thing to see. Are you willing to post a sample?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Rob&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="http://robwunderlich.com"&gt;http://robwunderlich.com&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Feb 2012 21:56:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Listbox-selection-order/m-p/269754#M706588</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2012-02-22T21:56:52Z</dc:date>
    </item>
    <item>
      <title>Re: Listbox selection order</title>
      <link>https://community.qlik.com/t5/QlikView/Listbox-selection-order/m-p/269755#M706589</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The data I'm using is confidential so I can't post the original.&amp;nbsp; Let me see if I can create a mockup example of it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Feb 2012 13:36:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Listbox-selection-order/m-p/269755#M706589</guid>
      <dc:creator />
      <dc:date>2012-02-23T13:36:56Z</dc:date>
    </item>
    <item>
      <title>Listbox selection order</title>
      <link>https://community.qlik.com/t5/QlikView/Listbox-selection-order/m-p/269756#M706590</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I took the Film Example document and added my Drill table and macro to it.&amp;nbsp; Hopefully, it works for everyone.&amp;nbsp; There are lots of extras that could be added to it such as automatically adjusting the column width when a dimension is added or any other Dimension property that exists for that matter.&amp;nbsp; I would just add a column in the DrillPaths table to store that information and then just adjust the macro to apply it when loaded.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Of course, this currently only works on a single Pivot table but it could be expanded to work on any pivot table and any set of dimensions.&amp;nbsp; If anyone has any suggestions, on how to do this better, please let me know.&amp;nbsp; This was my first macro which was made for my first full project in Qlikview so go easy on me. &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/wink.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://myweb.dal.ca/jrozee/Films_DynamicDrill.qvw"&gt;http://myweb.dal.ca/jrozee/Films_DynamicDrill.qvw&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;James&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Feb 2012 14:34:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Listbox-selection-order/m-p/269756#M706590</guid>
      <dc:creator />
      <dc:date>2012-02-23T14:34:42Z</dc:date>
    </item>
    <item>
      <title>Listbox selection order</title>
      <link>https://community.qlik.com/t5/QlikView/Listbox-selection-order/m-p/269757#M706591</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;/P&gt;&lt;P&gt;Can you try like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Create a variable like and assign the selected values using the below expression&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=Concat(FieldName, ',')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now, you can get the variable value in macro and do the required.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;jagan.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Feb 2012 14:48:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Listbox-selection-order/m-p/269757#M706591</guid>
      <dc:creator>jagan</dc:creator>
      <dc:date>2012-02-23T14:48:20Z</dc:date>
    </item>
    <item>
      <title>Listbox selection order</title>
      <link>https://community.qlik.com/t5/QlikView/Listbox-selection-order/m-p/269758#M706592</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I decided to use an array of fields object which makes it easier to search for duplicates.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Feb 2012 14:59:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Listbox-selection-order/m-p/269758#M706592</guid>
      <dc:creator />
      <dc:date>2012-02-23T14:59:31Z</dc:date>
    </item>
    <item>
      <title>Listbox selection order</title>
      <link>https://community.qlik.com/t5/QlikView/Listbox-selection-order/m-p/269759#M706593</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;/P&gt;&lt;P&gt;There is no need to eliminate duplicates manually.&amp;nbsp; You can use&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=Concat(DISTINCT FieldName, ',')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Jagan.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Feb 2012 15:06:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Listbox-selection-order/m-p/269759#M706593</guid>
      <dc:creator>jagan</dc:creator>
      <dc:date>2012-02-23T15:06:19Z</dc:date>
    </item>
    <item>
      <title>Listbox selection order</title>
      <link>https://community.qlik.com/t5/QlikView/Listbox-selection-order/m-p/269760#M706594</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is there a way to remove a single value from the concatenated string?&amp;nbsp; Would you use something like a replace with an empty string?&amp;nbsp; That would certainly simplify the code.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Feb 2012 15:23:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Listbox-selection-order/m-p/269760#M706594</guid>
      <dc:creator />
      <dc:date>2012-02-23T15:23:01Z</dc:date>
    </item>
    <item>
      <title>Listbox selection order</title>
      <link>https://community.qlik.com/t5/QlikView/Listbox-selection-order/m-p/269761#M706595</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Interesting. I like it. You may want to turn off "Allow Pivoting" in the Presentation properties. If I drag a dimension and them make a selection I lose my dragged change.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Feb 2012 15:44:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Listbox-selection-order/m-p/269761#M706595</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2012-02-23T15:44:45Z</dc:date>
    </item>
    <item>
      <title>Listbox selection order</title>
      <link>https://community.qlik.com/t5/QlikView/Listbox-selection-order/m-p/269762#M706596</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Good point.&amp;nbsp; I'll disable that.&amp;nbsp; Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Feb 2012 15:50:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Listbox-selection-order/m-p/269762#M706596</guid>
      <dc:creator />
      <dc:date>2012-02-23T15:50:33Z</dc:date>
    </item>
  </channel>
</rss>

