<?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 Loading Reult Of SQL query into Variable to be used in connection string in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Loading-Reult-Of-SQL-query-into-Variable-to-be-used-in/m-p/632302#M678594</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI I am trying to use the reult of a query (A database name) into a qlikview varible so that I can then use it to create a connection string to that databse.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Below is an example of what I have been trying. Any ideas how to load the result of a SQL query into a variable &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CONNECT TO [Provider=SQLOLEDB.1;Integrated Security=SSPI;Initial Catalog='Qlikview_MiltipleDBsTest1';Data Source=$(Vdatasource)];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DatabaseName: SQL SELECT top 1 DatabaseName&amp;nbsp; FROM dbo.COnfigurations&amp;nbsp; ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LET&amp;nbsp; VdatabaseName =&amp;nbsp; [DatabaseName.DatabaseName]&amp;nbsp; ; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DISCONNECT ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CONNECT TO [Provider=SQLOLEDB.1;Integrated Security=SSPI;Initial Catalog=$(VDatabaseName);Data Source='LGA1']&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for any help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 29 May 2014 10:58:51 GMT</pubDate>
    <dc:creator />
    <dc:date>2014-05-29T10:58:51Z</dc:date>
    <item>
      <title>Loading Reult Of SQL query into Variable to be used in connection string</title>
      <link>https://community.qlik.com/t5/QlikView/Loading-Reult-Of-SQL-query-into-Variable-to-be-used-in/m-p/632302#M678594</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI I am trying to use the reult of a query (A database name) into a qlikview varible so that I can then use it to create a connection string to that databse.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Below is an example of what I have been trying. Any ideas how to load the result of a SQL query into a variable &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CONNECT TO [Provider=SQLOLEDB.1;Integrated Security=SSPI;Initial Catalog='Qlikview_MiltipleDBsTest1';Data Source=$(Vdatasource)];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DatabaseName: SQL SELECT top 1 DatabaseName&amp;nbsp; FROM dbo.COnfigurations&amp;nbsp; ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LET&amp;nbsp; VdatabaseName =&amp;nbsp; [DatabaseName.DatabaseName]&amp;nbsp; ; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DISCONNECT ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CONNECT TO [Provider=SQLOLEDB.1;Integrated Security=SSPI;Initial Catalog=$(VDatabaseName);Data Source='LGA1']&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for any help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 May 2014 10:58:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Loading-Reult-Of-SQL-query-into-Variable-to-be-used-in/m-p/632302#M678594</guid>
      <dc:creator />
      <dc:date>2014-05-29T10:58:51Z</dc:date>
    </item>
    <item>
      <title>Re: Loading Reult Of SQL query into Variable to be used in connection string</title>
      <link>https://community.qlik.com/t5/QlikView/Loading-Reult-Of-SQL-query-into-Variable-to-be-used-in/m-p/632303#M678595</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Change the line to set the variable to this:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;LET&amp;nbsp; VdatabaseName = peek( 'DatabaseName','DatabaseName')&amp;nbsp; ;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 May 2014 11:03:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Loading-Reult-Of-SQL-query-into-Variable-to-be-used-in/m-p/632303#M678595</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2014-05-29T11:03:13Z</dc:date>
    </item>
    <item>
      <title>Re: Loading Reult Of SQL query into Variable to be used in connection string</title>
      <link>https://community.qlik.com/t5/QlikView/Loading-Reult-Of-SQL-query-into-Variable-to-be-used-in/m-p/632304#M678596</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Still not working though. I have created a text box on a tab to display the variable value but it is not being populated and I do not think the variable is being asssigned correctly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Was not sure if the variable persists after run time or not so tried to pull data from a table in the databse and got an error connecting to the table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a way to view the variable value at runtime?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 May 2014 11:11:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Loading-Reult-Of-SQL-query-into-Variable-to-be-used-in/m-p/632304#M678596</guid>
      <dc:creator />
      <dc:date>2014-05-29T11:11:56Z</dc:date>
    </item>
    <item>
      <title>Re: Loading Reult Of SQL query into Variable to be used in connection string</title>
      <link>https://community.qlik.com/t5/QlikView/Loading-Reult-Of-SQL-query-into-Variable-to-be-used-in/m-p/632305#M678597</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, use &lt;STRONG&gt;Trace&lt;/STRONG&gt; statement, like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Trace $(YourVariable);&lt;/P&gt;&lt;P&gt;Sleep(2000);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note: variable value persists after load if not cleared forcefully.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 May 2014 11:16:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Loading-Reult-Of-SQL-query-into-Variable-to-be-used-in/m-p/632305#M678597</guid>
      <dc:creator>tresB</dc:creator>
      <dc:date>2014-05-29T11:16:06Z</dc:date>
    </item>
    <item>
      <title>Re: Loading Reult Of SQL query into Variable to be used in connection string</title>
      <link>https://community.qlik.com/t5/QlikView/Loading-Reult-Of-SQL-query-into-Variable-to-be-used-in/m-p/632306#M678598</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try Using Trace In first connection ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Chinni Kanna&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 May 2014 11:20:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Loading-Reult-Of-SQL-query-into-Variable-to-be-used-in/m-p/632306#M678598</guid>
      <dc:creator />
      <dc:date>2014-05-29T11:20:46Z</dc:date>
    </item>
    <item>
      <title>Re: Loading Reult Of SQL query into Variable to be used in connection string</title>
      <link>https://community.qlik.com/t5/QlikView/Loading-Reult-Of-SQL-query-into-Variable-to-be-used-in/m-p/632307#M678599</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the help but the varible is populating as Blank. I have displayed the field though and is being populated correctly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any other ideas?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 May 2014 13:06:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Loading-Reult-Of-SQL-query-into-Variable-to-be-used-in/m-p/632307#M678599</guid>
      <dc:creator />
      <dc:date>2014-05-29T13:06:19Z</dc:date>
    </item>
    <item>
      <title>Re: Loading Reult Of SQL query into Variable to be used in connection string</title>
      <link>https://community.qlik.com/t5/QlikView/Loading-Reult-Of-SQL-query-into-Variable-to-be-used-in/m-p/632308#M678600</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please check the below query return the value ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;DatabaseName: &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;SQL SELECT top 1 DatabaseName&amp;nbsp; FROM dbo.COnfigurations&amp;nbsp; ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;If yes, try below &lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;CONNECT TO [Provider=SQLOLEDB.1;Integrated Security=SSPI;Initial Catalog='Qlikview_MiltipleDBsTest1';Data Source=&lt;STRONG&gt;'$(Vdatasource)'&lt;/STRONG&gt;];&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 May 2014 14:08:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Loading-Reult-Of-SQL-query-into-Variable-to-be-used-in/m-p/632308#M678600</guid>
      <dc:creator />
      <dc:date>2014-05-29T14:08:15Z</dc:date>
    </item>
    <item>
      <title>Re: Loading Reult Of SQL query into Variable to be used in connection string</title>
      <link>https://community.qlik.com/t5/QlikView/Loading-Reult-Of-SQL-query-into-Variable-to-be-used-in/m-p/632309#M678601</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to create a variable for the databse name I already have it working with a qvs file for the server name but need to read the database name from a sql table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The query does return the correct databasename and it is a valid database.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue',Helvetica,Arial,'Lucida Grande',sans-serif;"&gt;CONNECT TO [Provider=SQLOLEDB.1;Integrated Security=SSPI;Initial Catalog=&lt;STRONG&gt;'$(VDatabaseName)&lt;/STRONG&gt;';Data Source=&lt;STRONG&gt;'$(Vdatasource)'&lt;/STRONG&gt;]&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue',Helvetica,Arial,'Lucida Grande',sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue',Helvetica,Arial,'Lucida Grande',sans-serif;"&gt;But i can not get the value from the query into the variable &lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue',Helvetica,Arial,'Lucida Grande',sans-serif;"&gt;&lt;STRONG&gt;'$(VDatabaseName)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue',Helvetica,Arial,'Lucida Grande',sans-serif;"&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue',Helvetica,Arial,'Lucida Grande',sans-serif;"&gt;&lt;STRONG&gt;Thanks &lt;BR /&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 May 2014 14:16:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Loading-Reult-Of-SQL-query-into-Variable-to-be-used-in/m-p/632309#M678601</guid>
      <dc:creator />
      <dc:date>2014-05-29T14:16:31Z</dc:date>
    </item>
  </channel>
</rss>

