<?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: Joining SQL Queries in Load and manipulate in memory before QVD in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Joining-SQL-Queries-in-Load-and-manipulate-in-memory-before-QVD/m-p/509555#M692672</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Brian,&lt;/P&gt;&lt;P&gt;Something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;table_tmp:&lt;BR /&gt;select visitid as [Visit ID],&lt;BR /&gt;name as [Name],&lt;BR /&gt;location as [Location],&lt;BR /&gt;cost1 * 3.23 as [Cost 1],&lt;BR /&gt;cost2 * 5.33 as [Cost 2]&lt;BR /&gt;from db1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;INNER JOIN (table_tmp) &lt;/P&gt;&lt;P&gt;SQL select visitnum as [Visit ID],&lt;BR /&gt;cost3 as [Cost 3]&lt;BR /&gt;cost4 / 5.64 as [Cost 4]&lt;BR /&gt;from db2;&lt;/P&gt;&lt;P&gt;table:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;LOAD&lt;BR /&gt;[Visit ID],&lt;BR /&gt;Name,&lt;BR /&gt;Location,&lt;BR /&gt;[Cost 1] / [Cost 3]*[Cost4] as [Cost Total 1]&lt;BR /&gt;RESIDENT table_tmp;&lt;BR /&gt;DROP TABLE table_tmp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;STORE table into table.qvd (qvd)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 22 Jul 2013 16:45:44 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2013-07-22T16:45:44Z</dc:date>
    <item>
      <title>Joining SQL Queries in Load and manipulate in memory before QVD</title>
      <link>https://community.qlik.com/t5/QlikView/Joining-SQL-Queries-in-Load-and-manipulate-in-memory-before-QVD/m-p/509553#M692670</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is the scenario. I have several sql pulls that I need to make into memory, joining them together and then doing calculations based on those fields before writing out a qvd file. For example.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let's say I need to.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) select visitid as [Visit ID],&lt;/P&gt;&lt;P&gt;name as [Name],&lt;/P&gt;&lt;P&gt;location as [Location],&lt;/P&gt;&lt;P&gt;cost1 * 3.23 as [Cost 1],&lt;/P&gt;&lt;P&gt;cost2 * 5.33 as [Cost 2]&lt;/P&gt;&lt;P&gt;from db1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) select visitnum as [Visit ID],&lt;/P&gt;&lt;P&gt;cost3 as [Cost 3]&lt;/P&gt;&lt;P&gt;cost4 / 5.64 as [Cost 4]&lt;/P&gt;&lt;P&gt;from db2;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then I want to do calculations on these fields such as&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[Cost 1] / [Cost 3]*[Cost4] as [Cost Total 1]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is a very simplified example but it should do the trick...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I am wanting to do is load the first sql into memory, then join the second sql in memory and then do the calculations on the columns (using the column names instead of field names and finally produce a single qvd file. I think you have to use resident tables and joins, but I am not clear on the syntax to get this done... Any help with detailed scripting syntax would be a lifesaver. Thanks ahead of time.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Jul 2013 16:40:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Joining-SQL-Queries-in-Load-and-manipulate-in-memory-before-QVD/m-p/509553#M692670</guid>
      <dc:creator />
      <dc:date>2013-07-22T16:40:08Z</dc:date>
    </item>
    <item>
      <title>Re: Joining SQL Queries in Load and manipulate in memory before QVD</title>
      <link>https://community.qlik.com/t5/QlikView/Joining-SQL-Queries-in-Load-and-manipulate-in-memory-before-QVD/m-p/509554#M692671</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Something like this: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table1:&lt;/P&gt;&lt;P style="background-color: #ffffff; color: #737373; font-family: Arial;"&gt;select visitid as [Visit ID],&lt;/P&gt;&lt;P style="background-color: #ffffff; color: #737373; font-family: Arial;"&gt;name as [Name],&lt;/P&gt;&lt;P style="background-color: #ffffff; color: #737373; font-family: Arial;"&gt;location as [Location],&lt;/P&gt;&lt;P style="background-color: #ffffff; color: #737373; font-family: Arial;"&gt;cost1 * 3.23 as [Cost 1],&lt;/P&gt;&lt;P style="background-color: #ffffff; color: #737373; font-family: Arial;"&gt;cost2 * 5.33 as [Cost 2]&lt;/P&gt;&lt;P style="background-color: #ffffff; color: #737373; font-family: Arial;"&gt;from db1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff; color: #737373; font-family: Arial;"&gt;JOIN(Table1)&lt;/P&gt;&lt;P style="background-color: #ffffff; color: #737373; font-family: Arial;"&gt;select visitnum as [Visit ID],&lt;/P&gt;&lt;P style="background-color: #ffffff; color: #737373; font-family: Arial;"&gt;cost3 as [Cost 3]&lt;/P&gt;&lt;P style="background-color: #ffffff; color: #737373; font-family: Arial;"&gt;cost4 / 5.64 as [Cost 4]&lt;/P&gt;&lt;P style="background-color: #ffffff; color: #737373; font-family: Arial;"&gt;from db2;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff; color: #737373; font-family: Arial;"&gt;Result:&lt;/P&gt;&lt;P&gt;Load *, &lt;SPAN style="color: #737373; font-family: Arial; background-color: #ffffff;"&gt;[Cost 1] / [Cost 3]*[Cost4] as [Cost Total 1]&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #737373; font-family: Arial; background-color: #ffffff;"&gt;Resident Table1;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #737373; font-family: Arial; background-color: #ffffff;"&gt;drop table Table1;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #737373; font-family: Arial; background-color: #ffffff;"&gt;STORE Result into result.qvd;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Jul 2013 16:45:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Joining-SQL-Queries-in-Load-and-manipulate-in-memory-before-QVD/m-p/509554#M692671</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2013-07-22T16:45:33Z</dc:date>
    </item>
    <item>
      <title>Re: Joining SQL Queries in Load and manipulate in memory before QVD</title>
      <link>https://community.qlik.com/t5/QlikView/Joining-SQL-Queries-in-Load-and-manipulate-in-memory-before-QVD/m-p/509555#M692672</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Brian,&lt;/P&gt;&lt;P&gt;Something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;table_tmp:&lt;BR /&gt;select visitid as [Visit ID],&lt;BR /&gt;name as [Name],&lt;BR /&gt;location as [Location],&lt;BR /&gt;cost1 * 3.23 as [Cost 1],&lt;BR /&gt;cost2 * 5.33 as [Cost 2]&lt;BR /&gt;from db1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;INNER JOIN (table_tmp) &lt;/P&gt;&lt;P&gt;SQL select visitnum as [Visit ID],&lt;BR /&gt;cost3 as [Cost 3]&lt;BR /&gt;cost4 / 5.64 as [Cost 4]&lt;BR /&gt;from db2;&lt;/P&gt;&lt;P&gt;table:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;LOAD&lt;BR /&gt;[Visit ID],&lt;BR /&gt;Name,&lt;BR /&gt;Location,&lt;BR /&gt;[Cost 1] / [Cost 3]*[Cost4] as [Cost Total 1]&lt;BR /&gt;RESIDENT table_tmp;&lt;BR /&gt;DROP TABLE table_tmp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;STORE table into table.qvd (qvd)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Jul 2013 16:45:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Joining-SQL-Queries-in-Load-and-manipulate-in-memory-before-QVD/m-p/509555#M692672</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-07-22T16:45:44Z</dc:date>
    </item>
    <item>
      <title>Re: Joining SQL Queries in Load and manipulate in memory before QVD</title>
      <link>https://community.qlik.com/t5/QlikView/Joining-SQL-Queries-in-Load-and-manipulate-in-memory-before-QVD/m-p/509556#M692673</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;OK, syntax should be something like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data:&lt;/P&gt;&lt;P&gt;LOAD visitid AS [Visit ID],&lt;/P&gt;&lt;P&gt;name as [Name],&lt;/P&gt;&lt;P&gt;location as [Location],&lt;/P&gt;&lt;P&gt;cost1 * 3.23 as [Cost 1],&lt;/P&gt;&lt;P&gt;cost2 * 5.33 as [Cost 2]&lt;/P&gt;&lt;P&gt;from db1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;left join (Data)&lt;/P&gt;&lt;P&gt;LOAD visitnum as [Visit ID],&lt;/P&gt;&lt;P&gt;cost3 as [Cost 3],&lt;/P&gt;&lt;P&gt;cost4/5.64 as [Cost 4]&lt;/P&gt;&lt;P&gt;from db2;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FinalTable:&lt;/P&gt;&lt;P&gt;NoConcatenate&lt;/P&gt;&lt;P&gt;LOAD *,&lt;/P&gt;&lt;P&gt;[Cost 1] / [Cost 3] * Cost 4] as [Cost Total 1]&lt;/P&gt;&lt;P&gt;RESIDENT Data;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DROP TABLE Data;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;STORE FinalTable INTO FinalTable.QVD;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Jul 2013 16:46:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Joining-SQL-Queries-in-Load-and-manipulate-in-memory-before-QVD/m-p/509556#M692673</guid>
      <dc:creator />
      <dc:date>2013-07-22T16:46:24Z</dc:date>
    </item>
  </channel>
</rss>

