<?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: How to do primary and secondary sort in Straight table in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/How-to-do-primary-and-secondary-sort-in-Straight-table/m-p/2052190#M1223031</link>
    <description>&lt;P&gt;follow on, i did this obviously in QLik sense&lt;/P&gt;</description>
    <pubDate>Wed, 22 Mar 2023 18:25:14 GMT</pubDate>
    <dc:creator>edwin</dc:creator>
    <dc:date>2023-03-22T18:25:14Z</dc:date>
    <item>
      <title>How to do primary and secondary sort in Straight table</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-do-primary-and-secondary-sort-in-Straight-table/m-p/1966120#M1220361</link>
      <description>&lt;P&gt;I have 3 columns in straight table. Team, Date, Result. Need the Sorting that Result column as primary sort that only only Won, Lost should appear as first and Tie, No&amp;nbsp; Result should come second and Date column should be as secondary sort&amp;nbsp; where&amp;nbsp; old dates should comes at first as ascending.&amp;nbsp; below are my input n needed output. please help&lt;/P&gt;
&lt;P&gt;Input:&lt;/P&gt;
&lt;TABLE width="247px"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="87.6875px" height="25px"&gt;Team&lt;/TD&gt;
&lt;TD width="85.6875px" height="25px"&gt;Date&lt;/TD&gt;
&lt;TD width="72.625px" height="25px"&gt;Result&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="87.6875px" height="25px"&gt;IND&lt;/TD&gt;
&lt;TD width="85.6875px" height="25px"&gt;5/25/2022&lt;/TD&gt;
&lt;TD width="72.625px" height="25px"&gt;Lost&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="87.6875px" height="25px"&gt;CHI&lt;/TD&gt;
&lt;TD width="85.6875px" height="25px"&gt;5/15/2022&lt;/TD&gt;
&lt;TD width="72.625px" height="25px"&gt;Tie&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="87.6875px" height="25px"&gt;UK&lt;/TD&gt;
&lt;TD width="85.6875px" height="25px"&gt;4/22/2022&lt;/TD&gt;
&lt;TD width="72.625px" height="25px"&gt;Lost&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="87.6875px" height="25px"&gt;IND&lt;/TD&gt;
&lt;TD width="85.6875px" height="25px"&gt;4/31/2022&lt;/TD&gt;
&lt;TD width="72.625px" height="25px"&gt;Won&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="87.6875px" height="47px"&gt;UK&lt;/TD&gt;
&lt;TD width="85.6875px" height="47px"&gt;5/3/2022&lt;/TD&gt;
&lt;TD width="72.625px" height="47px"&gt;No Result&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="87.6875px" height="25px"&gt;USA&lt;/TD&gt;
&lt;TD width="85.6875px" height="25px"&gt;4/30/2022&lt;/TD&gt;
&lt;TD width="72.625px" height="25px"&gt;Tie&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="87.6875px" height="25px"&gt;CHI&lt;/TD&gt;
&lt;TD width="85.6875px" height="25px"&gt;5/31/2022&lt;/TD&gt;
&lt;TD width="72.625px" height="25px"&gt;Won&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="87.6875px" height="47px"&gt;USA&lt;/TD&gt;
&lt;TD width="85.6875px" height="47px"&gt;6/1/2022&lt;/TD&gt;
&lt;TD width="72.625px" height="47px"&gt;No Result&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="87.6875px" height="25px"&gt;UK&lt;/TD&gt;
&lt;TD width="85.6875px" height="25px"&gt;6/30/2022&lt;/TD&gt;
&lt;TD width="72.625px" height="25px"&gt;Lost&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;After Sort Output need as below :&lt;/P&gt;
&lt;TABLE style="border-collapse: collapse; width: 144pt;" border="0" width="192" cellspacing="0" cellpadding="0"&gt;
&lt;TBODY&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD width="64" height="20" class="xl65" style="height: 15.0pt; width: 48pt;"&gt;Team&lt;/TD&gt;
&lt;TD width="64" class="xl65" style="border-left: none; width: 48pt;"&gt;Date&lt;/TD&gt;
&lt;TD width="64" class="xl65" style="border-left: none; width: 48pt;"&gt;Result&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD width="64" height="20" class="xl66" style="height: 15.0pt; border-top: none; width: 48pt;"&gt;UK&lt;/TD&gt;
&lt;TD width="64" class="xl67" style="border-top: none; border-left: none; width: 48pt;"&gt;4/22/2022&lt;/TD&gt;
&lt;TD width="64" class="xl66" style="border-top: none; border-left: none; width: 48pt;"&gt;Lost&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD width="64" height="20" class="xl66" style="height: 15.0pt; border-top: none; width: 48pt;"&gt;IND&lt;/TD&gt;
&lt;TD width="64" class="xl67" style="border-top: none; border-left: none; width: 48pt;"&gt;4/31/2022&lt;/TD&gt;
&lt;TD width="64" class="xl66" style="border-top: none; border-left: none; width: 48pt;"&gt;Won&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD width="64" height="20" class="xl66" style="height: 15.0pt; border-top: none; width: 48pt;"&gt;IND&lt;/TD&gt;
&lt;TD width="64" class="xl67" style="border-top: none; border-left: none; width: 48pt;"&gt;5/25/2022&lt;/TD&gt;
&lt;TD width="64" class="xl66" style="border-top: none; border-left: none; width: 48pt;"&gt;Lost&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD width="64" height="20" class="xl66" style="height: 15.0pt; border-top: none; width: 48pt;"&gt;CHI&lt;/TD&gt;
&lt;TD width="64" class="xl67" style="border-top: none; border-left: none; width: 48pt;"&gt;5/31/2022&lt;/TD&gt;
&lt;TD width="64" class="xl66" style="border-top: none; border-left: none; width: 48pt;"&gt;Won&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD width="64" height="20" class="xl66" style="height: 15.0pt; border-top: none; width: 48pt;"&gt;UK&lt;/TD&gt;
&lt;TD width="64" class="xl67" style="border-top: none; border-left: none; width: 48pt;"&gt;6/30/2022&lt;/TD&gt;
&lt;TD width="64" class="xl66" style="border-top: none; border-left: none; width: 48pt;"&gt;Lost&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD width="64" height="20" class="xl66" style="height: 15.0pt; border-top: none; width: 48pt;"&gt;USA&lt;/TD&gt;
&lt;TD width="64" class="xl67" style="border-top: none; border-left: none; width: 48pt;"&gt;4/30/2022&lt;/TD&gt;
&lt;TD width="64" class="xl66" style="border-top: none; border-left: none; width: 48pt;"&gt;Tie&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD width="64" height="20" class="xl66" style="height: 15.0pt; border-top: none; width: 48pt;"&gt;UK&lt;/TD&gt;
&lt;TD width="64" class="xl67" style="border-top: none; border-left: none; width: 48pt;"&gt;5/3/2022&lt;/TD&gt;
&lt;TD width="64" class="xl66" style="border-top: none; border-left: none; width: 48pt;"&gt;No Result&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD width="64" height="20" class="xl66" style="height: 15.0pt; border-top: none; width: 48pt;"&gt;CHI&lt;/TD&gt;
&lt;TD width="64" class="xl67" style="border-top: none; border-left: none; width: 48pt;"&gt;5/15/2022&lt;/TD&gt;
&lt;TD width="64" class="xl66" style="border-top: none; border-left: none; width: 48pt;"&gt;Tie&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD width="64" height="20" class="xl66" style="height: 15.0pt; border-top: none; width: 48pt;"&gt;USA&lt;/TD&gt;
&lt;TD width="64" class="xl67" style="border-top: none; border-left: none; width: 48pt;"&gt;6/1/2022&lt;/TD&gt;
&lt;TD width="64" class="xl66" style="border-top: none; border-left: none; width: 48pt;"&gt;No Result&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please help.&lt;/P&gt;</description>
      <pubDate>Mon, 08 Aug 2022 18:14:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-do-primary-and-secondary-sort-in-Straight-table/m-p/1966120#M1220361</guid>
      <dc:creator>sharu055</dc:creator>
      <dc:date>2022-08-08T18:14:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to do primary and secondary sort in Straight table</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-do-primary-and-secondary-sort-in-Straight-table/m-p/1966233#M1220364</link>
      <description>&lt;P&gt;Looking for the same issue. Bumped into your thread. Thanks for creating it. Looking forward for solution.&amp;nbsp;&lt;A href="https://www.crediblebh.online/" target="_self"&gt;CredibleBH Employee Login&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Aug 2022 05:06:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-do-primary-and-secondary-sort-in-Straight-table/m-p/1966233#M1220364</guid>
      <dc:creator>31520Samuel</dc:creator>
      <dc:date>2022-08-09T05:06:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to do primary and secondary sort in Straight table</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-do-primary-and-secondary-sort-in-Straight-table/m-p/2052189#M1223030</link>
      <description>&lt;P&gt;you would normally use a sort by expression.&amp;nbsp; most that i have seen have sort weight associated to individual values (Won before lost, etc..).&amp;nbsp; however, yours is sorted by a grouping of values and i noticed that Qlik Sense sorts the group and then sorts the individual Values.&amp;nbsp; so the order becomes Lost, Lost, Lost, Won, Won,...&lt;BR /&gt;&lt;BR /&gt;the result order is correct but the date order was amiss.&amp;nbsp; what i had to do was bias the date as well:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="edwin_0-1679509225554.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/103308i22409BBCCBCF8477/image-size/medium?v=v2&amp;amp;px=400" role="button" title="edwin_0-1679509225554.png" alt="edwin_0-1679509225554.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;notice I ordered it by date first so as to overcome the sorting by values of Result, then i added this as the sort expression for Date:&lt;BR /&gt;&lt;BR /&gt;=if(Result='Lost' or Result='Won',1,2)*10000000 + num(Date)&lt;BR /&gt;&lt;BR /&gt;i didnt even need to sort by Result as that was baked into the sort expression for Date.&lt;BR /&gt;you can of course play around with the same idea until you get to an acceptable solution&lt;/P&gt;</description>
      <pubDate>Wed, 22 Mar 2023 18:24:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-do-primary-and-secondary-sort-in-Straight-table/m-p/2052189#M1223030</guid>
      <dc:creator>edwin</dc:creator>
      <dc:date>2023-03-22T18:24:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to do primary and secondary sort in Straight table</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-do-primary-and-secondary-sort-in-Straight-table/m-p/2052190#M1223031</link>
      <description>&lt;P&gt;follow on, i did this obviously in QLik sense&lt;/P&gt;</description>
      <pubDate>Wed, 22 Mar 2023 18:25:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-do-primary-and-secondary-sort-in-Straight-table/m-p/2052190#M1223031</guid>
      <dc:creator>edwin</dc:creator>
      <dc:date>2023-03-22T18:25:14Z</dc:date>
    </item>
  </channel>
</rss>

