<?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 Substring the date to select only year in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Substring-the-date-to-select-only-year/m-p/1221080#M390403</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm very new to Qlikview and need your help to extract only a year from the date.&lt;/P&gt;&lt;P&gt;My source data is simple excel. Order date in the format mm/dd/yyyy. I'm using below Subfield function to extract only year from order date and ship date. When I reload the data and preview the table, it doesnt show any year in loaded table preview.&lt;/P&gt;&lt;P&gt;Please help me if I'm missing anything here. Thanks in advance. Below is the SQL im trying to load.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please let me know if any addition info required.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NoConcatenate LOAD [Row ID], &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Order ID], &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Order Date],&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SubField([Order Date],'/',3) AS Saleyear,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Ship Date], &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SubField([Ship Date],'/',3) AS Shipmentyear,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Ship Mode], &lt;/P&gt;&lt;P&gt;..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 09 Nov 2016 09:54:37 GMT</pubDate>
    <dc:creator />
    <dc:date>2016-11-09T09:54:37Z</dc:date>
    <item>
      <title>Substring the date to select only year</title>
      <link>https://community.qlik.com/t5/QlikView/Substring-the-date-to-select-only-year/m-p/1221080#M390403</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm very new to Qlikview and need your help to extract only a year from the date.&lt;/P&gt;&lt;P&gt;My source data is simple excel. Order date in the format mm/dd/yyyy. I'm using below Subfield function to extract only year from order date and ship date. When I reload the data and preview the table, it doesnt show any year in loaded table preview.&lt;/P&gt;&lt;P&gt;Please help me if I'm missing anything here. Thanks in advance. Below is the SQL im trying to load.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please let me know if any addition info required.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NoConcatenate LOAD [Row ID], &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Order ID], &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Order Date],&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SubField([Order Date],'/',3) AS Saleyear,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Ship Date], &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SubField([Ship Date],'/',3) AS Shipmentyear,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Ship Mode], &lt;/P&gt;&lt;P&gt;..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Nov 2016 09:54:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Substring-the-date-to-select-only-year/m-p/1221080#M390403</guid>
      <dc:creator />
      <dc:date>2016-11-09T09:54:37Z</dc:date>
    </item>
    <item>
      <title>Re: Substring the date to select only year</title>
      <link>https://community.qlik.com/t5/QlikView/Substring-the-date-to-select-only-year/m-p/1221081#M390404</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can use the below in script&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;LOAD [Row ID],&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Order ID],&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Order Date],&lt;/P&gt;&lt;P&gt;Year([&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Order Date&lt;/SPAN&gt;]) as Year,&lt;/P&gt;&lt;P&gt;Month([&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Order Date&lt;/SPAN&gt;]) as Month,&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;[Ship Date],&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;Year(&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;[Ship Date]&lt;/SPAN&gt;) as Year,&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;Month(&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;[Ship Date]&lt;/SPAN&gt;) as Month,&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;like this you can derive&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Nov 2016 11:31:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Substring-the-date-to-select-only-year/m-p/1221081#M390404</guid>
      <dc:creator />
      <dc:date>2016-11-09T11:31:46Z</dc:date>
    </item>
    <item>
      <title>Re: Substring the date to select only year</title>
      <link>https://community.qlik.com/t5/QlikView/Substring-the-date-to-select-only-year/m-p/1221082#M390405</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;First thing to check would be to see if [Order Date] and [Ship Date] are read correctly by QlikView. To learn how to check this look here:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/qlik-blogpost/2954"&gt;Why don’t my dates work?&lt;/A&gt;‌&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/qlik-blogpost/2622"&gt;Get the Dates Right&lt;/A&gt;‌&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Once the dates are read correctly, simply use the Year() function to extract date from your Date fields (just like pointed out by &lt;A href="https://community.qlik.com/people/arumamahesh"&gt;arumamahesh&lt;/A&gt;‌)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Nov 2016 12:42:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Substring-the-date-to-select-only-year/m-p/1221082#M390405</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-11-09T12:42:49Z</dc:date>
    </item>
    <item>
      <title>Re: Substring the date to select only year</title>
      <link>https://community.qlik.com/t5/QlikView/Substring-the-date-to-select-only-year/m-p/1221083#M390406</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Excellent.It worked. Thanks Umamaheshwara and Sunny&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Nov 2016 18:38:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Substring-the-date-to-select-only-year/m-p/1221083#M390406</guid>
      <dc:creator />
      <dc:date>2016-11-09T18:38:38Z</dc:date>
    </item>
  </channel>
</rss>

