<?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: Convert Julian Date to regular date in data load script SQL in Connectivity &amp; Data Prep</title>
    <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Convert-Julian-Date-to-regular-date-in-data-load-script-SQL/m-p/110224#M587</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Actually there is no such thing as "Qlik-compatible SQL". &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The entire SELECT statement is sent as-is directly to the connector which most often is an ODBC connector. So it is the ODBC connector and the database that the specific ODBC connector connects to that defines what a compatible SQL is. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The only thing Qlik is concerned with is the columns and rows that are returned by the connector (and that the columnnames are unique - which they might not be since a SQL select might have duplicate names without a problem).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However you can use $-sign expansion with variables from Qlik to insert into the select statement.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 06 Nov 2018 03:56:58 GMT</pubDate>
    <dc:creator>petter</dc:creator>
    <dc:date>2018-11-06T03:56:58Z</dc:date>
    <item>
      <title>Convert Julian Date to regular date in data load script SQL</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Convert-Julian-Date-to-regular-date-in-data-load-script-SQL/m-p/110223#M586</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I need to query an ODBC data source directly and grab data that is for the current date.&amp;nbsp; Unfortunately, the dates are in Julian format, such as today's date would be 18309, but in JD Edwards there's also a leading digit for the century, so we're looking at a JDE Julian Date of 118309. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm looking for a way to convert that to a calendar date in the SQL load script in the Qlik Sense data load editor.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Currently, SQL in the load script looks like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD PDITM, &lt;/P&gt;&lt;P&gt;PDPDS2, &lt;/P&gt;&lt;P&gt;PDPDS5, &lt;/P&gt;&lt;P&gt;PDPQOR;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[F4311]:&lt;/P&gt;&lt;P&gt;SELECT "PDITM", &lt;/P&gt;&lt;P&gt;"PDPDS2", &lt;/P&gt;&lt;P&gt;"PDPDS5", &lt;/P&gt;&lt;P&gt;"PDPQOR" &lt;/P&gt;&lt;P&gt;FROM "TNA73DTA"."F4311"&lt;/P&gt;&lt;P&gt;WHERE "PDDCTO" = 'OK'&lt;/P&gt;&lt;P&gt;AND "PDPDS1" = 'CON'&lt;/P&gt;&lt;P&gt;AND "PDLTTR" BETWEEN '219' AND '401'&lt;/P&gt;&lt;P&gt;AND "PDDRQJ" = '118309'&lt;SPAN style="font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Ideally, I'd like that last AND to look something like this:&lt;/P&gt;&lt;P&gt;AND DATE("PDDRQJ") = CURDATE()&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or the equivalent in Qlik-compatible SQL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Nov 2018 23:14:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Convert-Julian-Date-to-regular-date-in-data-load-script-SQL/m-p/110223#M586</guid>
      <dc:creator>mikegrattan</dc:creator>
      <dc:date>2018-11-05T23:14:28Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Julian Date to regular date in data load script SQL</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Convert-Julian-Date-to-regular-date-in-data-load-script-SQL/m-p/110224#M587</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Actually there is no such thing as "Qlik-compatible SQL". &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The entire SELECT statement is sent as-is directly to the connector which most often is an ODBC connector. So it is the ODBC connector and the database that the specific ODBC connector connects to that defines what a compatible SQL is. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The only thing Qlik is concerned with is the columns and rows that are returned by the connector (and that the columnnames are unique - which they might not be since a SQL select might have duplicate names without a problem).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However you can use $-sign expansion with variables from Qlik to insert into the select statement.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Nov 2018 03:56:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Convert-Julian-Date-to-regular-date-in-data-load-script-SQL/m-p/110224#M587</guid>
      <dc:creator>petter</dc:creator>
      <dc:date>2018-11-06T03:56:58Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Julian Date to regular date in data load script SQL</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Convert-Julian-Date-to-regular-date-in-data-load-script-SQL/m-p/110225#M588</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;To convert from a Qlik date (Gregorian) to a Julian date JDE you can use this expression:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=(Year(QlikDate)-2000+100)*1000+Num(QlikDate)-MakeDate(Year(QlikDate),1,1)+1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="sql" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_15414775844931875 jive_text_macro" jivemacro_uid="_15414775844931875"&gt;
&lt;P&gt;QlikDate = MakeDate(2018,11,5);&lt;/P&gt;
&lt;P&gt;JDEdate = (Year(QlikDate)-2000+100)*1000+Num(QlikDate)-MakeDate(Year(QlikDate),1,1)+1;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;LOAD PDITM,&lt;/P&gt;
&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;PDPDS2,&lt;/P&gt;
&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;PDPDS5,&lt;/P&gt;
&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;PDPQOR;&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;[F4311]:&lt;/P&gt;
&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;SELECT "PDITM",&lt;/P&gt;
&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;"PDPDS2",&lt;/P&gt;
&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;"PDPDS5",&lt;/P&gt;
&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;"PDPQOR"&lt;/P&gt;
&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;FROM "TNA73DTA"."F4311"&lt;/P&gt;
&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;WHERE "PDDCTO" = 'OK'&lt;/P&gt;
&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;AND "PDPDS1" = 'CON'&lt;/P&gt;
&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;AND "PDLTTR" BETWEEN '219' AND '401'&lt;/P&gt;
&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;AND "PDDRQJ" = '$(JDEdate)'&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: inherit;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: inherit;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: inherit;"&gt;QlikDate=;JDEdate=;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;




&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Nov 2018 04:13:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Convert-Julian-Date-to-regular-date-in-data-load-script-SQL/m-p/110225#M588</guid>
      <dc:creator>petter</dc:creator>
      <dc:date>2018-11-06T04:13:18Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Julian Date to regular date in data load script SQL</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Convert-Julian-Date-to-regular-date-in-data-load-script-SQL/m-p/110226#M589</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just had to make one edit and it worked perfectly.&amp;nbsp; Instead of using MakeDate() in the QlikDate variable I used Date(). I understand why your example used MakeDate, as you were putting together three different components of a date, but I needed today's date.&amp;nbsp; This works:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;QlikDate = Date(Today());&lt;/P&gt;&lt;P&gt;JDEdate = (Year(QlikDate)-2000+100)*1000+Num(QlikDate)-MakeDate(Year(QlikDate),1,1)+1; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LIB CONNECT TO 'Iceberg (tasp-qlik_administrator)';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD PDITM, &lt;/P&gt;&lt;P&gt;PDPDS2, &lt;/P&gt;&lt;P&gt;PDPDS5, &lt;/P&gt;&lt;P&gt;PDPQOR;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[F4311]:&lt;/P&gt;&lt;P&gt;SELECT "PDITM", &lt;/P&gt;&lt;P&gt;"PDPDS2", &lt;/P&gt;&lt;P&gt;"PDPDS5", &lt;/P&gt;&lt;P&gt;"PDPQOR" &lt;/P&gt;&lt;P&gt;FROM "TNA73DTA"."F4311"&lt;/P&gt;&lt;P&gt;WHERE "PDDCTO" = 'OK'&lt;/P&gt;&lt;P&gt;AND "PDPDS1" = 'CON'&lt;/P&gt;&lt;P&gt;AND "PDLTTR" BETWEEN '219' AND '401'&lt;/P&gt;&lt;P&gt;AND "PDDRQJ" = '$(JDEdate)'&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for your great response!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Nov 2018 15:00:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Convert-Julian-Date-to-regular-date-in-data-load-script-SQL/m-p/110226#M589</guid>
      <dc:creator>mikegrattan</dc:creator>
      <dc:date>2018-11-06T15:00:12Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Julian Date to regular date in data load script SQL</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Convert-Julian-Date-to-regular-date-in-data-load-script-SQL/m-p/110227#M590</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You're welcome &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Nov 2018 17:01:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Convert-Julian-Date-to-regular-date-in-data-load-script-SQL/m-p/110227#M590</guid>
      <dc:creator>petter</dc:creator>
      <dc:date>2018-11-06T17:01:49Z</dc:date>
    </item>
  </channel>
</rss>

