<?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 Sort individual field in straight table by descending order using macro in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Sort-individual-field-in-straight-table-by-descending-order/m-p/346591#M705537</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;i want to sort individual field separately as descending order by using macros (VBScript)&lt;/P&gt;&lt;P&gt;how i can do that?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 11 Apr 2012 10:21:18 GMT</pubDate>
    <dc:creator>udaya_kumar</dc:creator>
    <dc:date>2012-04-11T10:21:18Z</dc:date>
    <item>
      <title>Sort individual field in straight table by descending order using macro</title>
      <link>https://community.qlik.com/t5/QlikView/Sort-individual-field-in-straight-table-by-descending-order/m-p/346591#M705537</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;i want to sort individual field separately as descending order by using macros (VBScript)&lt;/P&gt;&lt;P&gt;how i can do that?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Apr 2012 10:21:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sort-individual-field-in-straight-table-by-descending-order/m-p/346591#M705537</guid>
      <dc:creator>udaya_kumar</dc:creator>
      <dc:date>2012-04-11T10:21:18Z</dc:date>
    </item>
    <item>
      <title>Re: Sort individual field in straight table by descending order using macro</title>
      <link>https://community.qlik.com/t5/QlikView/Sort-individual-field-in-straight-table-by-descending-order/m-p/346592#M705538</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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Please see the attached file and you can change the qv file based on your requirement &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Hope this will helpful for&amp;nbsp; your problem&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&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>Wed, 11 Apr 2012 10:23:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sort-individual-field-in-straight-table-by-descending-order/m-p/346592#M705538</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-04-11T10:23:13Z</dc:date>
    </item>
    <item>
      <title>Sort individual field in straight table by descending order using macro</title>
      <link>https://community.qlik.com/t5/QlikView/Sort-individual-field-in-straight-table-by-descending-order/m-p/346593#M705539</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;Check &lt;A _jive_internal="true" href="https://community.qlik.com/thread/15910"&gt;this thread&lt;/A&gt; and the file attached to see a working example on a macro to sort in a chart.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Miguel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Apr 2012 10:26:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sort-individual-field-in-straight-table-by-descending-order/m-p/346593#M705539</guid>
      <dc:creator>Miguel_Angel_Baeyens</dc:creator>
      <dc:date>2012-04-11T10:26:51Z</dc:date>
    </item>
    <item>
      <title>Sort individual field in straight table by descending order using macro</title>
      <link>https://community.qlik.com/t5/QlikView/Sort-individual-field-in-straight-table-by-descending-order/m-p/346594#M705540</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Miguel and chand,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks for the reply,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i need to sort the expression field by descending order in the straight table, not the dimensions.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Apr 2012 10:36:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sort-individual-field-in-straight-table-by-descending-order/m-p/346594#M705540</guid>
      <dc:creator>udaya_kumar</dc:creator>
      <dc:date>2012-04-11T10:36:24Z</dc:date>
    </item>
    <item>
      <title>Re: Sort individual field in straight table by descending order using macro</title>
      <link>https://community.qlik.com/t5/QlikView/Sort-individual-field-in-straight-table-by-descending-order/m-p/346595#M705541</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 may be some misunderstanding here. Expressions are results, not values, and cannot be sorted. What you do can do is sort a dimension using an expression, so, for example, in a chart that displays all your customers and their corresponding current year sales, you can sort the dimension Customer by the Sum(Amount) of sales ascending or descending, although you double click on the expression to sort.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Add the following code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;Sub SortChart&lt;/P&gt;&lt;P&gt; Set ch = ActiveDocument.GetSheetObject("CH01")&lt;BR /&gt; ch.SortBy 1 '' this line specifies the expression to sort by&lt;BR /&gt; &lt;BR /&gt; Set p = ch.GetProperties&lt;BR /&gt; Set dims = p.Dimensions&lt;BR /&gt; '' Dimensions start by 0&lt;BR /&gt; '' 0 = Disable sort&lt;BR /&gt; '' 1 = Sort ascending&lt;BR /&gt; '' -1 = Sort descending&lt;BR /&gt; i = dims.Item(0).SortCriteria.SortByNumeric&lt;BR /&gt; If i = 1 Then&lt;BR /&gt;&amp;nbsp; dims.Item(0).SortCriteria.SortByNumeric = -1&lt;BR /&gt; Else&lt;BR /&gt;&amp;nbsp; dims.Item(0).SortCriteria.SortByNumeric = 1&lt;BR /&gt; End If&lt;BR /&gt; ch.SetProperties p&lt;/P&gt;&lt;P&gt;End Sub&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;1 will refer to the first expression, 2 to the second and so on.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Miguel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Apr 2012 11:00:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sort-individual-field-in-straight-table-by-descending-order/m-p/346595#M705541</guid>
      <dc:creator>Miguel_Angel_Baeyens</dc:creator>
      <dc:date>2012-04-11T11:00:53Z</dc:date>
    </item>
    <item>
      <title>Re: Sort individual field in straight table by descending order using macro</title>
      <link>https://community.qlik.com/t5/QlikView/Sort-individual-field-in-straight-table-by-descending-order/m-p/346596#M705542</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Hi Miguel and Chand,&lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;Dimension is getting sorted based on the expression value. But it is toggling between ascending order and descending order. I want to set it to descending order only. Can it be done ??&lt;SPAN style="font-size: 8pt;"&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="font-size: 12pt;"&gt;I m using this macro&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #993300; font-size: 12pt;"&gt;Sub SortChart&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #993300; font-size: 12pt;"&gt; Set ch = ActiveDocument.GetSheetObject("CH05")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #993300; font-size: 12pt;"&gt; ch.SortBy 1&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #993300; font-size: 12pt;"&gt; Set ch = ActiveDocument.GetSheetObject("CH15")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #993300; font-size: 12pt;"&gt; ch.SortBy 1&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #993300; font-size: 12pt;"&gt; Set p = ch.GetProperties&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #993300; font-size: 12pt;"&gt; Set dims = p.Dimensions&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #993300; font-size: 12pt;"&gt; i = dims.Item(0).SortCriteria.SortByNumeric= -1&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #993300; font-size: 12pt;"&gt; ch.SetProperties p&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #993300; font-size: 12pt;"&gt; End Sub &lt;/SPAN&gt;&lt;/DIV&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Apr 2012 12:06:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sort-individual-field-in-straight-table-by-descending-order/m-p/346596#M705542</guid>
      <dc:creator />
      <dc:date>2012-04-11T12:06:58Z</dc:date>
    </item>
    <item>
      <title>Re: Sort individual field in straight table by descending order using macro</title>
      <link>https://community.qlik.com/t5/QlikView/Sort-individual-field-in-straight-table-by-descending-order/m-p/346597#M705543</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;You are using two charts to sort by but the dimension is only in one of them. Something seems to be wrong there, or at least make little sense, since the "dims" variable stores the dimension of the CH15 chart, and not the CH05. Maybe is that driving the macro interpreter crazy?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Miguel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Apr 2012 13:18:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sort-individual-field-in-straight-table-by-descending-order/m-p/346597#M705543</guid>
      <dc:creator>Miguel_Angel_Baeyens</dc:creator>
      <dc:date>2012-04-11T13:18:55Z</dc:date>
    </item>
  </channel>
</rss>

