<?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: Problem with the execution of SQL (SELECT UNION) in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Problem-with-the-execution-of-SQL-SELECT-UNION/m-p/814869#M287422</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Giovanni,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I guess you mean this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #666666; font-family: 'Helvetica','sans-serif'; font-size: 10.5pt;"&gt;SQL select sum (Importo) &lt;SPAN style="color: #666666; font-family: 'Helvetica','sans-serif'; font-size: 10.5pt;"&gt;as Residuo &lt;/SPAN&gt;from &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #666666; font-family: 'Helvetica','sans-serif'; font-size: 10.5pt;"&gt;(SELECT sum(FIELD_1) as Importo from $(library_path) where FIELD_2= 117030 and FIELD_5= 'D' &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #666666; font-family: 'Helvetica','sans-serif'; font-size: 10.5pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; union&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #666666; font-family: 'Helvetica','sans-serif'; font-size: 10.5pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SELECT sum (FIELD_1)*-1 as Importo from $(library_path) where FIELD_2= 117030 and FIELD_5= 'A') &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But I have no idea what you preceding load is about (?)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 16 Feb 2015 14:46:39 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2015-02-16T14:46:39Z</dc:date>
    <item>
      <title>Problem with the execution of SQL (SELECT UNION)</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-the-execution-of-SQL-SELECT-UNION/m-p/814862#M287415</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; &lt;SPAN class="hps"&gt;&lt;SPAN lang="EN" style="font-size: 10.5pt; font-family: 'Helvetica','sans-serif'; color: #666666;"&gt;Good morning&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN" style="font-size: 10.5pt; font-family: 'Helvetica','sans-serif'; color: #666666;"&gt;, &lt;SPAN class="hps"&gt;I have&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;the following problem&lt;/SPAN&gt;:&lt;BR /&gt; &lt;SPAN class="hps"&gt;Use&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;the following code&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.5pt; font-family: 'Helvetica','sans-serif'; color: #666666;"&gt;Importi:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.5pt; font-family: 'Helvetica','sans-serif'; color: #666666;"&gt;LOAD &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.5pt; font-family: 'Helvetica','sans-serif'; color: #666666;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; FIELD_1,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.5pt; font-family: 'Helvetica','sans-serif'; color: #666666;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; FIELD_2,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.5pt; font-family: 'Helvetica','sans-serif'; color: #666666;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; FIELD_3,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.5pt; font-family: 'Helvetica','sans-serif'; color: #666666;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; FIELD_4,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.5pt; font-family: 'Helvetica','sans-serif'; color: #666666;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; FIELD_5;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.5pt; font-family: 'Helvetica','sans-serif'; color: #666666;"&gt;SQL select sum (Importo) from &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.5pt; font-family: 'Helvetica','sans-serif'; color: #666666;"&gt;(SELECT sum(FIELD_1) as Importo from $(library_path) where FIELD_2= 117030 and FIELD_5= 'D' &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.5pt; font-family: 'Helvetica','sans-serif'; color: #666666;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; union&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.5pt; font-family: 'Helvetica','sans-serif'; color: #666666;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SELECT sum (FIELD_1)*-1 as Importo from $(library_path) where FIELD_2= 117030 and FIELD_5= 'A') &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.5pt; font-family: 'Helvetica','sans-serif'; color: #666666;"&gt;as Residuo from $(library_path);&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: 10.5pt; font-family: 'Helvetica','sans-serif'; color: #666666;"&gt;But when I execute thce code I receive the following message:&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: 10.5pt; font-family: 'Helvetica','sans-serif'; color: #666666;"&gt;SQL##f - SqlState: 37000, ErrorCode: 4294967097, ErrorMsg: [IBM][&lt;/SPAN&gt;&lt;SPAN class="hps"&gt;&lt;SPAN lang="EN" style="font-size: 10.5pt; font-family: 'Helvetica','sans-serif'; color: #666666;"&gt;ODBC driver&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;&lt;SPAN lang="EN" style="font-size: 10.5pt; font-family: 'Helvetica','sans-serif'; color: #666666;"&gt;for&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;&lt;SPAN lang="EN" style="font-size: 10.5pt; font-family: 'Helvetica','sans-serif'; color: #666666;"&gt;the System i&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;&lt;SPAN lang="EN" style="font-size: 10.5pt; font-family: 'Helvetica','sans-serif'; color: #666666;"&gt;Access&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.5pt; font-family: 'Helvetica','sans-serif'; color: #666666;"&gt;] [DB2 for i5/OS]SQL0199 - .&lt;/SPAN&gt;&lt;STRONG&gt;&lt;SPAN lang="EN" style="font-size: 10.5pt; font-family: 'Helvetica','sans-serif'; color: #666666;"&gt;FROM&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN class="hps"&gt;&lt;SPAN lang="EN" style="font-size: 10.5pt; font-family: 'Helvetica','sans-serif'; color: #666666;"&gt; keyword&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;&lt;SPAN lang="EN" style="font-size: 10.5pt; font-family: 'Helvetica','sans-serif'; color: #666666;"&gt;not provided.&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;SPAN style="font-size: 10.5pt; font-family: 'Helvetica','sans-serif'; color: #666666;"&gt;Valid Token: FOR SKIP WITH FETCH ORDER UNION EXCEPT OPTIMIZE.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.5pt; font-family: 'Helvetica','sans-serif'; color: #666666;"&gt;SQL select sum (Importo) from &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.5pt; font-family: 'Helvetica','sans-serif'; color: #666666;"&gt;(SELECT sum(CNRATA) as Importo from &lt;SPAN style="font-size: 10.5pt; font-family: 'Helvetica','sans-serif'; color: #666666;"&gt;............&lt;/SPAN&gt;where CNCLIE = 117030 and CNDAVE = 'D' &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.5pt; font-family: 'Helvetica','sans-serif'; color: #666666;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; union&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.5pt; font-family: 'Helvetica','sans-serif'; color: #666666;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SELECT sum (CNRATA)*-1 as Importo from ............where CNCLIE = 117030 and CNDAVE = 'A') &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.5pt; font-family: 'Helvetica','sans-serif'; color: #666666;"&gt;as Residuo from &lt;SPAN style="font-size: 10.5pt; font-family: 'Helvetica','sans-serif'; color: #666666;"&gt;............&lt;/SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="hps"&gt;&lt;SPAN lang="EN" style="font-size: 10.5pt; font-family: 'Helvetica','sans-serif'; color: #666666;"&gt;Does anyone&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;&lt;SPAN lang="EN" style="font-size: 10.5pt; font-family: 'Helvetica','sans-serif'; color: #666666;"&gt;have any idea&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;&lt;SPAN lang="EN" style="font-size: 10.5pt; font-family: 'Helvetica','sans-serif'; color: #666666;"&gt;what the problem is&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="shorttext"&gt;&lt;SPAN lang="EN" style="font-size: 10.5pt; font-family: 'Helvetica','sans-serif'; color: #666666;"&gt;?&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="shorttext"&gt;&lt;SPAN lang="EN" style="font-size: 10.5pt; font-family: 'Helvetica','sans-serif'; color: #666666;"&gt;Thanks a lot&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN class="shorttext"&gt;&lt;SPAN lang="EN" style="font-size: 10.5pt; font-family: 'Helvetica','sans-serif'; color: #666666;"&gt;Giovanni&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="shorttext"&gt;&lt;SPAN lang="EN" style="font-size: 10.5pt; font-family: 'Helvetica','sans-serif'; color: #666666;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Feb 2015 14:01:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-the-execution-of-SQL-SELECT-UNION/m-p/814862#M287415</guid>
      <dc:creator />
      <dc:date>2015-02-16T14:01:44Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with the execution of SQL (SELECT UNION)</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-the-execution-of-SQL-SELECT-UNION/m-p/814863#M287416</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;if instead of using a variable you hard code the from table, does it work?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Feb 2015 14:07:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-the-execution-of-SQL-SELECT-UNION/m-p/814863#M287416</guid>
      <dc:creator>giakoum</dc:creator>
      <dc:date>2015-02-16T14:07:04Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with the execution of SQL (SELECT UNION)</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-the-execution-of-SQL-SELECT-UNION/m-p/814864#M287417</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN lang="en"&gt;&lt;SPAN class="hps"&gt;The problem&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;is the same. T&lt;/SPAN&gt;&lt;SPAN class="hps"&gt;he error&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;is related&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;to&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;the word &lt;STRONG&gt;from.&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="en"&gt;&lt;SPAN class="hps"&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Feb 2015 14:13:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-the-execution-of-SQL-SELECT-UNION/m-p/814864#M287417</guid>
      <dc:creator />
      <dc:date>2015-02-16T14:13:29Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with the execution of SQL (SELECT UNION)</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-the-execution-of-SQL-SELECT-UNION/m-p/814865#M287418</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;try first the SQL query on your database&lt;/P&gt;&lt;P&gt;when it works, use the query in QlikView&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;also, from what I understand your query should return 1 field and in Qlik (load) you have 5 fields&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Feb 2015 14:13:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-the-execution-of-SQL-SELECT-UNION/m-p/814865#M287418</guid>
      <dc:creator>maxgro</dc:creator>
      <dc:date>2015-02-16T14:13:30Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with the execution of SQL (SELECT UNION)</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-the-execution-of-SQL-SELECT-UNION/m-p/814866#M287419</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Good point&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Feb 2015 14:24:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-the-execution-of-SQL-SELECT-UNION/m-p/814866#M287419</guid>
      <dc:creator>giakoum</dc:creator>
      <dc:date>2015-02-16T14:24:21Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with the execution of SQL (SELECT UNION)</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-the-execution-of-SQL-SELECT-UNION/m-p/814867#M287420</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;also I don't understand the bold part &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10.5pt; font-family: Helvetica, sans-serif; color: #666666;"&gt;SQL &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10.5pt; font-family: Helvetica, sans-serif; color: #666666;"&gt;select sum (Importo) from&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10.5pt; font-family: Helvetica, sans-serif; color: #666666;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; (SELECT sum(FIELD_1) as Importo &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10.5pt; font-family: Helvetica, sans-serif; color: #666666;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; from $(library_path) where FIELD_2= 117030 and FIELD_5= 'D'&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10.5pt; font-family: Helvetica, sans-serif; color: #666666;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; union&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-style: inherit; font-size: 10.5pt; font-family: Helvetica, sans-serif; color: #666666;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SELECT sum (FIELD_1)*-1 as Importo &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-style: inherit; font-size: 10.5pt; font-family: Helvetica, sans-serif; color: #666666;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; from $(library_path) where FIELD_2= 117030 and FIELD_5='A')&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10.5pt; font-family: Helvetica, sans-serif; color: #666666;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; as Residuo &lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10.5pt; font-family: Helvetica, sans-serif; color: #666666;"&gt;&lt;STRONG&gt;from $(library_path)&lt;/STRONG&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Feb 2015 14:38:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-the-execution-of-SQL-SELECT-UNION/m-p/814867#M287420</guid>
      <dc:creator>maxgro</dc:creator>
      <dc:date>2015-02-16T14:38:43Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with the execution of SQL (SELECT UNION)</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-the-execution-of-SQL-SELECT-UNION/m-p/814868#M287421</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 think that is the problem - one too many 'froms'. As Massimo said, test this and get it working in SQLMS first, then try it in QV with literals, and then when that is working replace the literals with the variables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HTH&lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Feb 2015 14:45:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-the-execution-of-SQL-SELECT-UNION/m-p/814868#M287421</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2015-02-16T14:45:25Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with the execution of SQL (SELECT UNION)</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-the-execution-of-SQL-SELECT-UNION/m-p/814869#M287422</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Giovanni,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I guess you mean this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #666666; font-family: 'Helvetica','sans-serif'; font-size: 10.5pt;"&gt;SQL select sum (Importo) &lt;SPAN style="color: #666666; font-family: 'Helvetica','sans-serif'; font-size: 10.5pt;"&gt;as Residuo &lt;/SPAN&gt;from &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #666666; font-family: 'Helvetica','sans-serif'; font-size: 10.5pt;"&gt;(SELECT sum(FIELD_1) as Importo from $(library_path) where FIELD_2= 117030 and FIELD_5= 'D' &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #666666; font-family: 'Helvetica','sans-serif'; font-size: 10.5pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; union&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #666666; font-family: 'Helvetica','sans-serif'; font-size: 10.5pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SELECT sum (FIELD_1)*-1 as Importo from $(library_path) where FIELD_2= 117030 and FIELD_5= 'A') &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But I have no idea what you preceding load is about (?)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Feb 2015 14:46:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-the-execution-of-SQL-SELECT-UNION/m-p/814869#M287422</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-02-16T14:46:39Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with the execution of SQL (SELECT UNION)</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-the-execution-of-SQL-SELECT-UNION/m-p/814870#M287423</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, the error was in the &lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10.5pt; font-family: Helvetica, sans-serif; color: #666666;"&gt;&lt;STRONG&gt;from $(library_path) &lt;/STRONG&gt;at the end. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10.5pt; font-family: Helvetica, sans-serif; color: #666666;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10.5pt; font-family: Helvetica, sans-serif; color: #666666;"&gt;Thanks.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Feb 2015 14:59:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-the-execution-of-SQL-SELECT-UNION/m-p/814870#M287423</guid>
      <dc:creator />
      <dc:date>2015-02-16T14:59:17Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with the execution of SQL (SELECT UNION)</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-the-execution-of-SQL-SELECT-UNION/m-p/814871#M287424</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Good morning, the code tha I use is the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Importi:&lt;/P&gt;&lt;P&gt;LOAD &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; *;&lt;/P&gt;&lt;P&gt;SQL SELECT sum (Importo) from &lt;/P&gt;&lt;P&gt;(&amp;nbsp;&amp;nbsp;&amp;nbsp; SELECT sum(CNRATA) as Importo from $(library_path) WHERE CNCLIE = '117030' and CNDAVE = 'D'&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; union&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SELECT sum (CNRATA)*-1 as Importo from $(library_path) a where CNCLIE = 117030 and CNDAVE = 'A'&lt;/P&gt;&lt;P&gt;) as Residuo;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can't understand why the result where the name of the field is &lt;STRONG&gt;00001&lt;/STRONG&gt; and not &lt;STRONG&gt;Residuo&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Why ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Feb 2015 08:38:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-the-execution-of-SQL-SELECT-UNION/m-p/814871#M287424</guid>
      <dc:creator />
      <dc:date>2015-02-17T08:38:35Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with the execution of SQL (SELECT UNION)</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-the-execution-of-SQL-SELECT-UNION/m-p/814872#M287425</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;from what I understand&lt;/P&gt;&lt;P&gt;Residuo is the alias you choose for this (inline view)&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;EM&gt;(&amp;nbsp;&amp;nbsp;&amp;nbsp; SELECT sum(CNRATA) as Importo from $(library_path) WHERE CNCLIE = '117030' and CNDAVE = 'D'&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/EM&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; union&lt;/EM&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SELECT sum (CNRATA)*-1 as Importo from $(library_path) a where CNCLIE = 117030 and CNDAVE = 'A'&lt;/EM&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;EM&gt;)&lt;/EM&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;0001 is the alias the dbms gives to&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;EM&gt;sum (Importo)&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;because you didn't give to sum(Importo) an alias (as ....)&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Feb 2015 09:27:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-the-execution-of-SQL-SELECT-UNION/m-p/814872#M287425</guid>
      <dc:creator>maxgro</dc:creator>
      <dc:date>2015-02-17T09:27:30Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with the execution of SQL (SELECT UNION)</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-the-execution-of-SQL-SELECT-UNION/m-p/814873#M287426</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You have to alias sum() rather than SQL...&amp;nbsp; See my post above.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Feb 2015 16:01:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-the-execution-of-SQL-SELECT-UNION/m-p/814873#M287426</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-02-18T16:01:43Z</dc:date>
    </item>
  </channel>
</rss>

