<?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 Script - Replicating Existing Tables - QV v8.5 in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Script-Replicating-Existing-Tables-QV-v8-5/m-p/179978#M46586</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;with Excel source data&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 24 Mar 2011 16:29:30 GMT</pubDate>
    <dc:creator />
    <dc:date>2011-03-24T16:29:30Z</dc:date>
    <item>
      <title>Script - Replicating Existing Tables - QV v8.5</title>
      <link>https://community.qlik.com/t5/QlikView/Script-Replicating-Existing-Tables-QV-v8-5/m-p/179977#M46585</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am trying to replicate an existing table in a new table.&lt;/P&gt;&lt;P&gt;When creating the new table, I cannot evaluate to new fields that have been created ("zzNoSpend" &amp;amp; "zzNoVolume")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE ___default_attr="plain" class="jive_text_macro jive_macro_code" jivemacro="code"&gt;&lt;BR /&gt;Directory:&lt;BR /&gt;LOAD Material,&lt;BR /&gt; Euros,&lt;BR /&gt; QtyKG,&lt;BR /&gt; CalYearMonth,&lt;BR /&gt; if(Euros = 0 and QtyKG &amp;lt;&amp;gt; 0, 1, 0) AS NoVolume,&lt;BR /&gt; if(QtyKG = 0 and Euros &amp;lt;&amp;gt; 0, 1, 0) AS NoSpend,&lt;BR /&gt; if(left(Material,8) = 'Non Item',1,0) as NonItem,&lt;BR /&gt; if(left(Material,4) = 'TEMP',1,0) as Temp&lt;BR /&gt;FROM [Dirty Data Example data2.xls] (biff, embedded labels, table is Sheet1$);&lt;BR /&gt;&lt;BR /&gt;//======================================================================================&lt;BR /&gt;NewTable: // trying to clone the above table, and return same results&lt;BR /&gt;Load&lt;BR /&gt;Material,&lt;BR /&gt;Euros as zzEuros, // duplicate fields prefixed with 'zz'&lt;BR /&gt;QtyKG as zzQtyKG, // duplicate fields prefixed with 'zz'&lt;BR /&gt;CalYearMonth as zzCalYearMonth&lt;BR /&gt;Resident Directory;&lt;BR /&gt; Join(NewTable)&lt;BR /&gt;Load&lt;BR /&gt;Material,&lt;BR /&gt;if(zzEuros = 0 and zzQtyKG &amp;lt;&amp;gt; 0, 1, 0) AS zzNoVolume, // issues with the inclusion of the following fields in formulas 'zzEuros' and 'zzQtyKG'&lt;BR /&gt;if(zzQtyKG = 0 and zzEuros &amp;lt;&amp;gt; 0, 1, 0) AS zzNoSpend,&lt;BR /&gt;if(left(Material,8) = 'Non Item',1,0) as zzNonItem,&lt;BR /&gt;if(left(Material,4) = 'TEMP',1,0) as zzTemp&lt;BR /&gt;Resident NewTable;&lt;BR /&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;by using "join" above, fields "zzNoVolume" and "zzNoSpend" are recognised fields, and calculate correctly in the "IF" statements in the above Join section. However, my spend volume values have doubled.&lt;/P&gt;&lt;P&gt;by removing the join statement, and entering my if statements in the section above, the "zzNoVolume" and "zzNoSpend" fields are not recognised.&lt;/P&gt;&lt;P&gt;Anyone have any suggestions?&lt;/P&gt;&lt;P&gt;Please advise,&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;Rich&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Mar 2011 16:23:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Script-Replicating-Existing-Tables-QV-v8-5/m-p/179977#M46585</guid>
      <dc:creator />
      <dc:date>2011-03-24T16:23:51Z</dc:date>
    </item>
    <item>
      <title>Script - Replicating Existing Tables - QV v8.5</title>
      <link>https://community.qlik.com/t5/QlikView/Script-Replicating-Existing-Tables-QV-v8-5/m-p/179978#M46586</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;with Excel source data&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Mar 2011 16:29:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Script-Replicating-Existing-Tables-QV-v8-5/m-p/179978#M46586</guid>
      <dc:creator />
      <dc:date>2011-03-24T16:29:30Z</dc:date>
    </item>
    <item>
      <title>Script - Replicating Existing Tables - QV v8.5</title>
      <link>https://community.qlik.com/t5/QlikView/Script-Replicating-Existing-Tables-QV-v8-5/m-p/179979#M46587</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Rich,&lt;/P&gt;&lt;P&gt;Not 100% what the aim is but attached is a 'dual-table-results-are-the-same' solution.&lt;/P&gt;&lt;P&gt;Hope it helps?!?&lt;/P&gt;&lt;P&gt;All the best,&lt;/P&gt;&lt;P&gt;Matt - Visual Analytics Ltd&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Mar 2011 16:35:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Script-Replicating-Existing-Tables-QV-v8-5/m-p/179979#M46587</guid>
      <dc:creator>matt_crowther</dc:creator>
      <dc:date>2011-03-24T16:35:19Z</dc:date>
    </item>
    <item>
      <title>Script - Replicating Existing Tables - QV v8.5</title>
      <link>https://community.qlik.com/t5/QlikView/Script-Replicating-Existing-Tables-QV-v8-5/m-p/179980#M46588</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Rich,&lt;/P&gt;&lt;P&gt;Apologies the first post was junk - attached this time is one that doesn't drop half the fields!&lt;/P&gt;&lt;P&gt;Hope that helps,&lt;/P&gt;&lt;P&gt;Matt - Visual Analytics Ltd&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Mar 2011 16:40:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Script-Replicating-Existing-Tables-QV-v8-5/m-p/179980#M46588</guid>
      <dc:creator>matt_crowther</dc:creator>
      <dc:date>2011-03-24T16:40:03Z</dc:date>
    </item>
    <item>
      <title>Script - Replicating Existing Tables - QV v8.5</title>
      <link>https://community.qlik.com/t5/QlikView/Script-Replicating-Existing-Tables-QV-v8-5/m-p/179981#M46589</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your lines are doubling because you are joining on the single field "Material" and there are two rows for each Material in your source table. When adding fields via join, use LOAD * DISTINCT to make sure all fields participate in the join,&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LEFT&lt;/STRONG&gt; Join(NewTable)&lt;BR /&gt;&lt;STRONG&gt;Load DISTINCT *,&lt;BR /&gt;&lt;/STRONG&gt; if(zzEuros = 0 and zzQtyKG &amp;lt;&amp;gt; 0, 1, 0) AS zzNoVolume,&lt;BR /&gt;if(zzQtyKG = 0 and zzEuros &amp;lt;&amp;gt; 0, 1, 0) AS zzNoSpend,&lt;BR /&gt;if(left(Material,8) = 'Non Item',1,0) as zzNonItem,&lt;BR /&gt;if(left(Material,4) = 'TEMP',1,0) as zzTemp&lt;/P&gt;&lt;P&gt;Resident NewTable;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Mar 2011 16:52:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Script-Replicating-Existing-Tables-QV-v8-5/m-p/179981#M46589</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2011-03-24T16:52:21Z</dc:date>
    </item>
  </channel>
</rss>

