<?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 SqlValue in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/SqlValue/m-p/144367#M23314</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;I'm trying to use SqlValue in order todo a select on a database as, even if i ignore it, we can't do a sql query (in an expression) on a resident table into qlikview.&lt;/P&gt;&lt;P&gt;As i want to keep the more flexity as possible, and as my data are quite complex, i can't and i don't want to load this data on the load.&lt;/P&gt;&lt;P&gt;The expression i use is:&lt;/P&gt;&lt;P&gt;=SqlValue('10.20.26.221:7658','q) select VAL from FX where CUR1=`GBP,CUR2 =`EUR,DATE =2009.05.14;','OLEDB')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The "q)" statement is used to do a query on KDB database.&lt;/P&gt;&lt;P&gt;Unfortunately, this sqlValue query gives no result:""and no error.&lt;/P&gt;&lt;P&gt;I so tried to run the same query using the script on the load, which give me the good result:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-weight: bold"&gt;&lt;/P&gt;&lt;P style="font-weight: bold"&gt;CONNECT&lt;/P&gt;&lt;B&gt;TO&lt;/B&gt; [Provider=MSDASQL.1;Persist Security Info=False;Data Source=10.20.26.221:7658;Extended Properties="DRIVER=kdb+;DBQ=10.20.26.221:7658;UID=pricefeedservice;DSN=default;"]; &lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-weight: bold"&gt;&lt;/P&gt;&lt;P style="font-weight: bold"&gt;LOAD&lt;/P&gt;VAL; &lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;B&gt;&lt;/B&gt;&lt;P style="font-weight: bold"&gt;SQL&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;q&lt;/B&gt;)select VAL from FX where CUR1=`GBP,CUR2 =`EUR,DATE =2009.05.14;&lt;/P&gt;&lt;P&gt;It may be a connexion problem but i don't succeed in resolving it.&lt;/P&gt;&lt;P&gt;Has anyone already have some troubles with SqlValue?&lt;/P&gt;&lt;P&gt;Thanks for your help.&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 18 May 2009 22:15:18 GMT</pubDate>
    <dc:creator />
    <dc:date>2009-05-18T22:15:18Z</dc:date>
    <item>
      <title>SqlValue</title>
      <link>https://community.qlik.com/t5/QlikView/SqlValue/m-p/144367#M23314</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;I'm trying to use SqlValue in order todo a select on a database as, even if i ignore it, we can't do a sql query (in an expression) on a resident table into qlikview.&lt;/P&gt;&lt;P&gt;As i want to keep the more flexity as possible, and as my data are quite complex, i can't and i don't want to load this data on the load.&lt;/P&gt;&lt;P&gt;The expression i use is:&lt;/P&gt;&lt;P&gt;=SqlValue('10.20.26.221:7658','q) select VAL from FX where CUR1=`GBP,CUR2 =`EUR,DATE =2009.05.14;','OLEDB')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The "q)" statement is used to do a query on KDB database.&lt;/P&gt;&lt;P&gt;Unfortunately, this sqlValue query gives no result:""and no error.&lt;/P&gt;&lt;P&gt;I so tried to run the same query using the script on the load, which give me the good result:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-weight: bold"&gt;&lt;/P&gt;&lt;P style="font-weight: bold"&gt;CONNECT&lt;/P&gt;&lt;B&gt;TO&lt;/B&gt; [Provider=MSDASQL.1;Persist Security Info=False;Data Source=10.20.26.221:7658;Extended Properties="DRIVER=kdb+;DBQ=10.20.26.221:7658;UID=pricefeedservice;DSN=default;"]; &lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-weight: bold"&gt;&lt;/P&gt;&lt;P style="font-weight: bold"&gt;LOAD&lt;/P&gt;VAL; &lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;B&gt;&lt;/B&gt;&lt;P style="font-weight: bold"&gt;SQL&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;q&lt;/B&gt;)select VAL from FX where CUR1=`GBP,CUR2 =`EUR,DATE =2009.05.14;&lt;/P&gt;&lt;P&gt;It may be a connexion problem but i don't succeed in resolving it.&lt;/P&gt;&lt;P&gt;Has anyone already have some troubles with SqlValue?&lt;/P&gt;&lt;P&gt;Thanks for your help.&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 May 2009 22:15:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/SqlValue/m-p/144367#M23314</guid>
      <dc:creator />
      <dc:date>2009-05-18T22:15:18Z</dc:date>
    </item>
    <item>
      <title>SqlValue</title>
      <link>https://community.qlik.com/t5/QlikView/SqlValue/m-p/144368#M23315</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 think there is something wrong with the qoutes and the WHERE clause. It should be in SQL SELECT statement:&lt;/P&gt;&lt;P&gt;select ... where CUR1='GBP' and CUR2='EUR' and DATE='2009.05.14'; // date format depends on database vendor&lt;/P&gt;&lt;P&gt;and in QV script:&lt;/P&gt;&lt;P&gt;sqlvalue('&amp;lt;ODBC name of the connection&amp;gt;', 'select ... where CUR1='&amp;amp;chr(39)&amp;amp;'GBP'&amp;amp;chr(39)&amp;amp;' and CUR2=&amp;amp;chr(39)&amp;amp;''EUR'&amp;amp;chr(39)&amp;amp;' and DATE=&amp;amp;chr(39)&amp;amp;'2009.05.14'&amp;amp;chr(39))&lt;/P&gt;&lt;P&gt;But SqlValue() only retrievs the first value of the first column. I wouldn't use this, only to check if the connection is working and definitely not as an expression.&lt;/P&gt;&lt;P&gt;Ralf&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 May 2009 23:12:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/SqlValue/m-p/144368#M23315</guid>
      <dc:creator>rbecher</dc:creator>
      <dc:date>2009-05-18T23:12:31Z</dc:date>
    </item>
    <item>
      <title>SqlValue</title>
      <link>https://community.qlik.com/t5/QlikView/SqlValue/m-p/144369#M23316</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;In fact the query must be the one i have written above.&lt;/P&gt;&lt;P&gt;It was not real SQL as the KDB database use it's own langage call "q" which need to have this syntax.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 May 2009 23:21:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/SqlValue/m-p/144369#M23316</guid>
      <dc:creator />
      <dc:date>2009-05-18T23:21:44Z</dc:date>
    </item>
    <item>
      <title>SqlValue</title>
      <link>https://community.qlik.com/t5/QlikView/SqlValue/m-p/144370#M23317</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;..but, you´re sure this also works via ODBC? You could give it a try.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 May 2009 23:44:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/SqlValue/m-p/144370#M23317</guid>
      <dc:creator>rbecher</dc:creator>
      <dc:date>2009-05-18T23:44:47Z</dc:date>
    </item>
    <item>
      <title>SqlValue</title>
      <link>https://community.qlik.com/t5/QlikView/SqlValue/m-p/144371#M23318</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I found the solution.&lt;/P&gt;&lt;P&gt;Everything is righ in my query in fact.&lt;/P&gt;&lt;P&gt;It just seems that for &lt;STRONG&gt;numerical&lt;/STRONG&gt; values, SqlValue return &lt;STRONG&gt;""&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;So if you want to have your value, i foudn a way to do it. You just have to do a calculation using this SqlValue. I mean:&lt;/P&gt;&lt;P&gt;=0+SqlValue(....) or =1*sqlValue(...) or whatever.&lt;/P&gt;&lt;P&gt;However, such a behaviour is really strange.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 May 2009 18:22:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/SqlValue/m-p/144371#M23318</guid>
      <dc:creator />
      <dc:date>2009-05-20T18:22:40Z</dc:date>
    </item>
  </channel>
</rss>

