<?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: Sorting by with two levels in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Sorting-by-with-two-levels/m-p/860414#M1005760</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You need to sort the age in Descending order.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;MemPolicy_Child:&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;LOAD&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp; JOIN_MEM_NO,&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp; If(Main_MEM_NO_TEMP &amp;lt;&amp;gt; Previous(Main_MEM_NO_TEMP), 1,&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp; NumSum(peek(Counter) + 1)) as Counter&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;RESIDENT MemPolicy_Temp&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;ORDER BY Main_MEM_NO_TEMP,RENEWAL_AGE &lt;STRONG style="color: #ff0000;"&gt;desc&lt;/STRONG&gt;;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Assuming RENEWAL_AGE is the Age in your below table.&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;HTH&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Best,&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Sunny&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 14 May 2015 11:07:35 GMT</pubDate>
    <dc:creator>sunny_talwar</dc:creator>
    <dc:date>2015-05-14T11:07:35Z</dc:date>
    <item>
      <title>Sorting by with two levels</title>
      <link>https://community.qlik.com/t5/QlikView/Sorting-by-with-two-levels/m-p/860408#M1005754</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;Hi,&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;In the Load script on Qlikview, I'm wondering how I can sort by two criteria, so it'd sort by a number first but if the number is the same, it'd order by age. I've been trying to use ORDER BY Main_MEM_NO_TEMP,RENEWAL_AGE; (those are the two variables I want to sort by), but that doesn't seem to be working. Anyone have any ideas&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;Code I have is&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;MemPolicy_Temp:&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;LOAD&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&amp;nbsp; JOIN_MEM_NO,&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&amp;nbsp; JOIN_MEM_NO as JOIN_MEM_NO_TEMP,&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&amp;nbsp; Main_MEM_NO as Main_MEM_NO_TEMP,&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&amp;nbsp; RENEWAL_AGE&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;RESIDENT MemPolicy&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;where mixmatch(ASC_RENEWAL,'Child',ASC_RENEWAL = 'Student')&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;order by Main_MEM_NO, RENEWAL_AGE&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;MemPolicy_Child:&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;LOAD&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&amp;nbsp; JOIN_MEM_NO,&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&amp;nbsp; If(Main_MEM_NO_TEMP &amp;lt;&amp;gt; Previous(Main_MEM_NO_TEMP), 1,&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&amp;nbsp; NumSum(peek(Counter) + 1)) as Counter&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;RESIDENT MemPolicy_Temp&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;ORDER BY Main_MEM_NO_TEMP,RENEWAL_AGE;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;So, it should have a counter of 1 for the oldest child, and a counter of 2 for the next oldest. However, it's placing the counter on the one with the first membership number&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 May 2015 10:43:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sorting-by-with-two-levels/m-p/860408#M1005754</guid>
      <dc:creator />
      <dc:date>2015-05-14T10:43:09Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting by with two levels</title>
      <link>https://community.qlik.com/t5/QlikView/Sorting-by-with-two-levels/m-p/860409#M1005755</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So the script isn't adding counters to all the children? It is just adding 1 for the oldest child? Is that what the issue is?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sunny&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 May 2015 10:55:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sorting-by-with-two-levels/m-p/860409#M1005755</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2015-05-14T10:55:58Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting by with two levels</title>
      <link>https://community.qlik.com/t5/QlikView/Sorting-by-with-two-levels/m-p/860410#M1005756</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;do you have an example of your data please?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 May 2015 10:57:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sorting-by-with-two-levels/m-p/860410#M1005756</guid>
      <dc:creator>john_s_w_wood</dc:creator>
      <dc:date>2015-05-14T10:57:23Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting by with two levels</title>
      <link>https://community.qlik.com/t5/QlikView/Sorting-by-with-two-levels/m-p/860411#M1005757</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Nope, it adds counters to all the children, but it adds it based on highest member number instead of oldest child. So, the if a member ends in 2 and is a child, it'll get assigned 1 over a child that ends in 3 even if the one that ends in 3 is the older child.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 May 2015 10:59:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sorting-by-with-two-levels/m-p/860411#M1005757</guid>
      <dc:creator />
      <dc:date>2015-05-14T10:59:27Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting by with two levels</title>
      <link>https://community.qlik.com/t5/QlikView/Sorting-by-with-two-levels/m-p/860412#M1005758</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am not completely sure if I understand your data, but to check if the order by is working or not, why don't you add &lt;STRONG&gt;RowNo() as S.No.&lt;/STRONG&gt; to your &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13.3333330154419px;"&gt;&lt;STRONG&gt;MemPolicy_Child &lt;/STRONG&gt;table and see what order it is sorting everything. This might help you to figure out what you need to do in order to fix the ordering. Else please share a sample.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;Sunny&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 May 2015 11:03:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sorting-by-with-two-levels/m-p/860412#M1005758</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2015-05-14T11:03:03Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting by with two levels</title>
      <link>https://community.qlik.com/t5/QlikView/Sorting-by-with-two-levels/m-p/860413#M1005759</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;TABLE border="1" class="jiveBorder" style="border: 1px solid rgb(0, 0, 0); width: 100%;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Main Member&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Member&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Age&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Allocated Child Counter&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Correct Counter&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;&lt;SPAN style="color: #1f497d; font-family: Calibri, sans-serif; font-size: 14.6666669845581px;"&gt;4006720100&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Calibri','sans-serif'; color: #1f497d;"&gt;4006720105&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;16&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;2&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;&lt;SPAN style="color: #1f497d; font-family: Calibri, sans-serif; font-size: 14.6666669845581px;"&gt;4006720100&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Calibri','sans-serif'; color: #1f497d;"&gt;4006720103&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;15&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That would be an example of data. I'd like it to first sort by main member and then sort by age, but it seems to be sorting by main member and then member instead.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 May 2015 11:03:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sorting-by-with-two-levels/m-p/860413#M1005759</guid>
      <dc:creator />
      <dc:date>2015-05-14T11:03:31Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting by with two levels</title>
      <link>https://community.qlik.com/t5/QlikView/Sorting-by-with-two-levels/m-p/860414#M1005760</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You need to sort the age in Descending order.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;MemPolicy_Child:&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;LOAD&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp; JOIN_MEM_NO,&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp; If(Main_MEM_NO_TEMP &amp;lt;&amp;gt; Previous(Main_MEM_NO_TEMP), 1,&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp; NumSum(peek(Counter) + 1)) as Counter&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;RESIDENT MemPolicy_Temp&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;ORDER BY Main_MEM_NO_TEMP,RENEWAL_AGE &lt;STRONG style="color: #ff0000;"&gt;desc&lt;/STRONG&gt;;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Assuming RENEWAL_AGE is the Age in your below table.&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;HTH&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Best,&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Sunny&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 May 2015 11:07:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sorting-by-with-two-levels/m-p/860414#M1005760</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2015-05-14T11:07:35Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting by with two levels</title>
      <link>https://community.qlik.com/t5/QlikView/Sorting-by-with-two-levels/m-p/860415#M1005761</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you. Feel like and idiot that it was that small, but thank you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 May 2015 12:07:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sorting-by-with-two-levels/m-p/860415#M1005761</guid>
      <dc:creator />
      <dc:date>2015-05-14T12:07:20Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting by with two levels</title>
      <link>https://community.qlik.com/t5/QlikView/Sorting-by-with-two-levels/m-p/860416#M1005762</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No problem. We all make these small errors. But I am glad your were able to fix it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;Sunny&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 May 2015 12:09:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sorting-by-with-two-levels/m-p/860416#M1005762</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2015-05-14T12:09:19Z</dc:date>
    </item>
  </channel>
</rss>

