<?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: Stored Procedure in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Stored-Procedure/m-p/860351#M652922</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You could only use these functions and syntax within your sql-statement which the database and the odbc-driver support. I would it try something easier like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Load *;&lt;/P&gt;&lt;P&gt;SQL SELECT YourFields From YourProcedure;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 13 Jul 2015 12:34:23 GMT</pubDate>
    <dc:creator>marcus_sommer</dc:creator>
    <dc:date>2015-07-13T12:34:23Z</dc:date>
    <item>
      <title>Stored Procedure</title>
      <link>https://community.qlik.com/t5/QlikView/Stored-Procedure/m-p/860350#M652921</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I want to load data from stored procedure into qlikview.&lt;/P&gt;&lt;P&gt;the SP gets an input (date) and returns AgencyId and HotelId.&lt;/P&gt;&lt;P&gt;I created an ODBC connection and then:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SP:&lt;/P&gt;&lt;P&gt;sql&lt;/P&gt;&lt;P&gt;DECLARE @d date = getdate()-1&lt;/P&gt;&lt;P&gt;EXEC sp_WhiteDots @d;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the sql script works in Microsoft SQL server.&lt;/P&gt;&lt;P&gt;but there are no results in qlikview (no errors either).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i also tried :&lt;/P&gt;&lt;P&gt;load AgencyId, HotelId;&lt;/P&gt;&lt;P&gt;sql&lt;/P&gt;&lt;P&gt;DECLARE @d date = getdate()-1&lt;/P&gt;&lt;P&gt;EXEC sp_WhiteDots @d;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but then i got this error :&lt;/P&gt;&lt;P&gt;Field not found - &amp;lt;AgencyId&amp;gt;&lt;/P&gt;&lt;P&gt;sql&lt;/P&gt;&lt;P&gt;DECLARE @d date = getdate()-1&lt;/P&gt;&lt;P&gt;EXEC sp_WhiteDots @d&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;help please! &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Jul 2015 12:04:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Stored-Procedure/m-p/860350#M652921</guid>
      <dc:creator />
      <dc:date>2015-07-13T12:04:36Z</dc:date>
    </item>
    <item>
      <title>Re: Stored Procedure</title>
      <link>https://community.qlik.com/t5/QlikView/Stored-Procedure/m-p/860351#M652922</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You could only use these functions and syntax within your sql-statement which the database and the odbc-driver support. I would it try something easier like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Load *;&lt;/P&gt;&lt;P&gt;SQL SELECT YourFields From YourProcedure;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Jul 2015 12:34:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Stored-Procedure/m-p/860351#M652922</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2015-07-13T12:34:23Z</dc:date>
    </item>
    <item>
      <title>Re: Stored Procedure</title>
      <link>https://community.qlik.com/t5/QlikView/Stored-Procedure/m-p/860352#M652923</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 would suggest create a QlikView variable to hold DECLARE @d date = getdate()-1 and pass the variable into your SQL&lt;/P&gt;&lt;P&gt;EXEC sp_WhiteDots @d.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this help&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Jul 2015 16:11:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Stored-Procedure/m-p/860352#M652923</guid>
      <dc:creator>Gabriel</dc:creator>
      <dc:date>2015-07-13T16:11:09Z</dc:date>
    </item>
    <item>
      <title>Re: Stored Procedure</title>
      <link>https://community.qlik.com/t5/QlikView/Stored-Procedure/m-p/860353#M652924</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;let var= date(today()-1, 'YYYYMMDD');&lt;/P&gt;&lt;P&gt;trace var=$(var);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;T:&lt;/P&gt;&lt;P&gt;load *;&lt;/P&gt;&lt;P&gt;sql execute &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;sp_WhiteDots&lt;/SPAN&gt; '$(var)';&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Jul 2015 16:28:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Stored-Procedure/m-p/860353#M652924</guid>
      <dc:creator>maxgro</dc:creator>
      <dc:date>2015-07-13T16:28:34Z</dc:date>
    </item>
    <item>
      <title>Re: Stored Procedure</title>
      <link>https://community.qlik.com/t5/QlikView/Stored-Procedure/m-p/860354#M652925</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please see the below script:&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/92705_Capture.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As you can see I created a variable called vParam which is equivalent of GETDATE() - 1. Although, pay attention to the date format 'YYYY-MM-DD', this is SQL Server default date format.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The original table had the below data:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture3.PNG" class="jive-image image-2" src="https://community.qlik.com/legacyfs/online/92706_Capture3.PNG" style="height: auto;" /&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After I ran the QV script, I got the below results which gave every record that didn't have today's date:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture2.PNG" class="jive-image image-3" src="https://community.qlik.com/legacyfs/online/92707_Capture2.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And here is my stored procedure for this exercise:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture4.PNG" class="image-4 jive-image" src="https://community.qlik.com/legacyfs/online/92708_Capture4.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope this helps.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Jul 2015 16:29:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Stored-Procedure/m-p/860354#M652925</guid>
      <dc:creator>sinanozdemir</dc:creator>
      <dc:date>2015-07-13T16:29:11Z</dc:date>
    </item>
  </channel>
</rss>

