<?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: String to date in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/String-to-date/m-p/1075102#M922839</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you, Appreciated.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 22 Apr 2016 11:18:12 GMT</pubDate>
    <dc:creator />
    <dc:date>2016-04-22T11:18:12Z</dc:date>
    <item>
      <title>String to date</title>
      <link>https://community.qlik.com/t5/QlikView/String-to-date/m-p/1075098#M922835</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Good day,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm new to Qlik and need some help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I do have a field in my QVD called Month_Code and looks like 201603. This code is a string that refers to the year and month. I need to convert this to a date where the first part of the string will be 2016 as the year and 03 as the month. The day can be either the 1st or last day of the month.&lt;/P&gt;&lt;P&gt;What is the best way to convert the string?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/String-to-date/m-p/1075098#M922835</guid>
      <dc:creator />
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: String to date</title>
      <link>https://community.qlik.com/t5/QlikView/String-to-date/m-p/1075099#M922836</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can do it like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Date(Date#(Month_code, 'YYYYMM')) as YearMonth&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Apr 2016 15:04:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/String-to-date/m-p/1075099#M922836</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2016-04-21T15:04:22Z</dc:date>
    </item>
    <item>
      <title>Re: String to date</title>
      <link>https://community.qlik.com/t5/QlikView/String-to-date/m-p/1075100#M922837</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I tried this one, but it did not apply correctly. the following code however did the trick:&lt;/P&gt;&lt;P&gt;(year(Date(Makedate(left(MONTH_CODE,4), right(MONTH_CODE,2), '01'),'YYYY/MM/DD')) &lt;/P&gt;&lt;P&gt;&amp;amp; month(Date(Makedate(left(MONTH_CODE,4), right(MONTH_CODE,2), '01'),'YYYY/MM/DD')))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Apr 2016 05:02:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/String-to-date/m-p/1075100#M922837</guid>
      <dc:creator />
      <dc:date>2016-04-22T05:02:57Z</dc:date>
    </item>
    <item>
      <title>Re: String to date</title>
      <link>https://community.qlik.com/t5/QlikView/String-to-date/m-p/1075101#M922838</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your code will return something like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2016Mar&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;right?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Though the format may be like intended, please note that this code will not return a value that can be used in QV date / time functions,nor will it be appear in a proper sort order. It just returns a text value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have a look at&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;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/2865"&gt;On Format Codes for Numbers and Dates&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can add a format code to my first expression:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD *,&lt;/P&gt;&lt;P&gt; &lt;STRONG&gt; Date(Date#(MONTH_CODE,'YYYYMM'),'&lt;EM&gt;YYYYMMM&lt;/EM&gt;') as RealNewDate,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; (year(Date(Makedate(left(MONTH_CODE,4), right(MONTH_CODE,2), '01'),'YYYY/MM/DD'))&lt;/P&gt;&lt;P&gt;&amp;amp; month(Date(Makedate(left(MONTH_CODE,4), right(MONTH_CODE,2), '01'),'YYYY/MM/DD'))) as YourNewDate;&lt;/P&gt;&lt;P&gt;LOAD * INLINE [&lt;/P&gt;&lt;P&gt;MONTH_CODE&lt;/P&gt;&lt;P&gt;201603&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Apr 2016 09:13:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/String-to-date/m-p/1075101#M922838</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2016-04-22T09:13:25Z</dc:date>
    </item>
    <item>
      <title>Re: String to date</title>
      <link>https://community.qlik.com/t5/QlikView/String-to-date/m-p/1075102#M922839</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you, Appreciated.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Apr 2016 11:18:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/String-to-date/m-p/1075102#M922839</guid>
      <dc:creator />
      <dc:date>2016-04-22T11:18:12Z</dc:date>
    </item>
    <item>
      <title>Re: String to date</title>
      <link>https://community.qlik.com/t5/QlikView/String-to-date/m-p/1075103#M922840</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If your question is now answered, please flag the Correct Answer.&lt;/P&gt;&lt;P&gt;If not, please let us know what part of your topic still needs answering &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 Apr 2016 12:39:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/String-to-date/m-p/1075103#M922840</guid>
      <dc:creator>oknotsen</dc:creator>
      <dc:date>2016-04-22T12:39:33Z</dc:date>
    </item>
  </channel>
</rss>

