<?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:Getting values from db during Runtime and storing it in an variable in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Re-Getting-values-from-db-during-Runtime-and-storing-it-in-an/m-p/989336#M956411</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think the reason for the failure is that the variables couldn't fetch a value from your select-table and return therefore NULL. This will be caused that qv ignored your table-statement, see: &lt;A href="https://community.qlik.com/message/896820"&gt;Re: SQL alias for tables in QlikView&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The solution is quite easy - use a preceeding load for this, like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;Table:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;Load *;&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;SELECT&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; test.testtable('IND',9) as currency_IND, &lt;SPAN style="font-size: 8pt;"&gt;test.testtable('USD',9) as currency_USD&lt;/SPAN&gt; FROM DUAL;&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;LET&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;varCurrency&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; = &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Num&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;peek&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;('currency_IND',0,'Table')); &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;LET&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;testvariable&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; = &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Num&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;peek&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;('currency_USD',0,'Table'));&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;DROP&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Table&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; Table; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;trace '$(&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;varCurrency&lt;/EM&gt;&lt;/STRONG&gt;)';&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;If this wasn't only dummy-code you could put both fields into one query. To check various values within the script you could use the trace-statement - it will pop up within the execution window and written within the log-file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 13 Nov 2015 09:54:24 GMT</pubDate>
    <dc:creator>marcus_sommer</dc:creator>
    <dc:date>2015-11-13T09:54:24Z</dc:date>
    <item>
      <title>Re:Getting values from db during Runtime and storing it in an variable</title>
      <link>https://community.qlik.com/t5/QlikView/Re-Getting-values-from-db-during-Runtime-and-storing-it-in-an/m-p/989335#M956410</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; I am actually fetching values from an table and storing it in a variable(I use specific arguments here). I am also fetching values from the same table and store it in an different variable for an different argument.What I did here was I used peek function and stored those two values into two different variables using let function. Now what I need to do is I need to insert this variables inside an query which runs from database.&amp;nbsp; But when I use both the variables in the query it is not returning any values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For instance,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;Table:&lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #0000ff; font-size: 8pt;"&gt;SELECT&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; test.testtable('IND',9) as currency_IND FROM DUAL;&lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #0000ff; font-size: 8pt;"&gt;LET&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 8pt;"&gt;varCurrency&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; = &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Num&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;peek&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;('currency_IND',0,'Table'));&lt;BR /&gt; &lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #0000ff; font-size: 8pt;"&gt;DROP&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Table&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; Table; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;SPAN style="font-size: 8pt;"&gt;Table1:&lt;BR /&gt; &lt;STRONG style=": ; color: #0000ff; font-size: 8pt;"&gt;SELECT&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; test.testtable('USD',9) as currency_USD FROM DUAL;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt; &lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #0000ff; font-size: 8pt;"&gt;LET&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 8pt;"&gt;testvariable&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; = &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Num&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;peek&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;('currency_USD',0,'Table1'));&lt;BR /&gt; &lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #0000ff; font-size: 8pt;"&gt;DROP&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Table&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; Table1; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;Now what I need to do is,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;---this is just an part of the query&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AND ( TAR.test_change_id = ('$(&lt;STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 8pt;"&gt;varCurrency&lt;/EM&gt;&lt;/STRONG&gt;)')&lt;BR /&gt; or TAR.test_change_id = ('$(testvariable)') )&lt;/P&gt;&lt;P&gt;---this is my requirement--- The&amp;nbsp; values should be entered in the query at run time&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But it is not happening. Kindly help me here. Please note that if we enter the value of test_change_id directly it is working and also the values of varcurrency and testvariable will always be one line only.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;BR /&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Nov 2015 06:08:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Re-Getting-values-from-db-during-Runtime-and-storing-it-in-an/m-p/989335#M956410</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-11-13T06:08:23Z</dc:date>
    </item>
    <item>
      <title>Re:Getting values from db during Runtime and storing it in an variable</title>
      <link>https://community.qlik.com/t5/QlikView/Re-Getting-values-from-db-during-Runtime-and-storing-it-in-an/m-p/989336#M956411</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think the reason for the failure is that the variables couldn't fetch a value from your select-table and return therefore NULL. This will be caused that qv ignored your table-statement, see: &lt;A href="https://community.qlik.com/message/896820"&gt;Re: SQL alias for tables in QlikView&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The solution is quite easy - use a preceeding load for this, like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;Table:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;Load *;&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;SELECT&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; test.testtable('IND',9) as currency_IND, &lt;SPAN style="font-size: 8pt;"&gt;test.testtable('USD',9) as currency_USD&lt;/SPAN&gt; FROM DUAL;&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;LET&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;varCurrency&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; = &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Num&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;peek&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;('currency_IND',0,'Table')); &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;LET&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;testvariable&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; = &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Num&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;peek&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;('currency_USD',0,'Table'));&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;DROP&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Table&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; Table; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;trace '$(&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;varCurrency&lt;/EM&gt;&lt;/STRONG&gt;)';&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;If this wasn't only dummy-code you could put both fields into one query. To check various values within the script you could use the trace-statement - it will pop up within the execution window and written within the log-file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Nov 2015 09:54:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Re-Getting-values-from-db-during-Runtime-and-storing-it-in-an/m-p/989336#M956411</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2015-11-13T09:54:24Z</dc:date>
    </item>
    <item>
      <title>Re:Getting values from db during Runtime and storing it in an variable</title>
      <link>https://community.qlik.com/t5/QlikView/Re-Getting-values-from-db-during-Runtime-and-storing-it-in-an/m-p/989337#M956412</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;add some trace for the 2 variables&lt;/P&gt;&lt;P&gt;what's the result of?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;trace varCurrency=$(varCurrency);&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;trace &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;testvariable&lt;/SPAN&gt;=$(&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;testvariable&lt;/SPAN&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Nov 2015 10:04:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Re-Getting-values-from-db-during-Runtime-and-storing-it-in-an/m-p/989337#M956412</guid>
      <dc:creator>maxgro</dc:creator>
      <dc:date>2015-11-13T10:04:00Z</dc:date>
    </item>
    <item>
      <title>Re:Getting values from db during Runtime and storing it in an variable</title>
      <link>https://community.qlik.com/t5/QlikView/Re-Getting-values-from-db-during-Runtime-and-storing-it-in-an/m-p/989338#M956413</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Both,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; It is not working. Actually trace is not fetching any values when running in debug mode also. is there any other way?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Nov 2015 10:56:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Re-Getting-values-from-db-during-Runtime-and-storing-it-in-an/m-p/989338#M956413</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-11-27T10:56:50Z</dc:date>
    </item>
    <item>
      <title>Re:Getting values from db during Runtime and storing it in an variable</title>
      <link>https://community.qlik.com/t5/QlikView/Re-Getting-values-from-db-during-Runtime-and-storing-it-in-an/m-p/989339#M956414</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Comment the drop table out and take a look on the table itself - which fields and values are there?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Nov 2015 12:57:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Re-Getting-values-from-db-during-Runtime-and-storing-it-in-an/m-p/989339#M956414</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2015-11-27T12:57:23Z</dc:date>
    </item>
  </channel>
</rss>

