<?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 Convert Datefield in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Convert-Datefield/m-p/219826#M72800</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What yyyymmdd format does your "date" field pull in? Try using the date() and date#() functions to convert your text field into a true date field in qlikview.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 19 Oct 2009 20:54:10 GMT</pubDate>
    <dc:creator />
    <dc:date>2009-10-19T20:54:10Z</dc:date>
    <item>
      <title>Convert Datefield</title>
      <link>https://community.qlik.com/t5/QlikView/Convert-Datefield/m-p/219825#M72799</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;I'm a newbie. Don't be too hard... [:)]&lt;/P&gt;&lt;P&gt;We have this weird kind of database, no sql, mysql or whatever.&lt;BR /&gt;This database supports ODBC, but only the basic stuff.&lt;BR /&gt;For most fields no problem, except Date fields.&lt;/P&gt;&lt;P&gt;Every Date comes in as a String (but documentprops says it's a date...).&lt;BR /&gt;Set Dateformat in script is correct ('YYYY-M-D').&lt;/P&gt;&lt;P&gt;"month (DateX) as Datex_month" doesn't do his job.&lt;/P&gt;&lt;P&gt;Question 1:&lt;BR /&gt;Is there a possibility, after (Re)loading the data, to convert this field (maybe to a new and real Date field?)?&lt;/P&gt;&lt;P&gt;Any ideas or Workarounds?&lt;/P&gt;&lt;P&gt;Question 2:&lt;BR /&gt;Most of the Qlikview examples split dates in to year, month and day.&lt;BR /&gt;Since I can't split these fields, is there a clever way to select Dates?&lt;BR /&gt;We can use * search for text and &amp;lt;=&amp;gt; for Numeric fields, but I have no idea how to select Dates.&lt;BR /&gt;So far no luck with &amp;gt; or between functions&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Thanks in advance&lt;/P&gt;&lt;P&gt;Fred&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Oct 2009 20:46:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Convert-Datefield/m-p/219825#M72799</guid>
      <dc:creator>fred_s</dc:creator>
      <dc:date>2009-10-19T20:46:51Z</dc:date>
    </item>
    <item>
      <title>Convert Datefield</title>
      <link>https://community.qlik.com/t5/QlikView/Convert-Datefield/m-p/219826#M72800</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What yyyymmdd format does your "date" field pull in? Try using the date() and date#() functions to convert your text field into a true date field in qlikview.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Oct 2009 20:54:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Convert-Datefield/m-p/219826#M72800</guid>
      <dc:creator />
      <dc:date>2009-10-19T20:54:10Z</dc:date>
    </item>
    <item>
      <title>Convert Datefield</title>
      <link>https://community.qlik.com/t5/QlikView/Convert-Datefield/m-p/219827#M72801</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Fred,&lt;/P&gt;&lt;P&gt;if it is a text field than write:&lt;/P&gt;&lt;P&gt;Date(Date#(DateX, 'YYYY-M-D'), 'DD-MM-YYYY') as MyDateFormat&lt;/P&gt;&lt;P&gt;Date# is for interpretation and Date to format your data.&lt;/P&gt;&lt;P&gt;If it does the job you can split it to YEAR and so on as follows:&lt;/P&gt;&lt;P&gt;Year(MyDateFormat) as Year,&lt;/P&gt;&lt;P&gt;Month(MyDateFormat) as Month&lt;/P&gt;&lt;P&gt;If it doesn´t work please provide some data as example.&lt;/P&gt;&lt;P&gt;Good luck!&lt;/P&gt;&lt;P&gt;Rainer&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Oct 2009 20:55:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Convert-Datefield/m-p/219827#M72801</guid>
      <dc:creator />
      <dc:date>2009-10-19T20:55:52Z</dc:date>
    </item>
    <item>
      <title>Convert Datefield</title>
      <link>https://community.qlik.com/t5/QlikView/Convert-Datefield/m-p/219828#M72802</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Actually I've tried this one, but it seems like&lt;BR /&gt;"Date(Date#(DateX, 'YYYY-M-D'), 'DD-MM-YYYY') as MyDateFormat" is not supported:&lt;/P&gt;&lt;P&gt;SQL Error:Syntax error or access violation&lt;BR /&gt;SQL Scriptline:&lt;BR /&gt;SQL State:37000&lt;/P&gt;&lt;P&gt;The fact that these Date/Date# functions aren't supported is probably my problem.&lt;/P&gt;&lt;P&gt;The database returns Dates in 'Dutch' format (DD-MM-YYYY) so I've changed the DateFormat in the script back to Dutch instead of YYYY-M-D.&lt;/P&gt;&lt;P&gt;As mentioned earlier, my dates are probably string (left alignment in Qlikview where Excel example dates have Right alignment).&lt;BR /&gt;According to documentproperties it should be a Date.&lt;/P&gt;&lt;P&gt;I have a little example attached, where Factuurdat is the problem.&lt;BR /&gt;Datum, mnd and Omschr are fields from an Excel file, just for me to show that it is possible to split Dates.&lt;/P&gt;&lt;P&gt;Hope you guys can offer me a workaround...&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Oct 2009 21:47:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Convert-Datefield/m-p/219828#M72802</guid>
      <dc:creator>fred_s</dc:creator>
      <dc:date>2009-10-19T21:47:04Z</dc:date>
    </item>
    <item>
      <title>Convert Datefield</title>
      <link>https://community.qlik.com/t5/QlikView/Convert-Datefield/m-p/219829#M72803</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, the Date# is a QV function, I recomend:&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;Date(Date#( .... )&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;Sql Select ........ ;&lt;/P&gt;&lt;P&gt;Gabriel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Oct 2009 21:50:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Convert-Datefield/m-p/219829#M72803</guid>
      <dc:creator>GabrielAraya</dc:creator>
      <dc:date>2009-10-19T21:50:58Z</dc:date>
    </item>
    <item>
      <title>Convert Datefield</title>
      <link>https://community.qlik.com/t5/QlikView/Convert-Datefield/m-p/219830#M72804</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Gabriel,&lt;/P&gt;&lt;P&gt;Thanks for your reply.&lt;/P&gt;&lt;P&gt;The problem is, the SQL string in QV is some kind of Pass Through-query like the ones in MS Access.&lt;BR /&gt;QV doesn't do anything with the string, just passes it through.&lt;/P&gt;&lt;P&gt;The problem is 'Date' or 'Date#' are no QV functions, but part of the (Pass Through) SQL string.&lt;BR /&gt;It seems my ODBC connection does not support Date functions.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Oct 2009 22:07:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Convert-Datefield/m-p/219830#M72804</guid>
      <dc:creator>fred_s</dc:creator>
      <dc:date>2009-10-19T22:07:13Z</dc:date>
    </item>
    <item>
      <title>Convert Datefield</title>
      <link>https://community.qlik.com/t5/QlikView/Convert-Datefield/m-p/219831#M72805</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi fred,&lt;/P&gt;&lt;P&gt;I don't thing that the problem is with the connection string .. (ODBC ..... or OLEDB ... ), my suggestion was to work with a LOAD before the SQL statement, the reason is the Date# is a QlikView function ...so:&lt;BR /&gt;Load&lt;BR /&gt; Field1,&lt;BR /&gt; Field2,&lt;BR /&gt; Date(Date#(field3,'DD-MM-YYYY')) as field3&lt;BR /&gt;;&lt;BR /&gt;Sql Select Field1, Field2, Field3 from AccesTable;&lt;BR /&gt;&lt;BR /&gt;Gabriel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Oct 2009 22:14:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Convert-Datefield/m-p/219831#M72805</guid>
      <dc:creator>GabrielAraya</dc:creator>
      <dc:date>2009-10-19T22:14:40Z</dc:date>
    </item>
    <item>
      <title>Convert Datefield</title>
      <link>https://community.qlik.com/t5/QlikView/Convert-Datefield/m-p/219832#M72806</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Gabriel,&lt;/P&gt;&lt;P&gt;It took me a couple of seconds to get your point, but this looks great!!&lt;/P&gt;&lt;P&gt;Can you tell me how to split this Date into Year, Month and Day?&lt;BR /&gt;Something like&lt;BR /&gt;Year(Factdatum) as Factjaar&lt;/P&gt;&lt;P&gt;It doesn't work in the load and it doesn't in the SQL string.&lt;/P&gt;&lt;P&gt;Thanks!&lt;BR /&gt;It's already a great solution and still can get better...&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Current code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;ODBC CONNECT TO SERVERX (XUserId is 5151515151515, XPassword is 7474747474747);&lt;BR /&gt;Load&lt;BR /&gt; Boekjaar,&lt;BR /&gt; [Factuur-nr],&lt;BR /&gt; Factuurbedr,&lt;BR /&gt; Date(Date#(Factuurdat,'DD-MM-YYYY')) as Factdatum&lt;BR /&gt;;&lt;BR /&gt;SQL SELECT Boekjaar,&lt;BR /&gt; Factuur-nr ,&lt;BR /&gt; Factuurbedr,&lt;BR /&gt; Factuurdat&lt;BR /&gt;FROM _DF_Debiteur_factuur ;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Oct 2009 22:44:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Convert-Datefield/m-p/219832#M72806</guid>
      <dc:creator>fred_s</dc:creator>
      <dc:date>2009-10-19T22:44:51Z</dc:date>
    </item>
    <item>
      <title>Convert Datefield</title>
      <link>https://community.qlik.com/t5/QlikView/Convert-Datefield/m-p/219833#M72807</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Of Course, it is very simple, you can add a new line after Date(Date#(.......) as Factdatum,&lt;/P&gt;&lt;P&gt;Year(Date#(.....)) as YearFactdatum,&lt;BR /&gt;Month(Date#(...)) as MonthFactdatum .. and so on&lt;BR /&gt;&lt;BR /&gt;Gabriel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Oct 2009 22:51:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Convert-Datefield/m-p/219833#M72807</guid>
      <dc:creator>GabrielAraya</dc:creator>
      <dc:date>2009-10-19T22:51:14Z</dc:date>
    </item>
    <item>
      <title>Convert Datefield</title>
      <link>https://community.qlik.com/t5/QlikView/Convert-Datefield/m-p/219834#M72808</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You may also use an additional preceeding load to avoid repeating the date#() function. Like this:&lt;/P&gt;&lt;P&gt;LOAD *,&lt;BR /&gt; year(Factdatum) as YearFactdatum,&lt;BR /&gt; month(Factdatum) as MonthFactdatum&lt;BR /&gt;;&lt;BR /&gt;Load&lt;BR /&gt; Boekjaar,&lt;BR /&gt; [Factuur-nr],&lt;BR /&gt; Factuurbedr,&lt;BR /&gt; Date(Date#(Factuurdat,'DD-MM-YYYY')) as Factdatum&lt;BR /&gt;;&lt;BR /&gt;SQL SELECT Boekjaar,&lt;BR /&gt; Factuur-nr ,&lt;BR /&gt; Factuurbedr,&lt;BR /&gt; Factuurdat&lt;BR /&gt;FROM _DF_Debiteur_factuur ;&lt;/P&gt;&lt;P&gt;-Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Oct 2009 04:25:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Convert-Datefield/m-p/219834#M72808</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2009-10-20T04:25:15Z</dc:date>
    </item>
    <item>
      <title>Convert Datefield</title>
      <link>https://community.qlik.com/t5/QlikView/Convert-Datefield/m-p/219835#M72809</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Or create a separate calendar table after loading the main data. I also usually prefer my year and month be actual dates:&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;[Calendar]:&lt;BR /&gt;LOAD&lt;BR /&gt; Factdatum&lt;BR /&gt;,date(yearstart(Factdatum),'YYYY') as YearFactdatum&lt;BR /&gt;,date(monthstart(Factdatum),'MMM YYYY') as MonthFactdatum&lt;BR /&gt;;&lt;BR /&gt;LOAD fieldvalue('Factdatum',iterno()) as Factdatum&lt;BR /&gt;AUTOGENERATE 1&lt;BR /&gt;WHILE len(fieldvalue('Factdatum',iterno()))&lt;BR /&gt;;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Oct 2009 07:42:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Convert-Datefield/m-p/219835#M72809</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2009-10-20T07:42:16Z</dc:date>
    </item>
    <item>
      <title>Convert Datefield</title>
      <link>https://community.qlik.com/t5/QlikView/Convert-Datefield/m-p/219836#M72810</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Thanks, especially Gabriel!&lt;/P&gt;&lt;P&gt;You All have been a great help.&lt;BR /&gt;It has been a pain for several weeks. Next time I won't wait that long.&lt;/P&gt;&lt;P&gt;Rob and John, thanks for the addition.&lt;/P&gt;&lt;P&gt;All problems solved (so far &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Fred&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Oct 2009 19:49:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Convert-Datefield/m-p/219836#M72810</guid>
      <dc:creator>fred_s</dc:creator>
      <dc:date>2009-10-20T19:49:24Z</dc:date>
    </item>
  </channel>
</rss>

