<?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 Synthetic Table creation overriding user table creation? in Connectivity &amp; Data Prep</title>
    <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Synthetic-Table-creation-overriding-user-table-creation/m-p/1025558#M1530</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, just a quick question here about the desired behaviour when a Synthetic Table is created.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My scenario is this - imagine "customers" which may have multiple names for a given month over time. We want a table with one name per customer for the most recent month.&lt;/P&gt;&lt;P&gt;Now, this can be done easily inside a DBMS but doing it entirely in the Qlik data load step showed some funny behaviour.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Taking my test data:&lt;/P&gt;&lt;P&gt;testdata:&lt;/P&gt;&lt;P&gt;load * inline&lt;/P&gt;&lt;P&gt;[&lt;/P&gt;&lt;P&gt;mth, CustomerID, CustomerName&lt;/P&gt;&lt;P&gt;4, 1, 'fred'&lt;/P&gt;&lt;P&gt;4, 1, 'tom'&lt;/P&gt;&lt;P&gt;3, 1, 'fred'&lt;/P&gt;&lt;P&gt;2, 1, 'fred'&lt;/P&gt;&lt;P&gt;4, 2, 'phil'&lt;/P&gt;&lt;P&gt;4, 3, 'jack'&lt;/P&gt;&lt;P&gt;3, 4, 'sam'&lt;/P&gt;&lt;P&gt;]&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I create a table containing one name per month and customer, then the most recent month by customer. These tables are then inner-joined to get the most recent month and name by customer.&lt;/P&gt;&lt;P&gt;If the two intermediate tables have exactly the same column names, in the data load step Qlik creates a synthetic key table, part of which is our desired output. The table even though it is specifically called on to be created in the script is not created!&lt;/P&gt;&lt;P&gt;However, if the column names are not the same and no synthetic key is created, the table is created as per the script!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Using the test data above, this replicates the problem:&lt;/P&gt;&lt;P&gt;//Get one entry per customer per month&lt;BR /&gt;CustomerMaster:&lt;BR /&gt;LOAD&lt;BR /&gt; mth as ReferenceMonth,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CustomerID,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; MAXSTRING(CustomerName) as CustomerName2&lt;BR /&gt;resident &lt;BR /&gt; testdata&lt;BR /&gt;GROUP BY mth, CustomerID&lt;BR /&gt;;&lt;/P&gt;&lt;P&gt;//CREATE MOST RECENT ENTRY&lt;BR /&gt;CustomerRecent:&lt;BR /&gt;LOAD&lt;BR /&gt; CustomerID,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; MAX(ReferenceMonth) as ReferenceMonth //If this is called "ReferenceMonth", the table creation below fails. If it has another name, the table is created as per the script&lt;BR /&gt;resident&lt;BR /&gt; CustomerMaster&lt;BR /&gt;GROUP BY CustomerID&lt;BR /&gt;;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;//CREATE LIST OF MOST RECENT NAMES&lt;BR /&gt;CustomerNames:&lt;BR /&gt;load&lt;BR /&gt; ReferenceMonth as ReferenceMonth,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CustomerID&lt;BR /&gt;resident CustomerRecent;&lt;BR /&gt;INNER JOIN&lt;BR /&gt;load&lt;BR /&gt; ReferenceMonth,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CustomerID,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CustomerName2&lt;BR /&gt;resident CustomerMaster;&lt;BR /&gt;;&lt;/P&gt;&lt;P&gt;//CLEAN UP UN-NEEDED TABLES&lt;BR /&gt;drop table CustomerMaster, CustomerRecent&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 01 Feb 2016 23:13:54 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2016-02-01T23:13:54Z</dc:date>
    <item>
      <title>Synthetic Table creation overriding user table creation?</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Synthetic-Table-creation-overriding-user-table-creation/m-p/1025558#M1530</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, just a quick question here about the desired behaviour when a Synthetic Table is created.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My scenario is this - imagine "customers" which may have multiple names for a given month over time. We want a table with one name per customer for the most recent month.&lt;/P&gt;&lt;P&gt;Now, this can be done easily inside a DBMS but doing it entirely in the Qlik data load step showed some funny behaviour.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Taking my test data:&lt;/P&gt;&lt;P&gt;testdata:&lt;/P&gt;&lt;P&gt;load * inline&lt;/P&gt;&lt;P&gt;[&lt;/P&gt;&lt;P&gt;mth, CustomerID, CustomerName&lt;/P&gt;&lt;P&gt;4, 1, 'fred'&lt;/P&gt;&lt;P&gt;4, 1, 'tom'&lt;/P&gt;&lt;P&gt;3, 1, 'fred'&lt;/P&gt;&lt;P&gt;2, 1, 'fred'&lt;/P&gt;&lt;P&gt;4, 2, 'phil'&lt;/P&gt;&lt;P&gt;4, 3, 'jack'&lt;/P&gt;&lt;P&gt;3, 4, 'sam'&lt;/P&gt;&lt;P&gt;]&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I create a table containing one name per month and customer, then the most recent month by customer. These tables are then inner-joined to get the most recent month and name by customer.&lt;/P&gt;&lt;P&gt;If the two intermediate tables have exactly the same column names, in the data load step Qlik creates a synthetic key table, part of which is our desired output. The table even though it is specifically called on to be created in the script is not created!&lt;/P&gt;&lt;P&gt;However, if the column names are not the same and no synthetic key is created, the table is created as per the script!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Using the test data above, this replicates the problem:&lt;/P&gt;&lt;P&gt;//Get one entry per customer per month&lt;BR /&gt;CustomerMaster:&lt;BR /&gt;LOAD&lt;BR /&gt; mth as ReferenceMonth,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CustomerID,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; MAXSTRING(CustomerName) as CustomerName2&lt;BR /&gt;resident &lt;BR /&gt; testdata&lt;BR /&gt;GROUP BY mth, CustomerID&lt;BR /&gt;;&lt;/P&gt;&lt;P&gt;//CREATE MOST RECENT ENTRY&lt;BR /&gt;CustomerRecent:&lt;BR /&gt;LOAD&lt;BR /&gt; CustomerID,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; MAX(ReferenceMonth) as ReferenceMonth //If this is called "ReferenceMonth", the table creation below fails. If it has another name, the table is created as per the script&lt;BR /&gt;resident&lt;BR /&gt; CustomerMaster&lt;BR /&gt;GROUP BY CustomerID&lt;BR /&gt;;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;//CREATE LIST OF MOST RECENT NAMES&lt;BR /&gt;CustomerNames:&lt;BR /&gt;load&lt;BR /&gt; ReferenceMonth as ReferenceMonth,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CustomerID&lt;BR /&gt;resident CustomerRecent;&lt;BR /&gt;INNER JOIN&lt;BR /&gt;load&lt;BR /&gt; ReferenceMonth,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CustomerID,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CustomerName2&lt;BR /&gt;resident CustomerMaster;&lt;BR /&gt;;&lt;/P&gt;&lt;P&gt;//CLEAN UP UN-NEEDED TABLES&lt;BR /&gt;drop table CustomerMaster, CustomerRecent&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Feb 2016 23:13:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Synthetic-Table-creation-overriding-user-table-creation/m-p/1025558#M1530</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-02-01T23:13:54Z</dc:date>
    </item>
    <item>
      <title>Re: Synthetic Table creation overriding user table creation?</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Synthetic-Table-creation-overriding-user-table-creation/m-p/1025559#M1531</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think that's because QV will auto-concatenate tables with same number and name of fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try&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;Using the test data above, this replicates the problem:&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;//Get one entry per customer per month&lt;BR /&gt;CustomerMaster:&lt;BR /&gt;LOAD&lt;BR /&gt;mth as ReferenceMonth,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CustomerID,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; MAXSTRING(CustomerName) as CustomerName2&lt;BR /&gt;resident &lt;BR /&gt;testdata&lt;BR /&gt;GROUP BY mth, CustomerID&lt;BR /&gt;;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;//CREATE MOST RECENT ENTRY&lt;BR /&gt;CustomerRecent:&lt;BR /&gt;LOAD&lt;BR /&gt;CustomerID,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; MAX(ReferenceMonth) as ReferenceMonth //If this is called "ReferenceMonth", the table creation below fails. If it has another name, the table is created as per the script&lt;BR /&gt;resident&lt;BR /&gt;CustomerMaster&lt;BR /&gt;GROUP BY CustomerID&lt;BR /&gt;;&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;/CREATE LIST OF MOST RECENT NAMES&lt;BR /&gt;CustomerNames:&lt;BR /&gt;&lt;STRONG&gt;NOCONCATENATE&lt;/STRONG&gt; load&lt;BR /&gt;ReferenceMonth as ReferenceMonth,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CustomerID&lt;BR /&gt;resident CustomerRecent;&lt;BR /&gt;INNER JOIN&lt;BR /&gt;load&lt;BR /&gt;ReferenceMonth,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CustomerID,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CustomerName2&lt;BR /&gt;resident CustomerMaster;&lt;BR /&gt;;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;//CLEAN UP UN-NEEDED TABLES&lt;BR /&gt;drop table CustomerMaster, CustomerRecent&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Feb 2016 00:01:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Synthetic-Table-creation-overriding-user-table-creation/m-p/1025559#M1531</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2016-02-02T00:01:08Z</dc:date>
    </item>
    <item>
      <title>Re: Synthetic Table creation overriding user table creation?</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Synthetic-Table-creation-overriding-user-table-creation/m-p/1025560#M1532</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Seems like odd behaviour if I've specifically got in the load script to create a new table with a different name and contents, but I imagine this is in the tiny percent of cases regardless.&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Feb 2016 00:03:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Synthetic-Table-creation-overriding-user-table-creation/m-p/1025560#M1532</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-02-02T00:03:30Z</dc:date>
    </item>
  </channel>
</rss>

