<?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 Concatenate tables + Where clause in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Concatenate-tables-Where-clause/m-p/195835#M56177</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, that's &lt;EM&gt;simpler&lt;/EM&gt; (assuming you meant RESIDENT VFACTURA). The reason I don't do it that way is performance. With the simpler approach, you do a resident load of the full table. For smaller data sets, that won't be an issue. But for larger data sets, that can take quite a bit of time.&lt;/P&gt;&lt;P&gt;The approach I'm using instead reads in QlikView's internal list of the possible values of the date. Since there are usually a very limited number of dates compared to rows in the source table, that's usually MUCH faster than reading the source table. The downside, obviously, is the extra script complexity. My approach also won't do what you want if you only want dates from ONE table, and not dates of the same name from a different table, unless you can shift your load order around so that you do this while only the dates you want are in memory.&lt;/P&gt;&lt;P&gt;Either way works.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 29 Mar 2010 16:57:28 GMT</pubDate>
    <dc:creator>johnw</dc:creator>
    <dc:date>2010-03-29T16:57:28Z</dc:date>
    <item>
      <title>Concatenate tables + Where clause</title>
      <link>https://community.qlik.com/t5/QlikView/Concatenate-tables-Where-clause/m-p/195830#M56172</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi everyone, this time my issue is about concantenate tables depending a where clause&lt;/P&gt;&lt;P&gt;So, I've a table VFACTURA with a date (fec_emis).&lt;/P&gt;&lt;P&gt;The second part, the one i want to concatenate, have the same fields BUT I need to make a condition WHERE the fec_emis of the actual table be over the one of the first part.&lt;/P&gt;&lt;P&gt;In order to get that, i created a variable with the max date of the first part, so i can use it in the where clause of the second one:&lt;/P&gt;&lt;P&gt;&lt;PRE&gt;&lt;/PRE&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;VFACTURA:&lt;/B&gt;&lt;BR /&gt;LOAD&lt;/P&gt;&lt;P&gt;:&lt;BR /&gt; fec_emis AS fec_emis,&lt;/P&gt;&lt;P&gt;:&lt;BR /&gt;FROM VFACTURAlight.QVD (qvd);&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;SET Mayor_Fecha= max(fec_emis);&lt;/B&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;CONCATENATE LOAD&lt;/P&gt;&lt;P&gt;:&lt;/P&gt;&lt;P&gt;fec_emis AS fec_emis,&lt;/P&gt;&lt;P&gt;:&lt;/P&gt;&lt;P&gt;FROM VFACTURA.QVD (qvd)&lt;BR /&gt;&lt;B&gt;WHERE fec_emis &amp;gt; $(Mayor_Fecha);&lt;/B&gt;&lt;BR /&gt;&lt;BR /&gt;STORE VFACTURA INTO VFACTURA2.QVD;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;At the reload, it only load the first table and the error: &lt;I&gt;&lt;B&gt;Execution of Script failed, Reload old data?&lt;/B&gt;&lt;/I&gt; is given.&lt;/P&gt;&lt;P style="font-style: italic"&gt;What am I doing wrong?? Can u recommend me a way to achieve my goal?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thxs in advance!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Mar 2010 15:20:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Concatenate-tables-Where-clause/m-p/195830#M56172</guid>
      <dc:creator />
      <dc:date>2010-03-26T15:20:58Z</dc:date>
    </item>
    <item>
      <title>Concatenate tables + Where clause</title>
      <link>https://community.qlik.com/t5/QlikView/Concatenate-tables-Where-clause/m-p/195831#M56173</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I guess it is because &lt;STRONG&gt;max()&lt;/STRONG&gt; function requires the &lt;STRONG&gt;group by&lt;/STRONG&gt; clause.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Mar 2010 15:34:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Concatenate-tables-Where-clause/m-p/195831#M56173</guid>
      <dc:creator>justinasp</dc:creator>
      <dc:date>2010-03-26T15:34:50Z</dc:date>
    </item>
    <item>
      <title>Concatenate tables + Where clause</title>
      <link>https://community.qlik.com/t5/QlikView/Concatenate-tables-Where-clause/m-p/195832#M56174</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I tried with the GROUP BY enterprise, like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;&lt;BR /&gt;&lt;BR /&gt;VFACTURA:&lt;BR /&gt;LOAD&lt;BR /&gt; fec_emis AS fec_emis,&lt;BR /&gt; CO_ENTERPRISE,&lt;BR /&gt; :&lt;BR /&gt;FROM VFACTURAlight.QVD (qvd)&lt;BR /&gt;GROUP BY CO_ENTERPRISE;&lt;BR /&gt;&lt;BR /&gt;SET Mayor_Fecha= max(fec_emis);&lt;BR /&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;And i get the error: &lt;I&gt;&lt;B&gt;Aggregation expressions required by GROUP BY clause&lt;/B&gt;&lt;/I&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you be more specific and show me an example...??&lt;/P&gt;&lt;P&gt;Can i group by any field, indistinctly???&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Mar 2010 15:44:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Concatenate-tables-Where-clause/m-p/195832#M56174</guid>
      <dc:creator />
      <dc:date>2010-03-26T15:44:00Z</dc:date>
    </item>
    <item>
      <title>Concatenate tables + Where clause</title>
      <link>https://community.qlik.com/t5/QlikView/Concatenate-tables-Where-clause/m-p/195833#M56175</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think you want this (untested):&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;VFACTURA:&lt;BR /&gt;LOAD&lt;BR /&gt; :&lt;BR /&gt; fec_emis AS fec_emis,&lt;BR /&gt; :&lt;BR /&gt;FROM VFACTURAlight.QVD (qvd);&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;&lt;STRONG&gt;fec_emis:&lt;BR /&gt;LOAD fieldvalue('fec_emis',iterno()) as fec_emis&lt;BR /&gt;AUTOGENERATE 1&lt;BR /&gt;WHILE len(fieldvalue('fec_emis',iterno()))&lt;BR /&gt;;&lt;BR /&gt;mayor_fecha:&lt;BR /&gt;LOAD max(fec_emis) as mayor_fecha&lt;BR /&gt;RESIDENT fec_emis&lt;BR /&gt;;&lt;BR /&gt;SET Mayor_Fecha = peek('mayor_fecha')&lt;BR /&gt;;&lt;BR /&gt;DROP TABLES&lt;BR /&gt; fec_emis&lt;BR /&gt;,mayor_fecha&lt;BR /&gt;;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;CONCATENATE LOAD&lt;BR /&gt; :&lt;BR /&gt; fec_emis AS fec_emis,&lt;BR /&gt; :&lt;BR /&gt;FROM VFACTURA.QVD (qvd)&lt;BR /&gt;WHERE fec_emis &amp;gt; $(Mayor_Fecha);&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;STORE VFACTURA INTO VFACTURA2.QVD;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Mar 2010 21:13:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Concatenate-tables-Where-clause/m-p/195833#M56175</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2010-03-26T21:13:39Z</dc:date>
    </item>
    <item>
      <title>Concatenate tables + Where clause</title>
      <link>https://community.qlik.com/t5/QlikView/Concatenate-tables-Where-clause/m-p/195834#M56176</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;it works..... but unless there is somthing im missing (very possible) isnt this simpler?:&lt;/P&gt;&lt;P&gt;VFACTURA:&lt;BR /&gt;LOAD&lt;BR /&gt;&lt;BR /&gt; :&lt;BR /&gt; fec_emis AS fec_emis,&lt;BR /&gt;&lt;BR /&gt; :&lt;BR /&gt;FROM VFACTURAlight.QVD (qvd);&lt;BR /&gt;&lt;BR /&gt;mayor_fecha:&lt;BR /&gt;LOAD max(fec_emis) as mayor_fecha&lt;BR /&gt;RESIDENT fec_emis&lt;BR /&gt;;&lt;BR /&gt;SET Mayor_Fecha = peek('mayor_fecha')&lt;BR /&gt;&lt;BR /&gt;drop table mayor_fecha;&lt;BR /&gt;&lt;BR /&gt;CONCATENATE LOAD&lt;BR /&gt;&lt;BR /&gt; :&lt;BR /&gt;&lt;BR /&gt; fec_emis AS fec_emis,&lt;BR /&gt;&lt;BR /&gt; :&lt;BR /&gt;&lt;BR /&gt;FROM VFACTURA.QVD (qvd)&lt;BR /&gt;WHERE fec_emis &amp;gt; $(Mayor_Fecha);&lt;BR /&gt;&lt;BR /&gt;STORE VFACTURA INTO VFACTURA2.QVD;&lt;BR /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 28 Mar 2010 19:05:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Concatenate-tables-Where-clause/m-p/195834#M56176</guid>
      <dc:creator>wizardo</dc:creator>
      <dc:date>2010-03-28T19:05:33Z</dc:date>
    </item>
    <item>
      <title>Concatenate tables + Where clause</title>
      <link>https://community.qlik.com/t5/QlikView/Concatenate-tables-Where-clause/m-p/195835#M56177</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, that's &lt;EM&gt;simpler&lt;/EM&gt; (assuming you meant RESIDENT VFACTURA). The reason I don't do it that way is performance. With the simpler approach, you do a resident load of the full table. For smaller data sets, that won't be an issue. But for larger data sets, that can take quite a bit of time.&lt;/P&gt;&lt;P&gt;The approach I'm using instead reads in QlikView's internal list of the possible values of the date. Since there are usually a very limited number of dates compared to rows in the source table, that's usually MUCH faster than reading the source table. The downside, obviously, is the extra script complexity. My approach also won't do what you want if you only want dates from ONE table, and not dates of the same name from a different table, unless you can shift your load order around so that you do this while only the dates you want are in memory.&lt;/P&gt;&lt;P&gt;Either way works.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Mar 2010 16:57:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Concatenate-tables-Where-clause/m-p/195835#M56177</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2010-03-29T16:57:28Z</dc:date>
    </item>
  </channel>
</rss>

