<?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: Qlik SQL Where WEEK Statement in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Qlik-SQL-Where-WEEK-Statement/m-p/1563943#M597439</link>
    <description>&lt;P&gt;May be you can load all rows first and in field you use week along with num&amp;nbsp; (just to make sure week is giving numeric value) functions to get numeric week value from the time field. Then use this intermediate table to load final table where you are only loading rows with a particular value. I think that may help in performance.&lt;/P&gt;&lt;P&gt;intermediatetable:&lt;/P&gt;&lt;P&gt;LOAD Distinct&lt;BR /&gt;WEEK(TIME_NEW) AS WEEK_LOAD;&lt;/P&gt;&lt;P&gt;finaltable:&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;LOAD&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //distinct may not be needed here as distinct in intermediate table would take care of it&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //or you can remove from there and use it here as per your need&lt;BR /&gt;WEEK_LOAD&lt;BR /&gt;resident intermediatetable&lt;BR /&gt;where WEEK_LOAD = 14;&lt;/P&gt;&lt;P&gt;drop table&amp;nbsp;intermediatetable;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope this helps. You may also want to check/seek online SQL help.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 02 Apr 2019 13:03:53 GMT</pubDate>
    <dc:creator>vvira1316</dc:creator>
    <dc:date>2019-04-02T13:03:53Z</dc:date>
    <item>
      <title>Qlik SQL Where WEEK Statement</title>
      <link>https://community.qlik.com/t5/QlikView/Qlik-SQL-Where-WEEK-Statement/m-p/1563888#M597437</link>
      <description>&lt;P&gt;Hello Community,&lt;/P&gt;&lt;P&gt;in my script the LOAD-Command filters with a Where-Statement for a calender week. But is there a way to move the Where-Statement into the SQL-Statement? My goal is to shorten loading time, because the Where-Statement in the in the LOAD-Command takes a lot of time.&lt;/P&gt;&lt;PRE&gt;&lt;FONT size="2"&gt;LOAD Distinct
    WEEK(TIME_NEW) AS WEEK_LOAD&lt;BR /&gt;&lt;STRIKE&gt;&lt;EM&gt;&lt;STRONG&gt;WHERE WEEK(TIME_NEW) = 14&lt;/STRONG&gt;&lt;/EM&gt;&lt;/STRIKE&gt; //Remove this to the SQL-Statement
;
SQL SELECT 
    TIME_NEW
FROM IN.TEST
&lt;EM&gt;&lt;STRONG&gt;WHERE WEEK(TIME_NEW) = 14&lt;/STRONG&gt;&lt;/EM&gt; //But unfortunately that does not work
;&lt;/FONT&gt;&lt;/PRE&gt;&lt;P&gt;Thanks and see you soon&lt;/P&gt;&lt;P&gt;David &lt;IMG id="cathappy" class="emoticon emoticon-cathappy" src="https://10.236.46.65/i/smilies/16x16_cat-happy.png" alt="Cat Happy" title="Cat Happy" /&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 03:58:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Qlik-SQL-Where-WEEK-Statement/m-p/1563888#M597437</guid>
      <dc:creator>mr_lampert</dc:creator>
      <dc:date>2024-11-16T03:58:53Z</dc:date>
    </item>
    <item>
      <title>Re: Qlik SQL Where WEEK Statement</title>
      <link>https://community.qlik.com/t5/QlikView/Qlik-SQL-Where-WEEK-Statement/m-p/1563926#M597438</link>
      <description>&lt;P&gt;If your db is sql server, you can try using datepart(), like:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;FONT size="2"&gt;SQL SELECT 
    TIME_NEW
FROM IN.TEST
&lt;EM&gt;&lt;STRONG&gt;WHERE &lt;FONT color="#FF0000"&gt;DatePart&lt;/FONT&gt;(&lt;FONT color="#FF0000"&gt;week&lt;/FONT&gt;, TIME_NEW) = 14&lt;/STRONG&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 02 Apr 2019 12:52:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Qlik-SQL-Where-WEEK-Statement/m-p/1563926#M597438</guid>
      <dc:creator>tresB</dc:creator>
      <dc:date>2019-04-02T12:52:47Z</dc:date>
    </item>
    <item>
      <title>Re: Qlik SQL Where WEEK Statement</title>
      <link>https://community.qlik.com/t5/QlikView/Qlik-SQL-Where-WEEK-Statement/m-p/1563943#M597439</link>
      <description>&lt;P&gt;May be you can load all rows first and in field you use week along with num&amp;nbsp; (just to make sure week is giving numeric value) functions to get numeric week value from the time field. Then use this intermediate table to load final table where you are only loading rows with a particular value. I think that may help in performance.&lt;/P&gt;&lt;P&gt;intermediatetable:&lt;/P&gt;&lt;P&gt;LOAD Distinct&lt;BR /&gt;WEEK(TIME_NEW) AS WEEK_LOAD;&lt;/P&gt;&lt;P&gt;finaltable:&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;LOAD&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //distinct may not be needed here as distinct in intermediate table would take care of it&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //or you can remove from there and use it here as per your need&lt;BR /&gt;WEEK_LOAD&lt;BR /&gt;resident intermediatetable&lt;BR /&gt;where WEEK_LOAD = 14;&lt;/P&gt;&lt;P&gt;drop table&amp;nbsp;intermediatetable;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope this helps. You may also want to check/seek online SQL help.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Apr 2019 13:03:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Qlik-SQL-Where-WEEK-Statement/m-p/1563943#M597439</guid>
      <dc:creator>vvira1316</dc:creator>
      <dc:date>2019-04-02T13:03:53Z</dc:date>
    </item>
    <item>
      <title>Re: Qlik SQL Where WEEK Statement</title>
      <link>https://community.qlik.com/t5/QlikView/Qlik-SQL-Where-WEEK-Statement/m-p/1563945#M597440</link>
      <description>&lt;P&gt;Unfortunately not, but you gave me an idea! Because we work with oracle and this works great:&lt;/P&gt;&lt;PRE&gt;TO_CHAR(TO_DATE(TIME_NEU, 'dd.mm.yyyy'), 'WW') = 14 &lt;/PRE&gt;&lt;P&gt;Thanks for the Inspiration! &lt;img id="heart" class="emoticon emoticon-heart" src="https://community.qlik.com/i/smilies/16x16_heart.png" alt="Heart" title="Heart" /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Apr 2019 13:04:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Qlik-SQL-Where-WEEK-Statement/m-p/1563945#M597440</guid>
      <dc:creator>mr_lampert</dc:creator>
      <dc:date>2019-04-02T13:04:39Z</dc:date>
    </item>
  </channel>
</rss>

