<?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 on different column of straight table in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Sort-on-different-column-of-straight-table/m-p/761182#M471292</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a straight table attached, It shows top 5 stores by POS Sales desc ranking at default.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Be advised, the attached excel file is just way I want to show in straight table not the data I want to directly use.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Here is what I want, when end user clicks different column header, the table need show top 5 stores by the clicked header accordingly. &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;For instance, if POS Qty is clicked, the table shows stores ranked by POS QTY desc. NOT by POS Sales any more. therefore, it could be totally different store list there.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;the confusing part is to show each column data, I have entered expression for each of them, &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;How could I write additional expression and where I put? thanks.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 20 Mar 2015 22:34:30 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2015-03-20T22:34:30Z</dc:date>
    <item>
      <title>Sort on different column of straight table</title>
      <link>https://community.qlik.com/t5/QlikView/Sort-on-different-column-of-straight-table/m-p/761182#M471292</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a straight table attached, It shows top 5 stores by POS Sales desc ranking at default.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Be advised, the attached excel file is just way I want to show in straight table not the data I want to directly use.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Here is what I want, when end user clicks different column header, the table need show top 5 stores by the clicked header accordingly. &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;For instance, if POS Qty is clicked, the table shows stores ranked by POS QTY desc. NOT by POS Sales any more. therefore, it could be totally different store list there.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;the confusing part is to show each column data, I have entered expression for each of them, &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;How could I write additional expression and where I put? thanks.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Mar 2015 22:34:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sort-on-different-column-of-straight-table/m-p/761182#M471292</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-03-20T22:34:30Z</dc:date>
    </item>
    <item>
      <title>Re: Sort on different column of straight table</title>
      <link>https://community.qlik.com/t5/QlikView/Sort-on-different-column-of-straight-table/m-p/761183#M471293</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;See attached example.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 21 Mar 2015 08:18:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sort-on-different-column-of-straight-table/m-p/761183#M471293</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2015-03-21T08:18:54Z</dc:date>
    </item>
    <item>
      <title>Re: Sort on different column of straight table</title>
      <link>https://community.qlik.com/t5/QlikView/Sort-on-different-column-of-straight-table/m-p/761184#M471294</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, Gysbert, I am using personal edition, could not open your file. Do you mind telling me the way you do? thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 21 Mar 2015 11:35:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sort-on-different-column-of-straight-table/m-p/761184#M471294</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-03-21T11:35:52Z</dc:date>
    </item>
    <item>
      <title>Re: Sort on different column of straight table</title>
      <link>https://community.qlik.com/t5/QlikView/Sort-on-different-column-of-straight-table/m-p/761185#M471295</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG&gt;Option 1:&lt;/STRONG&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Set the &lt;STRONG&gt;Max Number&lt;/STRONG&gt; option on the &lt;STRONG&gt;Presentation&lt;/STRONG&gt; tab to 5. &lt;/LI&gt;&lt;LI&gt;Enable the option&lt;STRONG&gt; Allow Interactive Sort&lt;/STRONG&gt; on the &lt;STRONG&gt;Sort&lt;/STRONG&gt; tab.&lt;/LI&gt;&lt;LI&gt;Sort the table by double-clicking on the column header by which you want to sort the table&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Option 2:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Create seven variables&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;vColumn; with inital value 1, used to store the number of the column that should be sorted&lt;/LI&gt;&lt;LI&gt;vSortOrder; with inital value -1, used to store how to sort the colum: 1 for ascending, -1 for descending&lt;/LI&gt;&lt;LI&gt;eSales; sum([POS Sales])&lt;/LI&gt;&lt;LI&gt;eQty; sum([POS QTY])&lt;/LI&gt;&lt;LI&gt;eInventory; sum(Inventory)&lt;/LI&gt;&lt;LI&gt;eForecast; sum(Forecast)&lt;/LI&gt;&lt;LI&gt;eSortExpression: pick($(vColumn), $(eSales),$(eQty),$(eInventory),$(eForecast))&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Create a straight table with store# as dimension and five expressions:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;HiddenSortColumn: $(eSortExpression)&lt;/LI&gt;&lt;LI&gt;POS Sales: $(eSales)&lt;/LI&gt;&lt;LI&gt;POS QTY: $(eQty)&lt;/LI&gt;&lt;LI&gt;Inventory: $(eInventory)&lt;/LI&gt;&lt;LI&gt;Forecast: $(eForecast)&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;On the &lt;STRONG&gt;Dimension Limits&lt;/STRONG&gt; tab enable the option &lt;STRONG&gt;Restrict which values are displayed using the first expression&lt;/STRONG&gt;. Enable the &lt;STRONG&gt;Show Only&lt;/STRONG&gt; option en select &lt;STRONG&gt;Largest&lt;/STRONG&gt; and &lt;STRONG&gt;5 &lt;/STRONG&gt;as settings for this option. Disable the option &lt;STRONG&gt;Show Others&lt;/STRONG&gt;. The dimension limits are calculated based in the first expression. For this reason the first expression must be the &lt;STRONG&gt;HiddenSortColumn&lt;/STRONG&gt; expression &lt;STRONG&gt;$(eSortExpression)&lt;/STRONG&gt;. This expression picks an expression based on the value of the &lt;STRONG&gt;vColumn&lt;/STRONG&gt; variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;On the sort tab move the store# column to the top of the priority list and enable&lt;STRONG&gt; Sort by Expression&lt;/STRONG&gt; option for the store# column. Enter as expression: &lt;STRONG&gt;$(eSortExpression)*$(vSortOrder)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;On the Presentation tab select the &lt;STRONG&gt;HiddenSortColumn&lt;/STRONG&gt; column and enable the option &lt;STRONG&gt;Hide Column&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Create a new text box. On the &lt;STRONG&gt;Layout&lt;/STRONG&gt; tab of the properties window set the &lt;STRONG&gt;Layer&lt;/STRONG&gt; setting to &lt;STRONG&gt;Top&lt;/STRONG&gt;. Resize and position the text box so it fits exactly over the header cell of the &lt;STRONG&gt;POS Sales&lt;/STRONG&gt; column. Use the following expression for the &lt;STRONG&gt;Text&lt;/STRONG&gt; value of the text box: &lt;STRONG&gt;='POS Sales ' &amp;amp; if($(vColumn)=1, if($(vSortOrder)=-1, '▼' , '▲')).&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Add a Set Variable action to the text box on the &lt;STRONG&gt;Actions&lt;/STRONG&gt; tab. Use &lt;STRONG&gt;vColumn&lt;/STRONG&gt; as &lt;STRONG&gt;Variable&lt;/STRONG&gt; and &lt;STRONG&gt;1&lt;/STRONG&gt; as &lt;STRONG&gt;Value&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Add another Set Variable action to the text box. Enter &lt;STRONG&gt;vSortOrder&lt;/STRONG&gt; as Variable and use as &lt;STRONG&gt;Value&lt;/STRONG&gt; this expression: &lt;STRONG&gt;=if($(vColumn)=1,-1,1)*$(vSortOrder)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Create three more text boxes for the other three expression header cells by copying the one just created. Change the Set Variable actions of these text boxes so the correct column numbers are used.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 21 Mar 2015 18:15:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sort-on-different-column-of-straight-table/m-p/761185#M471295</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2015-03-21T18:15:06Z</dc:date>
    </item>
  </channel>
</rss>

