<?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: Fix the sort order in a straight table in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Fix-the-sort-order-in-a-straight-table/m-p/411077#M560746</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi sushil,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to sort the table on clicking a button.&lt;/P&gt;&lt;P&gt;It should sort based on a single expression written in the chart always.&lt;/P&gt;&lt;P&gt;How to achieve that?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I used the below macro&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;CODE class="jive-code"&gt;Sub SortChart&lt;BR /&gt; Set ch = ActiveDocument.GetSheetObject("CH01")&lt;BR /&gt; ch.SortBy 8 '' 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;BR /&gt;End Sub&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It works fine, but here i have given the sortby "8" th expression, but when i click the next button, it will hide first 10 expressions and shows the next 10 expressions. so that sort order changes for the 2nd "8" expression enabled.&lt;/P&gt;&lt;P&gt;But i want the sort to remain for the 1st "8th" expression in the table.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 02 Apr 2013 06:19:46 GMT</pubDate>
    <dc:creator />
    <dc:date>2013-04-02T06:19:46Z</dc:date>
    <item>
      <title>Fix the sort order in a straight table</title>
      <link>https://community.qlik.com/t5/QlikView/Fix-the-sort-order-in-a-straight-table/m-p/411075#M560741</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 have a straight table, which has so many expressions.&lt;/P&gt;&lt;P&gt;I want to sort the table always with one expression value.&lt;/P&gt;&lt;P&gt;How can i do that using macro or any other method?&lt;/P&gt;&lt;P&gt;i have prev and next button implemented. Clicking that some expressions will be shown and others will be hidden.&lt;/P&gt;&lt;P&gt;so i want to sort the table based on a single expression always, even if it is hidden also.&lt;/P&gt;&lt;P&gt;If a user has changed the sort by clicking some column, then click on next button should retain the sort order back to the previous sort order.&lt;/P&gt;&lt;P&gt;How can we do that?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Apr 2013 06:11:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Fix-the-sort-order-in-a-straight-table/m-p/411075#M560741</guid>
      <dc:creator />
      <dc:date>2013-04-02T06:11:10Z</dc:date>
    </item>
    <item>
      <title>Re: Fix the sort order in a straight table</title>
      <link>https://community.qlik.com/t5/QlikView/Fix-the-sort-order-in-a-straight-table/m-p/411076#M560744</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;have u tried this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1.goto sort tab&lt;/P&gt;&lt;P&gt;2. click on each dimension and expression and sort them by expression. put your expression in definition box...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if this will not work then please post your sample app and describe your issue in detail.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HTh&lt;/P&gt;&lt;P&gt;Sushil&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Apr 2013 06:14:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Fix-the-sort-order-in-a-straight-table/m-p/411076#M560744</guid>
      <dc:creator>sushil353</dc:creator>
      <dc:date>2013-04-02T06:14:03Z</dc:date>
    </item>
    <item>
      <title>Re: Fix the sort order in a straight table</title>
      <link>https://community.qlik.com/t5/QlikView/Fix-the-sort-order-in-a-straight-table/m-p/411077#M560746</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi sushil,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to sort the table on clicking a button.&lt;/P&gt;&lt;P&gt;It should sort based on a single expression written in the chart always.&lt;/P&gt;&lt;P&gt;How to achieve that?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I used the below macro&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;CODE class="jive-code"&gt;Sub SortChart&lt;BR /&gt; Set ch = ActiveDocument.GetSheetObject("CH01")&lt;BR /&gt; ch.SortBy 8 '' 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;BR /&gt;End Sub&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It works fine, but here i have given the sortby "8" th expression, but when i click the next button, it will hide first 10 expressions and shows the next 10 expressions. so that sort order changes for the 2nd "8" expression enabled.&lt;/P&gt;&lt;P&gt;But i want the sort to remain for the 1st "8th" expression in the table.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Apr 2013 06:19:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Fix-the-sort-order-in-a-straight-table/m-p/411077#M560746</guid>
      <dc:creator />
      <dc:date>2013-04-02T06:19:46Z</dc:date>
    </item>
    <item>
      <title>Re: Fix the sort order in a straight table</title>
      <link>https://community.qlik.com/t5/QlikView/Fix-the-sort-order-in-a-straight-table/m-p/411078#M560749</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; Why do you want to use the macro, when same can be done by what Sushil has suggested.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; The reason for not using macro is, they may and may not work on browser and can slow down your application if not used properly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Kaushik Solanki&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Apr 2013 06:25:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Fix-the-sort-order-in-a-straight-table/m-p/411078#M560749</guid>
      <dc:creator>kaushiknsolanki</dc:creator>
      <dc:date>2013-04-02T06:25:30Z</dc:date>
    </item>
    <item>
      <title>Re: Fix the sort order in a straight table</title>
      <link>https://community.qlik.com/t5/QlikView/Fix-the-sort-order-in-a-straight-table/m-p/411079#M560752</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;If it is mendetory to have button to sort your table. then try this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. create a variable: say--- vsort&lt;/P&gt;&lt;P&gt;2. in the sort tab for expression sort put some condition like: if(vsort=1,expression)&lt;/P&gt;&lt;P&gt;here expression is your expression on which you want to sort the table&lt;/P&gt;&lt;P&gt;3. creat a button and set the variable value 1 on click.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is better to avoid macros..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HTH&lt;/P&gt;&lt;P&gt;Sushil&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Apr 2013 06:32:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Fix-the-sort-order-in-a-straight-table/m-p/411079#M560752</guid>
      <dc:creator>sushil353</dc:creator>
      <dc:date>2013-04-02T06:32:18Z</dc:date>
    </item>
    <item>
      <title>Re: Fix the sort order in a straight table</title>
      <link>https://community.qlik.com/t5/QlikView/Fix-the-sort-order-in-a-straight-table/m-p/411080#M560753</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The problem is,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The user can sort the columns manually by double clicking columns.&lt;/P&gt;&lt;P&gt;Then the sort order will change, but i want the sort order should come back to previous state by clicking the "Next" button in my application qvw file.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Apr 2013 06:33:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Fix-the-sort-order-in-a-straight-table/m-p/411080#M560753</guid>
      <dc:creator />
      <dc:date>2013-04-02T06:33:01Z</dc:date>
    </item>
    <item>
      <title>Re: Fix the sort order in a straight table</title>
      <link>https://community.qlik.com/t5/QlikView/Fix-the-sort-order-in-a-straight-table/m-p/411081#M560754</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sushil,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried the method, it is not working in my file.&lt;/P&gt;&lt;P&gt;I change the sort order, by double clicking some other expression.&lt;/P&gt;&lt;P&gt;And i applied the sort expression for the dimension to sort in the table.&lt;/P&gt;&lt;P&gt;It is not sorting the dimension based on the expression value.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Apr 2013 06:40:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Fix-the-sort-order-in-a-straight-table/m-p/411081#M560754</guid>
      <dc:creator />
      <dc:date>2013-04-02T06:40:23Z</dc:date>
    </item>
    <item>
      <title>Re: Fix the sort order in a straight table</title>
      <link>https://community.qlik.com/t5/QlikView/Fix-the-sort-order-in-a-straight-table/m-p/411082#M560755</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please post the sample app.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Apr 2013 06:44:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Fix-the-sort-order-in-a-straight-table/m-p/411082#M560755</guid>
      <dc:creator>sushil353</dc:creator>
      <dc:date>2013-04-02T06:44:48Z</dc:date>
    </item>
    <item>
      <title>Re: Fix the sort order in a straight table</title>
      <link>https://community.qlik.com/t5/QlikView/Fix-the-sort-order-in-a-straight-table/m-p/411083#M560756</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It has the client data, so sorry i cannot post the file&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Apr 2013 06:45:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Fix-the-sort-order-in-a-straight-table/m-p/411083#M560756</guid>
      <dc:creator />
      <dc:date>2013-04-02T06:45:43Z</dc:date>
    </item>
    <item>
      <title>Re: Fix the sort order in a straight table</title>
      <link>https://community.qlik.com/t5/QlikView/Fix-the-sort-order-in-a-straight-table/m-p/411084#M560757</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you tell me how we can modify the above macro, so that we can achieve this on clicking the button.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Apr 2013 06:46:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Fix-the-sort-order-in-a-straight-table/m-p/411084#M560757</guid>
      <dc:creator />
      <dc:date>2013-04-02T06:46:47Z</dc:date>
    </item>
    <item>
      <title>Re: Fix the sort order in a straight table</title>
      <link>https://community.qlik.com/t5/QlikView/Fix-the-sort-order-in-a-straight-table/m-p/411085#M560758</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; If you dont want user to double click and change the sort then you do following setting.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Go to Sort tab -&amp;gt; Uncheck the "Allow interactive sort".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; This will not allow user to change the sort.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Kaushik Solanki&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Apr 2013 06:53:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Fix-the-sort-order-in-a-straight-table/m-p/411085#M560758</guid>
      <dc:creator>kaushiknsolanki</dc:creator>
      <dc:date>2013-04-02T06:53:15Z</dc:date>
    </item>
    <item>
      <title>Re: Fix the sort order in a straight table</title>
      <link>https://community.qlik.com/t5/QlikView/Fix-the-sort-order-in-a-straight-table/m-p/411086#M560759</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Problem with macro is: when it is activated it takes the current 8th expression from the chart...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;when you are hiding the expressions then it gives wrong sorting... &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the only trick which is coming to my mind is...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;lets say you are having exp1 on which you need to sort your table...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;take exp1 2 times in your table... now you will get two colomns with same expression that is exp1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now make the Text color white for one of the column and header lable a space.. so that one column should not be visible.. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now use that column no in your macro....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HTH&lt;/P&gt;&lt;P&gt;Sushil&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Apr 2013 06:54:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Fix-the-sort-order-in-a-straight-table/m-p/411086#M560759</guid>
      <dc:creator>sushil353</dc:creator>
      <dc:date>2013-04-02T06:54:32Z</dc:date>
    </item>
    <item>
      <title>Re: Fix the sort order in a straight table</title>
      <link>https://community.qlik.com/t5/QlikView/Fix-the-sort-order-in-a-straight-table/m-p/411087#M560760</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;But I have around 120 expressions in a table, it keeps changing on clicking the next button, &lt;/P&gt;&lt;P&gt;so i cannot use that expression multiple times in the table.&lt;/P&gt;&lt;P&gt;I want to restrict the sort to use only the 1st "8th" expression as the sort order,&lt;/P&gt;&lt;P&gt;but in the above macro, it changes for the current "8th" expression.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And client requirement is, they should be able to sort every column manually, so i cannot restrict them from sorting manually. but i want the sort to retain even if they sort it manually on clicking a button.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Apr 2013 06:59:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Fix-the-sort-order-in-a-straight-table/m-p/411087#M560760</guid>
      <dc:creator />
      <dc:date>2013-04-02T06:59:11Z</dc:date>
    </item>
    <item>
      <title>Re: Fix the sort order in a straight table</title>
      <link>https://community.qlik.com/t5/QlikView/Fix-the-sort-order-in-a-straight-table/m-p/411088#M560761</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Surya,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Make some dummy data and create a sample app...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;without seeing your application it is difficult to give exact solution...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HTh&lt;/P&gt;&lt;P&gt;Sushil&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Apr 2013 07:02:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Fix-the-sort-order-in-a-straight-table/m-p/411088#M560761</guid>
      <dc:creator>sushil353</dc:creator>
      <dc:date>2013-04-02T07:02:07Z</dc:date>
    </item>
    <item>
      <title>Re: Fix the sort order in a straight table</title>
      <link>https://community.qlik.com/t5/QlikView/Fix-the-sort-order-in-a-straight-table/m-p/411089#M560762</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sushil,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are so many combinations for getting the data.&lt;BR /&gt;To prepare data itself it will take time and we are working now for a deliverable today.&lt;/P&gt;&lt;P&gt;so not able to prepare sample data now.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Apr 2013 07:07:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Fix-the-sort-order-in-a-straight-table/m-p/411089#M560762</guid>
      <dc:creator />
      <dc:date>2013-04-02T07:07:34Z</dc:date>
    </item>
    <item>
      <title>Re: Fix the sort order in a straight table</title>
      <link>https://community.qlik.com/t5/QlikView/Fix-the-sort-order-in-a-straight-table/m-p/411090#M560763</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;any screenshots.. to explain your required functionality?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Apr 2013 07:08:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Fix-the-sort-order-in-a-straight-table/m-p/411090#M560763</guid>
      <dc:creator>sushil353</dc:creator>
      <dc:date>2013-04-02T07:08:44Z</dc:date>
    </item>
  </channel>
</rss>

