<?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 Date in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Sorting-Date/m-p/682177#M1067898</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you try to sort by the expression &lt;STRONG&gt;Year(DAT) * 100 + Month(DAT)&lt;/STRONG&gt;?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In case the DAT is not a real date field (i.e. Text), you can use Mid to extract the corresponding section (e.g. MID(DAT,7,4) for Year and MID(DAT,4,2) for Month)&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Image1.PNG.png" class="jive-image" src="https://community.qlik.com/legacyfs/online/65637_Image1.PNG.png" style="font-size: 10pt; line-height: 1.5em; width: 620px; height: 255px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 01 Sep 2014 09:32:37 GMT</pubDate>
    <dc:creator>alfredlee</dc:creator>
    <dc:date>2014-09-01T09:32:37Z</dc:date>
    <item>
      <title>Sorting Date</title>
      <link>https://community.qlik.com/t5/QlikView/Sorting-Date/m-p/682175#M1067896</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a column with unsorted Dates in the format 'DD.MM.YYYY hh:mm:ss'. I would like to extract Date from this data in the format 'MM.YYYY' and also in the sorted order. I'm using Date(MonthStart(DAT), 'MM.YYYY'), where DAT is the name of my column. I'm getting the date in 'MM.YYYY' format but I'm not able to get it in sorted form. I'm using this extracted format in a chart and I tried to sort by setting Expression 'DAT' as ascending in the sort tab of chart. But no success so far.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help me in achieving this. Thanks in advance..!!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Sep 2014 09:09:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sorting-Date/m-p/682175#M1067896</guid>
      <dc:creator />
      <dc:date>2014-09-01T09:09:06Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting Date</title>
      <link>https://community.qlik.com/t5/QlikView/Sorting-Date/m-p/682176#M1067897</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use below code in your script.. .Change necessary field names...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;DUAL(Date(Floor(TimeStamp#(DATE,'DD.MM.YYYY hh:mm:ss')),'MM.YYYY'),Date(Floor(TimeStamp#(DATE,'DD.MM.YYYY hh:mm:ss')),'YYYYMM')) as RequiredDate&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Sep 2014 09:23:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sorting-Date/m-p/682176#M1067897</guid>
      <dc:creator>MK_QSL</dc:creator>
      <dc:date>2014-09-01T09:23:12Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting Date</title>
      <link>https://community.qlik.com/t5/QlikView/Sorting-Date/m-p/682177#M1067898</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you try to sort by the expression &lt;STRONG&gt;Year(DAT) * 100 + Month(DAT)&lt;/STRONG&gt;?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In case the DAT is not a real date field (i.e. Text), you can use Mid to extract the corresponding section (e.g. MID(DAT,7,4) for Year and MID(DAT,4,2) for Month)&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Image1.PNG.png" class="jive-image" src="https://community.qlik.com/legacyfs/online/65637_Image1.PNG.png" style="font-size: 10pt; line-height: 1.5em; width: 620px; height: 255px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Sep 2014 09:32:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sorting-Date/m-p/682177#M1067898</guid>
      <dc:creator>alfredlee</dc:creator>
      <dc:date>2014-09-01T09:32:37Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting Date</title>
      <link>https://community.qlik.com/t5/QlikView/Sorting-Date/m-p/682178#M1067899</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your DAT field is not loaded as Timestamp but as Text.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_14095647525918389" jivemacro_uid="_14095647525918389"&gt;
&lt;P&gt;Date(MonthStart(TimeStamp#(DAT, 'DD.MM.YYYY hh:mm:ss')),'MM.YYYY')&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or better load your DAT field with&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_14095647477701244" jivemacro_uid="_14095647477701244"&gt;
&lt;P&gt;TimeStamp#(DAT, 'DD.MM.YYYY hh:mm:ss') as DAT&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then your expression&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_14095647427998325" jivemacro_uid="_14095647427998325"&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 10pt; line-height: 1.5em;"&gt;Date(MonthStart(DAT), 'MM.YYYY')&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 10pt; line-height: 1.5em;"&gt;will work too.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 10pt; line-height: 1.5em;"&gt;regards&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 10pt; line-height: 1.5em;"&gt;Marco&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Sep 2014 09:45:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sorting-Date/m-p/682178#M1067899</guid>
      <dc:creator>MarcoWedel</dc:creator>
      <dc:date>2014-09-01T09:45:18Z</dc:date>
    </item>
  </channel>
</rss>

