<?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: Add new column to a resident table in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Add-new-column-to-a-resident-table/m-p/674225#M244824</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The first one is not possible or very hard way to do it because the reporting table is created gradually and dynamically by merging many columns from different fact and entity tables&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would go for the second option but there is a small problem with it. Since it will join on both Sale Type and Sale Type alloc and in most of the cases either of them is null, will this join not fail?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Shah&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 22 Oct 2014 07:28:00 GMT</pubDate>
    <dc:creator />
    <dc:date>2014-10-22T07:28:00Z</dc:date>
    <item>
      <title>Add new column to a resident table</title>
      <link>https://community.qlik.com/t5/QlikView/Add-new-column-to-a-resident-table/m-p/674223#M244822</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;Suppose that in Qlikview load script, I have loaded a table (Reporting) with the following structure&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" width="259"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD height="20" width="64"&gt;Country&lt;/TD&gt;&lt;TD width="96"&gt;Sale Type&lt;/TD&gt;&lt;TD width="99"&gt;Sale Type alloc&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;Finland&lt;/TD&gt;&lt;TD&gt;General&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;USA&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;General&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;UK&lt;/TD&gt;&lt;TD&gt;Pre-Sales&lt;/TD&gt;&lt;TD&gt;Pre-Sales&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;Germany&lt;/TD&gt;&lt;TD&gt;General&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;Sweden&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;General&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;Holland&lt;/TD&gt;&lt;TD&gt;General&lt;/TD&gt;&lt;TD&gt;General&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Later in the script, I would like to add another column &lt;STRONG&gt;SaleType All&lt;/STRONG&gt; to this table that would be the combination of &lt;STRONG&gt;Sale Type&lt;/STRONG&gt; and &lt;STRONG&gt;Sale Type alloc&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can someone please tell me what are the possible options to do this. In my opinion, one way to do it is by&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-creating a temp table and load data from From Reporting table &lt;STRONG&gt;where Sale Type is not null&lt;/STRONG&gt; union load data from reporting table &lt;STRONG&gt;where sale Type alloc is not null. &lt;/STRONG&gt;Then load distinct rows from this temp table and drop the temp table&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;The above table is just an example but the actual table has 72 columns and 70 million rows. This table is generated dynamically step by step by calling different stored procedures and filling/concatenating data in this table&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I would like to implement the most efficient way to do this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;P.S: The purpose is to have a single column for filter that would filter both columns for the sale types and also have a single column sale type column appear in a chart/table box&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Shah&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Oct 2014 06:52:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Add-new-column-to-a-resident-table/m-p/674223#M244822</guid>
      <dc:creator />
      <dc:date>2014-10-22T06:52:12Z</dc:date>
    </item>
    <item>
      <title>Re: Add new column to a resident table</title>
      <link>https://community.qlik.com/t5/QlikView/Add-new-column-to-a-resident-table/m-p/674224#M244823</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;The most efficient way would be to use a preceding load, above the load of the Reporting table:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reporting:&lt;/P&gt;&lt;P&gt;LOAD *,&lt;/P&gt;&lt;P&gt;&amp;nbsp; If(Len([Sale Type]) &amp;gt; 0, [Sale Type], [Sale Type alloc]) As [SaleType All]&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;LOAD ......&lt;/P&gt;&lt;P&gt;// existing load of Reporting here&lt;/P&gt;&lt;P&gt;FROM ....&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If that is not an option, you could use a join, but this will add to the reload time for 70 million rows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Join(Reporting)&lt;/P&gt;&lt;P&gt;LOAD Distinct [Sale Type],&lt;/P&gt;&lt;P&gt;&amp;nbsp; [Sale Type alloc],&lt;/P&gt;&lt;P&gt;&amp;nbsp; If(Len([Sale Type]) &amp;gt; 0, [Sale Type], [Sale Type alloc]) As [SaleType All]&lt;/P&gt;&lt;P&gt;Resident Reporting;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would prefer the preceding load if at all possible.&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>Wed, 22 Oct 2014 07:19:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Add-new-column-to-a-resident-table/m-p/674224#M244823</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2014-10-22T07:19:42Z</dc:date>
    </item>
    <item>
      <title>Re: Add new column to a resident table</title>
      <link>https://community.qlik.com/t5/QlikView/Add-new-column-to-a-resident-table/m-p/674225#M244824</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The first one is not possible or very hard way to do it because the reporting table is created gradually and dynamically by merging many columns from different fact and entity tables&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would go for the second option but there is a small problem with it. Since it will join on both Sale Type and Sale Type alloc and in most of the cases either of them is null, will this join not fail?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Shah&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Oct 2014 07:28:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Add-new-column-to-a-resident-table/m-p/674225#M244824</guid>
      <dc:creator />
      <dc:date>2014-10-22T07:28:00Z</dc:date>
    </item>
    <item>
      <title>Re: Add new column to a resident table</title>
      <link>https://community.qlik.com/t5/QlikView/Add-new-column-to-a-resident-table/m-p/674226#M244825</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 you are correct. A quick workaround is to place the statement:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NULLASVALUE &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;[Sale Type], [Sale Type alloc&lt;/SPAN&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;before the first load of the Reporting table.&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>Wed, 22 Oct 2014 07:44:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Add-new-column-to-a-resident-table/m-p/674226#M244825</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2014-10-22T07:44:11Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Add new column to a resident table</title>
      <link>https://community.qlik.com/t5/QlikView/Add-new-column-to-a-resident-table/m-p/674227#M244826</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, it seems to b partially working. However, the nullasvalue seems to have replaced only the nulls that existed in the table. It does not seem to replace those nulls that were created as a result of mismatching joins between tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;On a side node, Is it possible to do a load from the same table, add few columns or changes and give the table the same name? for example&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_14139800054444724" jivemacro_uid="_14139800054444724"&gt;
&lt;P&gt;Reporting:&lt;/P&gt;
&lt;P&gt;replace reload *,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If(Len([Sale Type]) &amp;gt; 0, [Sale Type], [Sale Type alloc]) As [SaleType All]&lt;/P&gt;
&lt;P&gt;resident Reporting;&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Shah&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Oct 2014 12:13:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Add-new-column-to-a-resident-table/m-p/674227#M244826</guid>
      <dc:creator />
      <dc:date>2014-10-22T12:13:36Z</dc:date>
    </item>
  </channel>
</rss>

