<?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 Concatenating and RecNo() problem in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Concatenating-and-RecNo-problem/m-p/216208#M715255</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Paulo, I'm guessing you concatenate both qvds, historical and new data. In this case, use the funtion rowno(), it doesn't reset between load statements and does not count the records excluded by a where clause. I think for your task in particular, the function rowno() is safer.&lt;/P&gt;&lt;P&gt;Load *&lt;/P&gt;&lt;P&gt;from historical.qvd (qvd);&lt;/P&gt;&lt;P&gt;concatenate&lt;/P&gt;&lt;P&gt;load *, rowno() as ID&lt;/P&gt;&lt;P&gt;from new.qvd (qvd);&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 23 Sep 2010 20:39:35 GMT</pubDate>
    <dc:creator />
    <dc:date>2010-09-23T20:39:35Z</dc:date>
    <item>
      <title>Concatenating and RecNo() problem</title>
      <link>https://community.qlik.com/t5/QlikView/Concatenating-and-RecNo-problem/m-p/216207#M715254</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is the nature of my problem:&lt;/P&gt;&lt;P&gt;I have an optimized QVD that acts as my master data file for historical data. It has a key field in it that is manually set by RecNo(); this assures that every row is unique. I am trying to run an update every week, that will concatenate new data to my master QVD and pick up the ID field where the master left off. So as an example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Master QVD&lt;/P&gt;&lt;P&gt;ID Name Comment&lt;/P&gt;&lt;P&gt;1 Bob Good&lt;/P&gt;&lt;P&gt;2 Sally Nice&lt;/P&gt;&lt;P&gt;3 Joe Bad&lt;/P&gt;&lt;P&gt;4 Sarah Terrible&lt;/P&gt;&lt;P&gt;.... .... ....&lt;/P&gt;&lt;P&gt;Now let's say my master QVD file has 100 records, and the last ID is 100 (created by RecNo() function)&lt;/P&gt;&lt;P&gt;Now I'm running an update for the week, and I wanna concatenate 10 new records.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Update QVD&lt;/P&gt;&lt;P&gt;ID Name Comment&lt;/P&gt;&lt;P&gt;101 Steve Good&lt;/P&gt;&lt;P&gt;102 Mike Nice&lt;/P&gt;&lt;P&gt;103 Tony Bad&lt;/P&gt;&lt;P&gt;104 Kate Terrible&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;... ... ...&lt;/P&gt;&lt;P&gt;110 Bob Great&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I've tried doing already was to set a variable like varLastID = NoOfRows('MasterQVD')&lt;/P&gt;&lt;P&gt;then as my ID for the week update I would have&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;varLastID + RecNo() AS ID&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and finally, concatenate the two tables... For some reason, I am getting duplicate ID's still. Is there an easier way to insure that I have unique keys if I am manually creating them? I don't really want to join two fields and have that as my key, that tends to get messy. I just want a simple counter that will pick up where my master table left off. Would preceding loads affect the RecNo() function? Even if I had it at the top LOAD?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Sep 2010 20:13:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Concatenating-and-RecNo-problem/m-p/216207#M715254</guid>
      <dc:creator />
      <dc:date>2010-09-23T20:13:23Z</dc:date>
    </item>
    <item>
      <title>Concatenating and RecNo() problem</title>
      <link>https://community.qlik.com/t5/QlikView/Concatenating-and-RecNo-problem/m-p/216208#M715255</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Paulo, I'm guessing you concatenate both qvds, historical and new data. In this case, use the funtion rowno(), it doesn't reset between load statements and does not count the records excluded by a where clause. I think for your task in particular, the function rowno() is safer.&lt;/P&gt;&lt;P&gt;Load *&lt;/P&gt;&lt;P&gt;from historical.qvd (qvd);&lt;/P&gt;&lt;P&gt;concatenate&lt;/P&gt;&lt;P&gt;load *, rowno() as ID&lt;/P&gt;&lt;P&gt;from new.qvd (qvd);&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Sep 2010 20:39:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Concatenating-and-RecNo-problem/m-p/216208#M715255</guid>
      <dc:creator />
      <dc:date>2010-09-23T20:39:35Z</dc:date>
    </item>
  </channel>
</rss>

