<?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: Problem sorting dimension with generated dual date in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Problem-sorting-dimension-with-generated-dual-date/m-p/546172#M204008</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The reason to why it's sorting as it is, is because of the output of the function Weekstart, which you use in the Dual formula. I expect you think it gives an integer, but's it's actual giving a date, and as 1st Jan 2012 belongs to a week starten in 2011, it gives the smallets value. Further more it's has to do with 1st Jan 2012 belongs to weeknumber 52 - given the used method.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 29 Aug 2013 07:30:39 GMT</pubDate>
    <dc:creator>jfkinspari</dc:creator>
    <dc:date>2013-08-29T07:30:39Z</dc:date>
    <item>
      <title>Problem sorting dimension with generated dual date</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-sorting-dimension-with-generated-dual-date/m-p/546170#M204006</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm using a dual Year&amp;amp;Week as the only dimension of a bar chart (see attachment).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I load Year&amp;amp;Week in script as &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;EM&gt;Dual(Year(DateId)&amp;amp;' '&amp;amp;Week(DateId),WeekStart(DateId)) as YearWeek&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;DateId&lt;/EM&gt; is a plain date&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I set the dimension's sorting order to numeric ascending as I would have expected the numeric value of the dual YearWeek to be used. However this does not seem to be the case as the result is:&lt;/P&gt;&lt;P&gt;2012 52&lt;/P&gt;&lt;P&gt;2012 1&lt;/P&gt;&lt;P&gt;2012 2&lt;/P&gt;&lt;P&gt;2012 3&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;2013 51&lt;/P&gt;&lt;P&gt;2013 52&lt;/P&gt;&lt;P&gt;2013 1&lt;/P&gt;&lt;P&gt;When loading years 2012 and 2013.&lt;/P&gt;&lt;P&gt;I've tried lots of different approaches from using other sorting orders up to interpreting YearWeek as string only. None of which yielded a correct result.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyone any idea what I'm overlooking?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks and cheers&lt;/P&gt;&lt;P&gt;Benjamin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Aug 2013 07:16:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-sorting-dimension-with-generated-dual-date/m-p/546170#M204006</guid>
      <dc:creator>benjamins</dc:creator>
      <dc:date>2013-08-29T07:16:15Z</dc:date>
    </item>
    <item>
      <title>Re: Problem sorting dimension with generated dual date</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-sorting-dimension-with-generated-dual-date/m-p/546171#M204007</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think that your problem there is that you are using the year() method instead of the WeekYear() method.&lt;/P&gt;&lt;P&gt;Example with 1 of January of 2012:&lt;/P&gt;&lt;P&gt;Year(): 2012&lt;/P&gt;&lt;P&gt;WeekYear(): 2011&lt;/P&gt;&lt;P&gt;Week(): 52&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; --&amp;gt; Because that day is considered part of the las week of 2011.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Aug 2013 07:26:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-sorting-dimension-with-generated-dual-date/m-p/546171#M204007</guid>
      <dc:creator />
      <dc:date>2013-08-29T07:26:55Z</dc:date>
    </item>
    <item>
      <title>Re: Problem sorting dimension with generated dual date</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-sorting-dimension-with-generated-dual-date/m-p/546172#M204008</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The reason to why it's sorting as it is, is because of the output of the function Weekstart, which you use in the Dual formula. I expect you think it gives an integer, but's it's actual giving a date, and as 1st Jan 2012 belongs to a week starten in 2011, it gives the smallets value. Further more it's has to do with 1st Jan 2012 belongs to weeknumber 52 - given the used method.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Aug 2013 07:30:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-sorting-dimension-with-generated-dual-date/m-p/546172#M204008</guid>
      <dc:creator>jfkinspari</dc:creator>
      <dc:date>2013-08-29T07:30:39Z</dc:date>
    </item>
    <item>
      <title>Re: Problem sorting dimension with generated dual date</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-sorting-dimension-with-generated-dual-date/m-p/546173#M204009</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks to the both of you for your explanations!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, &lt;/P&gt;&lt;P&gt;Dual(WeekYear(DateId)&amp;amp;' '&amp;amp;Week(DateId),Num(Date#(WeekStart(DateId)))) as YearWeek,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;seems to yield correct results. However I'm a bit confused as to wether this really is the correct usage of the Dual() function now!? I would have thought that passing an actual date as the function's second argument would cause the numeric representation to be used. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Aug 2013 07:40:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-sorting-dimension-with-generated-dual-date/m-p/546173#M204009</guid>
      <dc:creator>benjamins</dc:creator>
      <dc:date>2013-08-29T07:40:57Z</dc:date>
    </item>
    <item>
      <title>Re: Problem sorting dimension with generated dual date</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-sorting-dimension-with-generated-dual-date/m-p/546174#M204010</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try with this Expression for your case&lt;/P&gt;&lt;P&gt;Dual(Year(DateId)&amp;amp;' '&amp;amp;Week(DateId),Num(Year(DateId)&amp;amp;Week(DateId))) as YearWeek,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You cann't use week start here.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Aug 2013 07:46:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-sorting-dimension-with-generated-dual-date/m-p/546174#M204010</guid>
      <dc:creator>CELAMBARASAN</dc:creator>
      <dc:date>2013-08-29T07:46:10Z</dc:date>
    </item>
    <item>
      <title>Re: Problem sorting dimension with generated dual date</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-sorting-dimension-with-generated-dual-date/m-p/546175#M204011</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The second part of the dual funktion, Num(Date#(WeekStart(DateId)))), will make no difference.&lt;/P&gt;&lt;P&gt;It's indeed using the numeric rep.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think you'll be good just be replacing the year function as IOSU explained&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Aug 2013 07:46:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-sorting-dimension-with-generated-dual-date/m-p/546175#M204011</guid>
      <dc:creator>jfkinspari</dc:creator>
      <dc:date>2013-08-29T07:46:42Z</dc:date>
    </item>
    <item>
      <title>Re: Problem sorting dimension with generated dual date</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-sorting-dimension-with-generated-dual-date/m-p/546176#M204012</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; Do one thing, create another filed called Week.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Now in your chart go to the sort tab and choose the expression.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Here enter the field name week and sort it in ascending order.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; And remove other sorting options.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Hope this will solve your problem.&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>Thu, 29 Aug 2013 07:50:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-sorting-dimension-with-generated-dual-date/m-p/546176#M204012</guid>
      <dc:creator>kaushiknsolanki</dc:creator>
      <dc:date>2013-08-29T07:50:59Z</dc:date>
    </item>
    <item>
      <title>Re: Problem sorting dimension with generated dual date</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-sorting-dimension-with-generated-dual-date/m-p/546177#M204013</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Nope, this expression produces very strange sorting&lt;IMG alt="IncorrectSorting.PNG.png" class="jive-image" src="https://community.qlik.com/legacyfs/online/46002_IncorrectSorting.PNG.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Aug 2013 07:52:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-sorting-dimension-with-generated-dual-date/m-p/546177#M204013</guid>
      <dc:creator>benjamins</dc:creator>
      <dc:date>2013-08-29T07:52:20Z</dc:date>
    </item>
    <item>
      <title>Re: Problem sorting dimension with generated dual date</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-sorting-dimension-with-generated-dual-date/m-p/546178#M204014</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Nope, produces sorting as seen below&lt;IMG alt="IncorrectSorting.PNG.png" class="jive-image" src="https://community.qlik.com/legacyfs/online/46003_IncorrectSorting.PNG.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Aug 2013 08:00:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-sorting-dimension-with-generated-dual-date/m-p/546178#M204014</guid>
      <dc:creator>benjamins</dc:creator>
      <dc:date>2013-08-29T08:00:12Z</dc:date>
    </item>
    <item>
      <title>Re: Problem sorting dimension with generated dual date</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-sorting-dimension-with-generated-dual-date/m-p/546179#M204015</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you very much everyone. You saved me HOURS!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Aug 2013 08:01:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-sorting-dimension-with-generated-dual-date/m-p/546179#M204015</guid>
      <dc:creator>benjamins</dc:creator>
      <dc:date>2013-08-29T08:01:21Z</dc:date>
    </item>
    <item>
      <title>Re: Problem sorting dimension with generated dual date</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-sorting-dimension-with-generated-dual-date/m-p/546180#M204016</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;Try with this&lt;/P&gt;&lt;P&gt;Dual(Year(DateId)&amp;amp;' '&amp;amp;Week(DateId),Num(Year(DateId)&amp;amp;Num(Week(DateId),'00'))) as YearWeek, &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Aug 2013 08:02:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-sorting-dimension-with-generated-dual-date/m-p/546180#M204016</guid>
      <dc:creator>CELAMBARASAN</dc:creator>
      <dc:date>2013-08-29T08:02:22Z</dc:date>
    </item>
    <item>
      <title>Re: Problem sorting dimension with generated dual date</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-sorting-dimension-with-generated-dual-date/m-p/546181#M204017</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; I guess nothing is wrong in your sorting, only thing is the year field which you have created is wrong.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Let me give you an example.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; You have written&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dual(Year(DateId)&amp;amp;' '&amp;amp;Week(DateId),WeekStart(DateId)) as YearWeek,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; So now consider the date 01.01.2012.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; The week for this date is 52 (which is of last year i.e year 2011) but in your field it shows as 2012 52, which is wrong, correct is 2011 52.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; So change your expression to.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dual(Year(weekstart(DateId))&amp;amp;' '&amp;amp;Week(DateId),WeekStart(DateId)) as YearWeek&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Hope this is clear to you.&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>Thu, 29 Aug 2013 08:04:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-sorting-dimension-with-generated-dual-date/m-p/546181#M204017</guid>
      <dc:creator>kaushiknsolanki</dc:creator>
      <dc:date>2013-08-29T08:04:52Z</dc:date>
    </item>
  </channel>
</rss>

