<?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: SQL Query in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/SQL-Query/m-p/825480#M290756</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can u give me some Sample Query for this..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 26 Nov 2014 16:25:29 GMT</pubDate>
    <dc:creator />
    <dc:date>2014-11-26T16:25:29Z</dc:date>
    <item>
      <title>SQL Query</title>
      <link>https://community.qlik.com/t5/QlikView/SQL-Query/m-p/825478#M290754</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Folk,&lt;/P&gt;&lt;P&gt;I am fetching the data from Sql database where i have to fetch data only for Current week and there is a Field called Date where Date is in Format MM/DD/YYYY HH:MM:SS. so what query i have to write for this so that it will only fetch Current Week Data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanx&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Nov 2014 15:50:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/SQL-Query/m-p/825478#M290754</guid>
      <dc:creator />
      <dc:date>2014-11-26T15:50:48Z</dc:date>
    </item>
    <item>
      <title>Re: SQL Query</title>
      <link>https://community.qlik.com/t5/QlikView/SQL-Query/m-p/825479#M290755</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi vini,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I often had that same question, and I ended up going a diffferent way:&lt;/P&gt;&lt;P&gt;Do you know the "preceding LOAD"? I use that every time I have an SQL query - that way I don't have to bother with writing my filters in the SQL_SELECT, but instead I can write them in the LOAD and use the QlikView_syntax.&lt;/P&gt;&lt;P&gt;The preceding LOAD means there is only one pass of the data, not two as with the RESIDENT LOAD, so that's really about as easy as things can get.&lt;/P&gt;&lt;P&gt;HTH&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DataNibbler&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Nov 2014 16:15:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/SQL-Query/m-p/825479#M290755</guid>
      <dc:creator>datanibbler</dc:creator>
      <dc:date>2014-11-26T16:15:13Z</dc:date>
    </item>
    <item>
      <title>Re: SQL Query</title>
      <link>https://community.qlik.com/t5/QlikView/SQL-Query/m-p/825480#M290756</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can u give me some Sample Query for this..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Nov 2014 16:25:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/SQL-Query/m-p/825480#M290756</guid>
      <dc:creator />
      <dc:date>2014-11-26T16:25:29Z</dc:date>
    </item>
    <item>
      <title>Re: SQL Query</title>
      <link>https://community.qlik.com/t5/QlikView/SQL-Query/m-p/825481#M290757</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi DataNibbler&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You make an interesting point.&lt;/P&gt;&lt;P&gt;I think you're suggesting the SQL SELECT gets all the unfiltered data and you use the LOAD to then filter down to what's required in the QV model? My understanding is that this is less efficient than filtering the data you SQL SELECT as this is the time and resource-consuming process?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyway, I guess Vini needs a hint about how to use WEEK functions in QV?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Nov 2014 16:25:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/SQL-Query/m-p/825481#M290757</guid>
      <dc:creator>richard_chilvers</dc:creator>
      <dc:date>2014-11-26T16:25:43Z</dc:date>
    </item>
    <item>
      <title>Re: SQL Query</title>
      <link>https://community.qlik.com/t5/QlikView/SQL-Query/m-p/825482#M290758</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you could try:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro _jivemacro_uid_14170383218706161 jive_macro_code" jivemacro_uid="_14170383218706161"&gt;
&lt;P&gt;LOAD *&lt;/P&gt;
&lt;P&gt;Where InWeek(Date#(Date,'&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;MM/DD/YYYY hh:mm:ss&lt;/SPAN&gt;'), ToDay(),0);&lt;/P&gt;
&lt;P&gt;SQL SELECT&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SomeFields&lt;/P&gt;
&lt;P&gt;FROM YourDBTable;&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope this helps&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Marco&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Nov 2014 21:47:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/SQL-Query/m-p/825482#M290758</guid>
      <dc:creator>MarcoWedel</dc:creator>
      <dc:date>2014-11-26T21:47:15Z</dc:date>
    </item>
    <item>
      <title>Re: SQL Query</title>
      <link>https://community.qlik.com/t5/QlikView/SQL-Query/m-p/825483#M290759</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The prefered solution might be to implement the where clause in the SQL part due to run time issues&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Nov 2014 23:48:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/SQL-Query/m-p/825483#M290759</guid>
      <dc:creator>MarcoWedel</dc:creator>
      <dc:date>2014-11-26T23:48:44Z</dc:date>
    </item>
    <item>
      <title>Re: SQL Query</title>
      <link>https://community.qlik.com/t5/QlikView/SQL-Query/m-p/825484#M290760</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Fetch current week data by using where condition in SQL itself, it is the best solution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In SQL Server:&lt;/P&gt;&lt;P&gt;Data:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Segoe UI', 'Lucida Grande', Verdana, Arial, Helvetica, sans-serif; color: #0000ff; font-size: 10pt;"&gt;SELECT&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Segoe UI', 'Lucida Grande', Verdana, Arial, Helvetica, sans-serif; color: #333333; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Segoe UI', 'Lucida Grande', Verdana, Arial, Helvetica, sans-serif; color: #333333; font-size: 10pt;"&gt;*&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Segoe UI', 'Lucida Grande', Verdana, Arial, Helvetica, sans-serif; color: #333333; font-size: 10pt;"&gt;FROM TableName&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Segoe UI', 'Lucida Grande', Verdana, Arial, Helvetica, sans-serif; color: #333333; font-size: 10pt;"&gt;WHERE DATEPART( wk , &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Segoe UI', 'Lucida Grande', Verdana, Arial, Helvetica, sans-serif; color: #ff0000; font-size: 10pt;"&gt;DateFieldName&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Segoe UI', 'Lucida Grande', Verdana, Arial, Helvetica, sans-serif; color: #333333; font-size: 10pt;"&gt;) =&amp;nbsp; DATEPART(wk, GetDate());&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Segoe UI', 'Lucida Grande', Verdana, Arial, Helvetica, sans-serif; color: #333333; font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Segoe UI', 'Lucida Grande', Verdana, Arial, Helvetica, sans-serif; color: #333333; font-size: 10pt;"&gt;In Oracle:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Data:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Segoe UI', 'Lucida Grande', Verdana, Arial, Helvetica, sans-serif; color: #0000ff; font-size: 10pt;"&gt;SELECT&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Segoe UI', 'Lucida Grande', Verdana, Arial, Helvetica, sans-serif; color: #333333; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Segoe UI', 'Lucida Grande', Verdana, Arial, Helvetica, sans-serif; color: #333333; font-size: 10pt;"&gt;*&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Segoe UI', 'Lucida Grande', Verdana, Arial, Helvetica, sans-serif; color: #333333; font-size: 10pt;"&gt;FROM TableName&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Segoe UI', 'Lucida Grande', Verdana, Arial, Helvetica, sans-serif; color: #333333; font-size: 10pt;"&gt;WHERE &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Segoe UI', 'Lucida Grande', Verdana, Arial, Helvetica, sans-serif; color: #333333; font-size: 10pt;"&gt;&lt;CODE style="font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif; background-position: initial;"&gt;&lt;SPAN class="pln" style="background: transparent;"&gt;to_char&lt;/SPAN&gt;&lt;SPAN class="pun" style="background: transparent;"&gt;(&lt;SPAN style="color: #ff0000; font-family: 'Segoe UI', 'Lucida Grande', Verdana, Arial, Helvetica, sans-serif;"&gt;DateFieldName&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="pun" style="background: transparent;"&gt;,&lt;/SPAN&gt;&lt;SPAN class="str" style="color: #800000; background: transparent;"&gt;'WW'&lt;/SPAN&gt;&lt;SPAN class="pun" style="background: transparent;"&gt;&lt;SPAN style="color: #333333; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif;"&gt;) = &lt;/SPAN&gt;&lt;SPAN class="pln" style="background: transparent;"&gt;to_char&lt;/SPAN&gt;&lt;SPAN class="pun" style="background: transparent;"&gt;&lt;SPAN style="color: #333333; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #ff0000; font-family: 'Segoe UI', 'Lucida Grande', Verdana, Arial, Helvetica, sans-serif;"&gt;SYSDATE&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="pun" style="background: transparent;"&gt;,&lt;/SPAN&gt;&lt;SPAN class="str" style="color: #800000; background: transparent;"&gt;'WW'&lt;/SPAN&gt;&lt;SPAN class="pun" style="background: transparent;"&gt;);&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Segoe UI', 'Lucida Grande', Verdana, Arial, Helvetica, sans-serif; color: #333333; font-size: 10pt;"&gt;&lt;SPAN class="pun" style="background: transparent;"&gt;&lt;SPAN class="pun" style="background: transparent;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Segoe UI', 'Lucida Grande', Verdana, Arial, Helvetica, sans-serif; color: #333333; font-size: 10pt;"&gt;&lt;SPAN class="pun" style="background: transparent;"&gt;&lt;SPAN class="pun" style="background: transparent;"&gt;Note: Replace &lt;SPAN style="color: #ff0000; font-family: 'Segoe UI', 'Lucida Grande', Verdana, Arial, Helvetica, sans-serif;"&gt;DateFieldName with your actual date field name in table.&lt;/SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Segoe UI', 'Lucida Grande', Verdana, Arial, Helvetica, sans-serif; color: #333333; font-size: 10pt;"&gt;&lt;SPAN class="pun" style="background: transparent;"&gt;&lt;SPAN class="pun" style="background: transparent;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Segoe UI', 'Lucida Grande', Verdana, Arial, Helvetica, sans-serif; color: #333333; font-size: 10pt;"&gt;&lt;SPAN class="pun" style="background: transparent;"&gt;&lt;SPAN class="pun" style="background: transparent;"&gt;If you are not using ORacle or SQL Server then check for corresponding date functions.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Segoe UI', 'Lucida Grande', Verdana, Arial, Helvetica, sans-serif; color: #333333; font-size: 10pt;"&gt;&lt;SPAN class="pun" style="background: transparent;"&gt;&lt;SPAN class="pun" style="background: transparent;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Segoe UI', 'Lucida Grande', Verdana, Arial, Helvetica, sans-serif; color: #333333; font-size: 10pt;"&gt;&lt;SPAN class="pun" style="background: transparent;"&gt;&lt;SPAN class="pun" style="background: transparent;"&gt;Hope this helps you.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Segoe UI', 'Lucida Grande', Verdana, Arial, Helvetica, sans-serif; color: #333333; font-size: 10pt;"&gt;&lt;SPAN class="pun" style="background: transparent;"&gt;&lt;SPAN class="pun" style="background: transparent;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Segoe UI', 'Lucida Grande', Verdana, Arial, Helvetica, sans-serif; color: #333333; font-size: 10pt;"&gt;&lt;SPAN class="pun" style="background: transparent;"&gt;&lt;SPAN class="pun" style="background: transparent;"&gt;Regards,&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Segoe UI', 'Lucida Grande', Verdana, Arial, Helvetica, sans-serif; color: #333333; font-size: 10pt;"&gt;&lt;SPAN class="pun" style="background: transparent;"&gt;&lt;SPAN class="pun" style="background: transparent;"&gt;Jagan.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Nov 2014 03:03:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/SQL-Query/m-p/825484#M290760</guid>
      <dc:creator>jagan</dc:creator>
      <dc:date>2014-11-27T03:03:44Z</dc:date>
    </item>
  </channel>
</rss>

