<?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: Load Date Range via SQL in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Load-Date-Range-via-SQL/m-p/996053#M974398</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try your expression with this new one:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Sum(&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; If(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;DATERUN_Asset_Status&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &amp;gt;= &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Date&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Today&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;()-30, 1, 0))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;let me know &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 08 Sep 2015 10:59:08 GMT</pubDate>
    <dc:creator>alexandros17</dc:creator>
    <dc:date>2015-09-08T10:59:08Z</dc:date>
    <item>
      <title>Load Date Range via SQL</title>
      <link>https://community.qlik.com/t5/QlikView/Load-Date-Range-via-SQL/m-p/996052#M974397</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;I've been trying to load the last 30 days worth of data from a database table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I first tried loading all of the dates, and then in my chart expression using:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;DATERUN&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &amp;gt;= &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Date&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Today&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;()-30) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This &lt;STRONG&gt;does&lt;/STRONG&gt; work in a straight table, but not in my chart where the expression is =Asset_Count&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to maybe combine the two, perhaps with a where clause, to something like this in my chart:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;=Asset_Count&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; where (&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;DATERUN&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &amp;gt;= &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Date&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Today&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;()-30)) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The &lt;STRONG&gt;better&lt;/STRONG&gt; option will be for me to instead load the data in the script to the past 30 days.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Although this query works in my DB it does not in QlikView, any ideas why this could be?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;SQL&lt;/P&gt;&lt;P&gt;SELECT DATERUN&lt;/P&gt;&lt;P&gt;FROM XYZ&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;STRONG&gt;Where DATERUN = current date - 30 days;&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help on either/both of these problems would be much appreciated!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;Tristan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Sep 2015 10:55:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Load-Date-Range-via-SQL/m-p/996052#M974397</guid>
      <dc:creator />
      <dc:date>2015-09-08T10:55:28Z</dc:date>
    </item>
    <item>
      <title>Re: Load Date Range via SQL</title>
      <link>https://community.qlik.com/t5/QlikView/Load-Date-Range-via-SQL/m-p/996053#M974398</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try your expression with this new one:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Sum(&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; If(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;DATERUN_Asset_Status&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &amp;gt;= &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Date&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Today&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;()-30, 1, 0))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;let me know &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Sep 2015 10:59:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Load-Date-Range-via-SQL/m-p/996053#M974398</guid>
      <dc:creator>alexandros17</dc:creator>
      <dc:date>2015-09-08T10:59:08Z</dc:date>
    </item>
    <item>
      <title>Re: Load Date Range via SQL</title>
      <link>https://community.qlik.com/t5/QlikView/Load-Date-Range-via-SQL/m-p/996054#M974399</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Perhaps, something like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=Count ({&amp;lt;DATERUN {"&amp;gt;= Date(Today()-30)"} &amp;gt; } DATERUN_Asset_Status)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If doesn't help, try to share a sample qvw explaining the expected output.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Sep 2015 11:01:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Load-Date-Range-via-SQL/m-p/996054#M974399</guid>
      <dc:creator>tresB</dc:creator>
      <dc:date>2015-09-08T11:01:03Z</dc:date>
    </item>
    <item>
      <title>Re: Load Date Range via SQL</title>
      <link>https://community.qlik.com/t5/QlikView/Load-Date-Range-via-SQL/m-p/996055#M974400</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;let vTargetDate=Date(Today(1)-30,'&lt;STRONG&gt;YYYY-MM-DD&lt;/STRONG&gt;');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;please note that the above formated code must be changed to match your db date format&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SQL&lt;/P&gt;&lt;P&gt;SELECT DATERUN&lt;/P&gt;&lt;P&gt;FROM XYZ&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Where DATERUN =&lt;STRONG&gt; '$(vTargetDate)';&lt;/STRONG&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;&lt;SPAN style="font-size: 10pt;"&gt;hth&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Sasi&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Sep 2015 11:24:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Load-Date-Range-via-SQL/m-p/996055#M974400</guid>
      <dc:creator>sasiparupudi1</dc:creator>
      <dc:date>2015-09-08T11:24:57Z</dc:date>
    </item>
    <item>
      <title>Re: Load Date Range via SQL</title>
      <link>https://community.qlik.com/t5/QlikView/Load-Date-Range-via-SQL/m-p/996056#M974401</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the reply!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've updated the description, I meant 'Count' as a variable as opposed to a function, if that makes a difference?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If not I'll try and update an example.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Sep 2015 11:42:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Load-Date-Range-via-SQL/m-p/996056#M974401</guid>
      <dc:creator />
      <dc:date>2015-09-08T11:42:21Z</dc:date>
    </item>
    <item>
      <title>Re: Load Date Range via SQL</title>
      <link>https://community.qlik.com/t5/QlikView/Load-Date-Range-via-SQL/m-p/996057#M974402</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your answer Sasidhar, it didn't throw any errors but I couldn't get it to work either. Could it be that my db is an IBM AS400?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Sep 2015 11:43:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Load-Date-Range-via-SQL/m-p/996057#M974402</guid>
      <dc:creator />
      <dc:date>2015-09-08T11:43:41Z</dc:date>
    </item>
  </channel>
</rss>

