<?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: Store data into QVD saves timestamp as NULL in Connectivity &amp; Data Prep</title>
    <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Store-data-into-QVD-saves-timestamp-as-NULL/m-p/2488175#M14240</link>
    <description>&lt;P&gt;As I suspected, Qlik "doesn't like" MySQLs' zero-dates, so using a &lt;STRONG&gt;case when... then&lt;/STRONG&gt; to save '0000-00-00' as NULL for every date column in the SQL statement solved the problem.&lt;/P&gt;</description>
    <pubDate>Mon, 21 Oct 2024 12:44:17 GMT</pubDate>
    <dc:creator>nicolaslopedebarrios</dc:creator>
    <dc:date>2024-10-21T12:44:17Z</dc:date>
    <item>
      <title>Store data into QVD saves timestamp as NULL</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Store-data-into-QVD-saves-timestamp-as-NULL/m-p/2486919#M14230</link>
      <description>&lt;P&gt;When extracting data from a MySQL table to a QVD file, most timestamp values are saved as NULL.&lt;/P&gt;
&lt;P&gt;It is a simple script:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;LIB CONNECT TO 'MySQL_MYDB (qs.user)';

LET vTabla = 'MY_TABLE';

$(vTabla):
SELECT *
FROM my_schema.my_table;

STORE $(vTabla) INTO [lib://DAT_MARIADB_MYDB_QVD (qliksense_user)/DAT_01_MARIADB_MYDB_$(vTabla).qvd] (QVD);
DROP TABLE $(vTabla);&lt;/LI-CODE&gt;
&lt;P&gt;When querying the database directly, there are no NULL or invalid values in the timestamp column. However, QVD metadata shows 95% NULLS (using QViewer):&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="QVD_createdat.png" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/172915i860707F632DA72CC/image-size/large?v=v2&amp;amp;px=999" role="button" title="QVD_createdat.png" alt="QVD_createdat.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;As a result, &lt;STRONG&gt;every date related KPI is not reliable,&lt;/STRONG&gt; since data is not consistent with the source.&lt;/P&gt;
&lt;P&gt;What can I do to prevent this?&lt;/P&gt;</description>
      <pubDate>Mon, 14 Oct 2024 15:04:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Store-data-into-QVD-saves-timestamp-as-NULL/m-p/2486919#M14230</guid>
      <dc:creator>nicolaslopedebarrios</dc:creator>
      <dc:date>2024-10-14T15:04:52Z</dc:date>
    </item>
    <item>
      <title>Re: Store data into QVD saves timestamp as NULL</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Store-data-into-QVD-saves-timestamp-as-NULL/m-p/2486965#M14231</link>
      <description>&lt;P&gt;I have no straight answer, but check if your values are interpreted as null in the select or if the issue is in the conversion between resident table and qvd.&lt;/P&gt;
&lt;P&gt;Try&lt;/P&gt;
&lt;P&gt;LIB CONNECT TO 'MySQL_MYDB (qs.user)';&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;LET vTabla = 'MY_TABLE';&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;$(vTabla):&lt;/P&gt;
&lt;P&gt;SELECT *&lt;/P&gt;
&lt;P&gt;FROM my_schema.my_table&lt;/P&gt;
&lt;P&gt;createe_at IS NOT NULL&lt;/P&gt;
&lt;P&gt;LIMIT 100;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Oct 2024 05:00:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Store-data-into-QVD-saves-timestamp-as-NULL/m-p/2486965#M14231</guid>
      <dc:creator>Vegar</dc:creator>
      <dc:date>2024-10-15T05:00:29Z</dc:date>
    </item>
    <item>
      <title>Re: Store data into QVD saves timestamp as NULL</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Store-data-into-QVD-saves-timestamp-as-NULL/m-p/2487084#M14232</link>
      <description>&lt;P&gt;Hi, the query in a MySQL editor shows there are no nulls. I had a similar problem lately, when Qlik finds an invalid value (this MySQL allows dates as '0000-00-00', I hate it) it starts loading null values instead, but this is not the case (timestamps are valid). I'm gonna try casting to date in the SELECT, and explicitly replacing zero-dates with null and see what happens.&lt;/P&gt;</description>
      <pubDate>Tue, 15 Oct 2024 12:43:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Store-data-into-QVD-saves-timestamp-as-NULL/m-p/2487084#M14232</guid>
      <dc:creator>nicolaslopedebarrios</dc:creator>
      <dc:date>2024-10-15T12:43:21Z</dc:date>
    </item>
    <item>
      <title>Re: Store data into QVD saves timestamp as NULL</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Store-data-into-QVD-saves-timestamp-as-NULL/m-p/2488175#M14240</link>
      <description>&lt;P&gt;As I suspected, Qlik "doesn't like" MySQLs' zero-dates, so using a &lt;STRONG&gt;case when... then&lt;/STRONG&gt; to save '0000-00-00' as NULL for every date column in the SQL statement solved the problem.&lt;/P&gt;</description>
      <pubDate>Mon, 21 Oct 2024 12:44:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Store-data-into-QVD-saves-timestamp-as-NULL/m-p/2488175#M14240</guid>
      <dc:creator>nicolaslopedebarrios</dc:creator>
      <dc:date>2024-10-21T12:44:17Z</dc:date>
    </item>
  </channel>
</rss>

