<?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: How to use declare, set variable and with clause in qlikview scripting using sql query in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/How-to-use-declare-set-variable-and-with-clause-in-qlikview/m-p/1401258#M818967</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Have a look here - &lt;A href="http://www.qlikviewaddict.com/2012/02/set-vs-let.html" title="http://www.qlikviewaddict.com/2012/02/set-vs-let.html"&gt;QlikView Addict: SET vs. LET&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 15 Aug 2017 11:35:09 GMT</pubDate>
    <dc:creator>Anil_Babu_Samineni</dc:creator>
    <dc:date>2017-08-15T11:35:09Z</dc:date>
    <item>
      <title>How to use declare, set variable and with clause in qlikview scripting using sql query</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-use-declare-set-variable-and-with-clause-in-qlikview/m-p/1401257#M818966</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm using sql query to get the data from sql database to qlikview document. After set variable query is not executing.&lt;/P&gt;&lt;P&gt;My query as like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;declare @clients as varchar(200);&lt;/P&gt;&lt;P&gt;set @clients='test123 test345 test567';&lt;/P&gt;&lt;P&gt;with cnees (cnor,cnee,cont,con) as (&lt;/P&gt;&lt;P&gt;select&lt;/P&gt;&lt;P&gt;distinct&lt;/P&gt;&lt;P&gt;ship_consignor = js.NKConsignor&lt;/P&gt;&lt;P&gt;,ship_consignee = js.SKConsignee&lt;/P&gt;&lt;P&gt;,jc_conum&lt;/P&gt;&lt;P&gt;,jk_uniqueref&lt;/P&gt;&lt;P&gt;from table1 js&lt;/P&gt;&lt;P&gt;where (@clients = '' or charindex(js.oh_code,@clients, 0)!=0)&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;select&lt;/P&gt;&lt;P&gt;container&lt;/P&gt;&lt;P&gt;,size&lt;/P&gt;&lt;P&gt;,wgt&lt;/P&gt;&lt;P&gt;,vol&lt;/P&gt;&lt;P&gt;from (&lt;/P&gt;&lt;P&gt;select&lt;/P&gt;&lt;P&gt;container&lt;/P&gt;&lt;P&gt;,size=min(cont_size)&lt;/P&gt;&lt;P&gt;,wgt=sum(wgt)&lt;/P&gt;&lt;P&gt;,vol=sum(vol)&lt;/P&gt;&lt;P&gt;from&lt;/P&gt;&lt;P&gt;(select&lt;/P&gt;&lt;P&gt;wgt=packsbycontainer.weights&lt;/P&gt;&lt;P&gt;,vol=packsbycontainer.volumes&lt;/P&gt;&lt;P&gt;,container=packsbycontainer.jc_containernum&lt;/P&gt;&lt;P&gt;,cont_size=packsbycontainer.rc_code&lt;/P&gt;&lt;P&gt;from table1 js&lt;/P&gt;&lt;P&gt;where (@clients = '' or charindex(localclient.oh_code,@clients, 0)!=0)&lt;/P&gt;&lt;P&gt;) js&lt;/P&gt;&lt;P&gt;group by container&lt;/P&gt;&lt;P&gt;)test;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;ASHOK&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-use-declare-set-variable-and-with-clause-in-qlikview/m-p/1401257#M818966</guid>
      <dc:creator>ashokpaladugula</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to use declare, set variable and with clause in qlikview scripting using sql query</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-use-declare-set-variable-and-with-clause-in-qlikview/m-p/1401258#M818967</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Have a look here - &lt;A href="http://www.qlikviewaddict.com/2012/02/set-vs-let.html" title="http://www.qlikviewaddict.com/2012/02/set-vs-let.html"&gt;QlikView Addict: SET vs. LET&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Aug 2017 11:35:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-use-declare-set-variable-and-with-clause-in-qlikview/m-p/1401258#M818967</guid>
      <dc:creator>Anil_Babu_Samineni</dc:creator>
      <dc:date>2017-08-15T11:35:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to use declare, set variable and with clause in qlikview scripting using sql query</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-use-declare-set-variable-and-with-clause-in-qlikview/m-p/1401259#M818968</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The problem with a SQL CTE (WITH keyword) is that it needs to be preceded by a ; (semi-colon). This also serves to terminate the SQL statement, so the WITH() never get executed. Unless someone else has a direct workaround, you may need to encapsulate the CTE query (including the declares) in a view or a stored proc to run the CTE query from QV.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Aug 2017 12:18:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-use-declare-set-variable-and-with-clause-in-qlikview/m-p/1401259#M818968</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2017-08-15T12:18:48Z</dc:date>
    </item>
  </channel>
</rss>

