<?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: Re: Re: Sort Order of Date Field. in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Sort-Order-of-Date-Field/m-p/726210#M260429</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hii...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank Yu... it is working... &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 22 Aug 2014 12:27:27 GMT</pubDate>
    <dc:creator />
    <dc:date>2014-08-22T12:27:27Z</dc:date>
    <item>
      <title>Sort Order of Date Field.</title>
      <link>https://community.qlik.com/t5/QlikView/Sort-Order-of-Date-Field/m-p/726206#M260425</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Greetings for the day.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please suggest with proper code for below requirement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have Back Order Table with many fields. But for this requirement i require only five fields. Please find the attachments.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My Requirement :-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For the combination of (Part No (BO_ETD_SHIPP_PART_NO) , Cust Code (BO_ETD_CUST_CD) and Order No (BO_ETD_CUST_ORD_NO)) , there will be many creation date(BO_ETD_CRE_DATE) and etd's(BO_ETD_LATEST_ETD) (Estimated Time Delivery).&lt;/P&gt;&lt;P&gt;I want to create new sub fields as ETD1,ETD2,ETD3,ETD4,ETD5 AND ETDMAX.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For Eg:- Scenario 1) For this combination, if i have three etd's then ETD1,ETD2 and ETD3 only records. In this case no records will available for ETD4,ETD5 and ETDMAX.&lt;/P&gt;&lt;P&gt;Scenario 2) For this combination, if i have four etd's then ETD1, ETD2, ETD3 and ETD4 only records. In this case no records will available for ETD5 and ETDMAX.&lt;/P&gt;&lt;P&gt;Scenario 3) For this combination, if i have ten etd's then ETD1, ETD2, ETD3,ETD4,ETD5 and ETDMAX(Tenth ETD) (MAX is nothing but if there are more then five etd's then last etd is MAX etd. i.e. if no of etd's are more then five then only ETDMAX will come for that combination) only records. In this case all records will available.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now i need to create sub fields (ETD1,ETD2,ETD3,ETD4,ETD5 and ETDMAX).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;NOTE :-&lt;/STRONG&gt; Here ETD field format is not date, its in number format. And suppose if user not entered any etd for that combination then system will automatically assign "99999999". In my code i am removing records where there is 99999999 for the first time . That means if 99999999 is available in between etd's then i am considering. If only 99999999 is available then i am neglecting. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This creation of sub fields should depends on creation date.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For eg :- In attachment &lt;STRONG&gt;ISSUE.QVW, For combination (8847447020,VE01A, TEO002246), there are three etd's. I am able to split it as ETD1,2 and 3. But the order is not coming as per my requirement. Order should be on creation date wise. In this eg, ETD1 is correct, but ETD2 should come as ETD3 and ETD3 should come as ETD2. &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="jiveImage" src="https://community.qlik.com/" style="max-width: 1200px; max-height: 900px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here distinct etd's are 26.sep.2013,01.oct.2013,03.oct.2013. So i am getting ETD1 as 26.sep.2013, ETD2 as 01.oct.2013 and ETD3 as 03.oct.2013. But this is wrong . It should consider creation date. as per creation date ETD2 should be&amp;nbsp;&amp;nbsp; 03.oct.2013 and ETD3 should be 01.oct.2013.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In attachments i pasted both qvd and qvw. In QVW, code is available, Please suggest me to get my requirement properly.&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Aug 2014 07:14:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sort-Order-of-Date-Field/m-p/726206#M260425</guid>
      <dc:creator />
      <dc:date>2014-08-22T07:14:35Z</dc:date>
    </item>
    <item>
      <title>Re: Sort Order of Date Field.</title>
      <link>https://community.qlik.com/t5/QlikView/Sort-Order-of-Date-Field/m-p/726207#M260426</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Attachment missing...!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Aug 2014 07:55:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sort-Order-of-Date-Field/m-p/726207#M260426</guid>
      <dc:creator>MK_QSL</dc:creator>
      <dc:date>2014-08-22T07:55:28Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Sort Order of Date Field.</title>
      <link>https://community.qlik.com/t5/QlikView/Sort-Order-of-Date-Field/m-p/726208#M260427</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hii...&lt;/P&gt;&lt;P&gt;SORRY..!!!&lt;/P&gt;&lt;P&gt;pls find the attached...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Aug 2014 08:07:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sort-Order-of-Date-Field/m-p/726208#M260427</guid>
      <dc:creator />
      <dc:date>2014-08-22T08:07:45Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Re: Sort Order of Date Field.</title>
      <link>https://community.qlik.com/t5/QlikView/Sort-Order-of-Date-Field/m-p/726209#M260428</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try like this&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_14086982371256361" jivemacro_uid="_14086982371256361"&gt;
&lt;P&gt;FINAL_ETD:&lt;/P&gt;
&lt;P&gt;LOAD&lt;/P&gt;
&lt;P&gt;&amp;nbsp; TEMP_CUST_ORD_NO,TEMP_CUST_CD,TEMP_SHIPP_PART_NO,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; TEMP_SHIPP_PART_NO&amp;amp;TEMP_CUST_ORD_NO&amp;amp;TEMP_CUST_CD AS %KEY_SHIP_BO_COM,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; IF(WildMatch(concat(DISTINCT BO_ETD_LATEST_ETD,','), '*99999999*'), '99999999') AS NOETD,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Date(Date#(subfield(concat(DISTINCT(BO_ETD_LATEST_ETD),',',BO_ETD_CRE_DATE),',',1),'YYYYMMDD'))&amp;nbsp; AS ETD1,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Date(Date#(subfield(concat(DISTINCT(BO_ETD_LATEST_ETD),',',BO_ETD_CRE_DATE),',',2),'YYYYMMDD'))&amp;nbsp; AS ETD2,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Date(Date#(subfield(concat(DISTINCT(BO_ETD_LATEST_ETD),',',BO_ETD_CRE_DATE),',',3),'YYYYMMDD'))&amp;nbsp; AS ETD3,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Date(Date#(subfield(concat(DISTINCT(BO_ETD_LATEST_ETD),',',BO_ETD_CRE_DATE),',',4),'YYYYMMDD'))&amp;nbsp; AS ETD4,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Date(Date#(subfield(concat(DISTINCT(BO_ETD_LATEST_ETD),',',BO_ETD_CRE_DATE),',',5),'YYYYMMDD'))&amp;nbsp; AS ETD5,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Date(Date#(IF(COUNT(DISTINCT BO_ETD_LATEST_ETD)&amp;gt;4, SubField(Concat(DISTINCT BO_ETD_LATEST_ETD,',',BO_ETD_CRE_DATE),',',COUNT(DISTINCT BO_ETD_LATEST_ETD))),'YYYYMMDD')) AS ETDMAX&lt;/P&gt;
&lt;P&gt;Group by TEMP_SHIPP_PART_NO,TEMP_CUST_ORD_NO,TEMP_CUST_CD;&lt;/P&gt;
&lt;P&gt;LOAD &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; BO_ETD_CUST_ORD_NO AS TEMP_CUST_ORD_NO,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; BO_ETD_CUST_CD AS TEMP_CUST_CD, &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; BO_ETD_SHIPP_PART_NO AS TEMP_SHIPP_PART_NO,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; MAX(BO_ETD_CRE_DATE) AS BO_ETD_CRE_DATE,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; BO_ETD_LATEST_ETD&lt;/P&gt;
&lt;P&gt;Resident FINAL&lt;/P&gt;
&lt;P&gt;group by BO_ETD_SHIPP_PART_NO,BO_ETD_CUST_ORD_NO,BO_ETD_CUST_CD, BO_ETD_LATEST_ETD;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;DROP TABLE FINAL;&lt;/P&gt;
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Aug 2014 09:04:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sort-Order-of-Date-Field/m-p/726209#M260428</guid>
      <dc:creator>CELAMBARASAN</dc:creator>
      <dc:date>2014-08-22T09:04:05Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Re: Sort Order of Date Field.</title>
      <link>https://community.qlik.com/t5/QlikView/Sort-Order-of-Date-Field/m-p/726210#M260429</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hii...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank Yu... it is working... &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Aug 2014 12:27:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sort-Order-of-Date-Field/m-p/726210#M260429</guid>
      <dc:creator />
      <dc:date>2014-08-22T12:27:27Z</dc:date>
    </item>
  </channel>
</rss>

