<?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>article Leaving tables after binary load in Member Articles</title>
    <link>https://community.qlik.com/t5/Member-Articles/Leaving-tables-after-binary-load/ta-p/1741840</link>
    <description>&lt;P&gt;I found it tricky when it comes to managing tables after Binary load.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Usually, you do it like this to create a new application like &lt;STRONG&gt;Region sales.qvw &lt;/STRONG&gt;with Binary:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Binary [\\QLIKVIEW\Load\Sales.qvw];

DROP Tables PERMISSIONS, Clients, Dimensions, Expressions;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In most cases, there are a lot more tables to drop out.&amp;nbsp;&lt;/P&gt;&lt;P&gt;While working on other projects you add additional tables to the &lt;STRONG&gt;Sales.qvw&amp;nbsp;&lt;/STRONG&gt;file. So you have to remember that there are some applications like &lt;STRONG&gt;Region sales.qvw&lt;/STRONG&gt; where you have to drop the newly created table.&lt;/P&gt;&lt;P&gt;But instead, you can simply write down the tables you need and want to leave in the data model in&amp;nbsp;&lt;STRONG&gt;Region sales.qvw.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Just create a new SUB in notepad like &lt;STRONG&gt;master_subs.txt&lt;/STRONG&gt;:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;SUB Leave_tables(tables)

For t = 0 to NoOfTables() - 1

Tables:
Load TableName($(t)) as TableName
   ,If(Index('$(tables)', TableName($(t))) &amp;gt; 0, 1, 0) as [Do we leave a table]
Autogenerate 1;

Next t;


tmp:
LOAD '[' &amp;amp; Concat(TableName, '], [') &amp;amp; '];' as table_names
Resident Tables
Where [Do we leave a table] = 0
;

DROP Table Tables;

v_drop_tables = Peek('table_names', 0, 'tmp');

DROP Table tmp;
DROP Table $(v_drop_tables);

END SUB&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After that you have to edit your script to this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Binary [\\QLIKVIEW\Load\Sales.qvw];

$(Include=\\QLIKVIEW\Data\Master\master_subs.txt);

CALL Leave_tables('Sales, Sales person');&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In this case, you do not have to worry about the newly created tables in the &lt;STRONG&gt;Sales.qvw&lt;/STRONG&gt; as those tables might cause some serious data model problems, increase the size of&amp;nbsp; the &lt;STRONG&gt;Region sales.qvw &lt;/STRONG&gt;app.&lt;/P&gt;</description>
    <pubDate>Wed, 21 Sep 2022 17:07:35 GMT</pubDate>
    <dc:creator>MindaugasBacius</dc:creator>
    <dc:date>2022-09-21T17:07:35Z</dc:date>
    <item>
      <title>Leaving tables after binary load</title>
      <link>https://community.qlik.com/t5/Member-Articles/Leaving-tables-after-binary-load/ta-p/1741840</link>
      <description>&lt;P&gt;I found it tricky when it comes to managing tables after Binary load.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Usually, you do it like this to create a new application like &lt;STRONG&gt;Region sales.qvw &lt;/STRONG&gt;with Binary:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Binary [\\QLIKVIEW\Load\Sales.qvw];

DROP Tables PERMISSIONS, Clients, Dimensions, Expressions;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In most cases, there are a lot more tables to drop out.&amp;nbsp;&lt;/P&gt;&lt;P&gt;While working on other projects you add additional tables to the &lt;STRONG&gt;Sales.qvw&amp;nbsp;&lt;/STRONG&gt;file. So you have to remember that there are some applications like &lt;STRONG&gt;Region sales.qvw&lt;/STRONG&gt; where you have to drop the newly created table.&lt;/P&gt;&lt;P&gt;But instead, you can simply write down the tables you need and want to leave in the data model in&amp;nbsp;&lt;STRONG&gt;Region sales.qvw.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Just create a new SUB in notepad like &lt;STRONG&gt;master_subs.txt&lt;/STRONG&gt;:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;SUB Leave_tables(tables)

For t = 0 to NoOfTables() - 1

Tables:
Load TableName($(t)) as TableName
   ,If(Index('$(tables)', TableName($(t))) &amp;gt; 0, 1, 0) as [Do we leave a table]
Autogenerate 1;

Next t;


tmp:
LOAD '[' &amp;amp; Concat(TableName, '], [') &amp;amp; '];' as table_names
Resident Tables
Where [Do we leave a table] = 0
;

DROP Table Tables;

v_drop_tables = Peek('table_names', 0, 'tmp');

DROP Table tmp;
DROP Table $(v_drop_tables);

END SUB&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After that you have to edit your script to this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Binary [\\QLIKVIEW\Load\Sales.qvw];

$(Include=\\QLIKVIEW\Data\Master\master_subs.txt);

CALL Leave_tables('Sales, Sales person');&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In this case, you do not have to worry about the newly created tables in the &lt;STRONG&gt;Sales.qvw&lt;/STRONG&gt; as those tables might cause some serious data model problems, increase the size of&amp;nbsp; the &lt;STRONG&gt;Region sales.qvw &lt;/STRONG&gt;app.&lt;/P&gt;</description>
      <pubDate>Wed, 21 Sep 2022 17:07:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Member-Articles/Leaving-tables-after-binary-load/ta-p/1741840</guid>
      <dc:creator>MindaugasBacius</dc:creator>
      <dc:date>2022-09-21T17:07:35Z</dc:date>
    </item>
  </channel>
</rss>

