<?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: Sort by Expression does not work as expected in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Sort-by-Expression-does-not-work-as-expected/m-p/1052585#M353149</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What is the expectation for the sort when two years are selected? How would you like it to sort?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 01 May 2016 12:42:36 GMT</pubDate>
    <dc:creator>sunny_talwar</dc:creator>
    <dc:date>2016-05-01T12:42:36Z</dc:date>
    <item>
      <title>Sort by Expression does not work as expected</title>
      <link>https://community.qlik.com/t5/QlikView/Sort-by-Expression-does-not-work-as-expected/m-p/1052582#M353146</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="text-align: left;"&gt;Dear all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="text-align: left;"&gt;I would appreciate your assistance in figuring the sort issue I have in the attached demo.&lt;/P&gt;&lt;P style="text-align: left;"&gt;The request is to show a chart based on day/month display of a sale date.&lt;/P&gt;&lt;P style="text-align: left;"&gt;Please note, that sales dates cross 2 years. In such a case, December should be before January.&lt;/P&gt;&lt;P style="text-align: left;"&gt;I added a key to enforce the desired sort. In the&amp;nbsp; straight table on the right, the expected display is achieved.&lt;/P&gt;&lt;P style="text-align: left;"&gt;In the line chart, I defined a sort expression with the key, but the sort is not as expected:&lt;/P&gt;&lt;P style="text-align: left;"&gt;January is displayed before December.&lt;/P&gt;&lt;P style="text-align: left;"&gt;Attached is an example.&lt;/P&gt;&lt;P style="text-align: left;"&gt;Does anyone have a tip?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="text-align: left;"&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Sort.png" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/123213_Sort.png" style="height: 284px; width: 620px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 01 May 2016 07:21:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sort-by-Expression-does-not-work-as-expected/m-p/1052582#M353146</guid>
      <dc:creator>dafnis14</dc:creator>
      <dc:date>2016-05-01T07:21:53Z</dc:date>
    </item>
    <item>
      <title>Re: Sort by Expression does not work as expected</title>
      <link>https://community.qlik.com/t5/QlikView/Sort-by-Expression-does-not-work-as-expected/m-p/1052583#M353147</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 a look at attached document.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;ASHFAQ&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 01 May 2016 08:03:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sort-by-Expression-does-not-work-as-expected/m-p/1052583#M353147</guid>
      <dc:creator>ashfaq_haseeb</dc:creator>
      <dc:date>2016-05-01T08:03:26Z</dc:date>
    </item>
    <item>
      <title>Re: Sort by Expression does not work as expected</title>
      <link>https://community.qlik.com/t5/QlikView/Sort-by-Expression-does-not-work-as-expected/m-p/1052584#M353148</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ashfaq,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your prompt reply!&lt;/P&gt;&lt;P&gt;it works nice when only one year is selected.&lt;/P&gt;&lt;P&gt;But selecting 2 years, for example, disrupts the sort.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do you have any remedy for that too?..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 01 May 2016 08:49:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sort-by-Expression-does-not-work-as-expected/m-p/1052584#M353148</guid>
      <dc:creator>dafnis14</dc:creator>
      <dc:date>2016-05-01T08:49:06Z</dc:date>
    </item>
    <item>
      <title>Re: Sort by Expression does not work as expected</title>
      <link>https://community.qlik.com/t5/QlikView/Sort-by-Expression-does-not-work-as-expected/m-p/1052585#M353149</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What is the expectation for the sort when two years are selected? How would you like it to sort?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 01 May 2016 12:42:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sort-by-Expression-does-not-work-as-expected/m-p/1052585#M353149</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-05-01T12:42:36Z</dc:date>
    </item>
    <item>
      <title>Re: Sort by Expression does not work as expected</title>
      <link>https://community.qlik.com/t5/QlikView/Sort-by-Expression-does-not-work-as-expected/m-p/1052586#M353150</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sunny,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to have the sort in a chronological order. But as you can see, it's not.&lt;/P&gt;&lt;P&gt;I guess the issue is caused by a service year having sales in 2 different years. For example:&lt;/P&gt;&lt;P&gt;2015 have sales starting in November 2014, and going in 2015.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for willing to help!&lt;/P&gt;&lt;P&gt;&lt;IMG alt="sort_2.png" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/123214_sort_2.png" style="height: 446px; width: 620px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 01 May 2016 17:04:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sort-by-Expression-does-not-work-as-expected/m-p/1052586#M353150</guid>
      <dc:creator>dafnis14</dc:creator>
      <dc:date>2016-05-01T17:04:29Z</dc:date>
    </item>
    <item>
      <title>Re: Sort by Expression does not work as expected</title>
      <link>https://community.qlik.com/t5/QlikView/Sort-by-Expression-does-not-work-as-expected/m-p/1052587#M353151</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you check now?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 01 May 2016 17:20:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sort-by-Expression-does-not-work-as-expected/m-p/1052587#M353151</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-05-01T17:20:09Z</dc:date>
    </item>
    <item>
      <title>Re: Sort by Expression does not work as expected</title>
      <link>https://community.qlik.com/t5/QlikView/Sort-by-Expression-does-not-work-as-expected/m-p/1052588#M353152</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not sure what the exact reason is for this behavior. But you can solve it in a simple way by - in your load script - creating a mapping table that stores the date of the first calendar day of every Service year, and - while loading the data - calculate the Service year day number by subtracting from the row date the starting date of the Service year of that particular row. Use that Service year day number as sorting field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Peter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 01 May 2016 17:30:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sort-by-Expression-does-not-work-as-expected/m-p/1052588#M353152</guid>
      <dc:creator>Peter_Cammaert</dc:creator>
      <dc:date>2016-05-01T17:30:16Z</dc:date>
    </item>
    <item>
      <title>Re: Sort by Expression does not work as expected</title>
      <link>https://community.qlik.com/t5/QlikView/Sort-by-Expression-does-not-work-as-expected/m-p/1052589#M353153</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sunny,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can see the expected sort in the straight table:&lt;/P&gt;&lt;P&gt;&lt;IMG alt="sort_3.png" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/123224_sort_3.png" style="height: 192px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 01 May 2016 17:31:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sort-by-Expression-does-not-work-as-expected/m-p/1052589#M353153</guid>
      <dc:creator>dafnis14</dc:creator>
      <dc:date>2016-05-01T17:31:12Z</dc:date>
    </item>
    <item>
      <title>Re: Sort by Expression does not work as expected</title>
      <link>https://community.qlik.com/t5/QlikView/Sort-by-Expression-does-not-work-as-expected/m-p/1052590#M353154</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Peter,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I agree with your input.&lt;/P&gt;&lt;P&gt;I also thought of treating every service month like a specific event", which might fall on different period in different years. That's because this is what the user would select (a month). So when selecting service month,&amp;nbsp; he would see all sales dates in the format dd/mm.&lt;/P&gt;&lt;P&gt;The issue here is that we have 2 types of periods: Service &amp;amp; sales which are not matching.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 01 May 2016 17:39:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sort-by-Expression-does-not-work-as-expected/m-p/1052590#M353154</guid>
      <dc:creator>dafnis14</dc:creator>
      <dc:date>2016-05-01T17:39:46Z</dc:date>
    </item>
    <item>
      <title>Re: Sort by Expression does not work as expected</title>
      <link>https://community.qlik.com/t5/QlikView/Sort-by-Expression-does-not-work-as-expected/m-p/1052591#M353155</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am still having difficulty understanding what is the sort order needed. Can you may be share an example of one selection with the expected sort and one example of two selection in year field with the expected output&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 01 May 2016 17:43:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sort-by-Expression-does-not-work-as-expected/m-p/1052591#M353155</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-05-01T17:43:25Z</dc:date>
    </item>
    <item>
      <title>Re: Sort by Expression does not work as expected</title>
      <link>https://community.qlik.com/t5/QlikView/Sort-by-Expression-does-not-work-as-expected/m-p/1052592#M353156</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In a QlikView document, you can either display the two calendars but switch the selection instruments from one calendar to another (by way of a button or something) or display the selection boxes for both calendars at the same time. The latter not being very intuitive IMHO. The charts and tables should react to both the selections and their (possibly changed) environment in the best predictable way.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The issues you face are comparable to those present in financial QlikView documents which display both a financial year that is offset in a particular way from a calendar year. There are many examples and discussions about this in the community. A search may provide inspiration.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Peter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 01 May 2016 18:33:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sort-by-Expression-does-not-work-as-expected/m-p/1052592#M353156</guid>
      <dc:creator>Peter_Cammaert</dc:creator>
      <dc:date>2016-05-01T18:33:58Z</dc:date>
    </item>
    <item>
      <title>Re: Sort by Expression does not work as expected</title>
      <link>https://community.qlik.com/t5/QlikView/Sort-by-Expression-does-not-work-as-expected/m-p/1052593#M353157</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Peter,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the additional tips. In the document, I implement 2 calendars (2X2) for each period.&lt;/P&gt;&lt;P&gt;But for a report, I need to add the the sort field in order to enable comparison of a service month in different years.&lt;/P&gt;&lt;P&gt;As opposed to financial periods which have an explicit begin &amp;amp; end date, a service month does not have a predefined&lt;/P&gt;&lt;P&gt;dates range. That's what causes the current issue.&lt;/P&gt;&lt;P&gt;To this end, I haven't find a working example in the community.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dafnis&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 May 2016 06:11:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sort-by-Expression-does-not-work-as-expected/m-p/1052593#M353157</guid>
      <dc:creator>dafnis14</dc:creator>
      <dc:date>2016-05-02T06:11:45Z</dc:date>
    </item>
    <item>
      <title>Re: Sort by Expression does not work as expected</title>
      <link>https://community.qlik.com/t5/QlikView/Sort-by-Expression-does-not-work-as-expected/m-p/1052594#M353158</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sunny,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorry, I haven't noticed your reply.&lt;/P&gt;&lt;P&gt;In the above screenshot, the lines should start from November and not January.&lt;/P&gt;&lt;P&gt;But following what Peter wrote, with the current data it can't be achieved. That's because for every service month,&lt;/P&gt;&lt;P&gt;the sales period should be defined according to a minimum date, and then allocate a day number to sort by.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 May 2016 09:09:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sort-by-Expression-does-not-work-as-expected/m-p/1052594#M353158</guid>
      <dc:creator>dafnis14</dc:creator>
      <dc:date>2016-05-02T09:09:38Z</dc:date>
    </item>
    <item>
      <title>Re: Sort by Expression does not work as expected</title>
      <link>https://community.qlik.com/t5/QlikView/Sort-by-Expression-does-not-work-as-expected/m-p/1052595#M353159</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Peter,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It took a while, but I have used your tip and it resolved the issue: to display dates from different years&lt;/P&gt;&lt;P&gt;based on an expression sort.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"...creating a mapping table that stores the date of the first calendar day of every Service year, and - while loading the data - calculate the Service year day number by subtracting from the row date the starting date of the Service year of that particular row. Use that Service year day number as sorting field..."&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Years_Comparisons.png" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/130938_Years_Comparisons.png" style="height: 234px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Jul 2016 06:39:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sort-by-Expression-does-not-work-as-expected/m-p/1052595#M353159</guid>
      <dc:creator>dafnis14</dc:creator>
      <dc:date>2016-07-12T06:39:30Z</dc:date>
    </item>
  </channel>
</rss>

