<?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 Concatenation - De - duplication of Rows in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Concatenation-De-duplication-of-Rows/m-p/310983#M710164</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Cheers Simon!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would prefer it if I could avoid having the row id in the document to reduce the size of it. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However it doesn't look like it is possible. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried to drop the field after I had done the concatenation and that reduced the number of rows in my table as well.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I will have to leave it in.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 28 Jul 2011 13:32:30 GMT</pubDate>
    <dc:creator>richardcripps</dc:creator>
    <dc:date>2011-07-28T13:32:30Z</dc:date>
    <item>
      <title>Concatenation - De - duplication of Rows</title>
      <link>https://community.qlik.com/t5/QlikView/Concatenation-De-duplication-of-Rows/m-p/310981#M710162</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I guess this question stems around the behaviour of the concatenate function, but I was wondering if any one had seen anything similar.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a piece of script that loads in some data (c. 60 million rows) from a QVD and then takes some data from an existing resident table (c. 85k rows) and concatenates it to the data from the qvd. I would expect the result of this piece of script to be a table with a total number of rows that is the number from the QVD and the number from the resident table i.e. 60 million + 85k. However, the result is a table with around 40 million rows in it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Below is the script in question.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;UserAction:&lt;BR /&gt;LOAD&amp;nbsp; join.Subscriber, &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; join.ResourceCode,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; join.UserActionType, &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Month,&lt;BR /&gt;&amp;nbsp; Year,&lt;BR /&gt;&amp;nbsp; YearMonth,&lt;BR /&gt;&amp;nbsp; Week,&lt;BR /&gt;&amp;nbsp; YearWeek,&lt;BR /&gt;&amp;nbsp; Hour,&lt;BR /&gt;&amp;nbsp; Day,&lt;BR /&gt;&amp;nbsp; join.ResourceCommentID,&lt;BR /&gt;&amp;nbsp; ActionCount&lt;BR /&gt;FROM&lt;BR /&gt;[UserAction.qvd]&lt;BR /&gt;(qvd);&lt;/P&gt;&lt;P&gt;CONCATENATE(UserAction)&amp;nbsp;&amp;nbsp; &lt;BR /&gt;LOAD DISTINCT Resource.SITEUSERCODE AS join.Subscriber,&lt;BR /&gt;&amp;nbsp; join.ResourceCode, &lt;BR /&gt;&amp;nbsp; 99 AS join.UserActionType,&lt;BR /&gt;&amp;nbsp;&amp;nbsp; MONTH(join.PubDate) AS Month,&lt;BR /&gt;&amp;nbsp; YEAR(join.PubDate) AS Year,&lt;BR /&gt;&amp;nbsp; YEAR(join.PubDate) &amp;amp; NUM(MONTH(join.PubDate),'00') AS YearMonth,&lt;BR /&gt;&amp;nbsp; WEEK(join.PubDate) AS Week,&lt;BR /&gt;&amp;nbsp; YEAR(join.PubDate) &amp;amp; NUM(WEEK(join.PubDate),'00') AS YearWeek,&lt;BR /&gt;&amp;nbsp; HOUR(join.PubDate) AS Hour,&lt;BR /&gt;&amp;nbsp; DAY(join.PubDate) AS Day,&lt;BR /&gt;&amp;nbsp; null() AS join.ResourceCommentID,&lt;BR /&gt;&amp;nbsp;&amp;nbsp; 1 AS ActionCount&lt;BR /&gt;&amp;nbsp;&amp;nbsp; Resident Resource;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So what I did was to amend my code so that when loading from the QVD it uses the recno() function to basically make every row unique. And this resulted in a table with the number of rows that I would expect, see the code below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;UserAction:&lt;BR /&gt;LOAD recno() AS REC,&lt;BR /&gt;&amp;nbsp; join.Subscriber, &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; join.ResourceCode,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; join.UserActionType, &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Month,&lt;BR /&gt;&amp;nbsp; Year,&lt;BR /&gt;&amp;nbsp; YearMonth,&lt;BR /&gt;&amp;nbsp; Week,&lt;BR /&gt;&amp;nbsp; YearWeek,&lt;BR /&gt;&amp;nbsp; Hour,&lt;BR /&gt;&amp;nbsp; Day,&lt;BR /&gt;&amp;nbsp; join.ResourceCommentID,&lt;BR /&gt;&amp;nbsp; ActionCount&lt;BR /&gt;FROM&lt;BR /&gt;[UserAction.qvd]&lt;BR /&gt;(qvd);&lt;/P&gt;&lt;P&gt;CONCATENATE(UserAction)&amp;nbsp;&amp;nbsp; &lt;BR /&gt;LOAD DISTINCT Resource.SITEUSERCODE AS join.Subscriber,&lt;BR /&gt;&amp;nbsp; join.ResourceCode, &lt;BR /&gt;&amp;nbsp; 99 AS join.UserActionType,&lt;BR /&gt;&amp;nbsp;&amp;nbsp; MONTH(join.PubDate) AS Month,&lt;BR /&gt;&amp;nbsp; YEAR(join.PubDate) AS Year,&lt;BR /&gt;&amp;nbsp; YEAR(join.PubDate) &amp;amp; NUM(MONTH(join.PubDate),'00') AS YearMonth,&lt;BR /&gt;&amp;nbsp; WEEK(join.PubDate) AS Week,&lt;BR /&gt;&amp;nbsp; YEAR(join.PubDate) &amp;amp; NUM(WEEK(join.PubDate),'00') AS YearWeek,&lt;BR /&gt;&amp;nbsp; HOUR(join.PubDate) AS Hour,&lt;BR /&gt;&amp;nbsp; DAY(join.PubDate) AS Day,&lt;BR /&gt;&amp;nbsp; null() AS join.ResourceCommentID,&lt;BR /&gt;&amp;nbsp;&amp;nbsp; 1 AS ActionCount&lt;BR /&gt;&amp;nbsp;&amp;nbsp; Resident Resource;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Has anyone else seen any similar behaviour? Is the concatenation function supposed to behave like this? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Jul 2011 11:31:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Concatenation-De-duplication-of-Rows/m-p/310981#M710162</guid>
      <dc:creator>richardcripps</dc:creator>
      <dc:date>2011-07-27T11:31:27Z</dc:date>
    </item>
    <item>
      <title>Concatenation - De - duplication of Rows</title>
      <link>https://community.qlik.com/t5/QlikView/Concatenation-De-duplication-of-Rows/m-p/310982#M710163</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Richard,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is the way that concatenate works in QlikView. The DISTINCT will be applied to the whole of the UserAction table even though it is only defined in the second statement. When I originally came across this behaviour I used the same approach as you to work around it, i.e. create a unique row ID in the first table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have not clarified this behaviour with QlikTech support but it was highlighted as being WAD by one of their UK consultants some time ago.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;Simon&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Jul 2011 13:18:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Concatenation-De-duplication-of-Rows/m-p/310982#M710163</guid>
      <dc:creator>simon_hallworth</dc:creator>
      <dc:date>2011-07-28T13:18:34Z</dc:date>
    </item>
    <item>
      <title>Concatenation - De - duplication of Rows</title>
      <link>https://community.qlik.com/t5/QlikView/Concatenation-De-duplication-of-Rows/m-p/310983#M710164</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Cheers Simon!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would prefer it if I could avoid having the row id in the document to reduce the size of it. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However it doesn't look like it is possible. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried to drop the field after I had done the concatenation and that reduced the number of rows in my table as well.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I will have to leave it in.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Jul 2011 13:32:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Concatenation-De-duplication-of-Rows/m-p/310983#M710164</guid>
      <dc:creator>richardcripps</dc:creator>
      <dc:date>2011-07-28T13:32:30Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenation - De - duplication of Rows</title>
      <link>https://community.qlik.com/t5/QlikView/Concatenation-De-duplication-of-Rows/m-p/310984#M710165</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I just noticed this as well after doing multiple concatenations so now I am placing a RecNo or RowNo all the time on concatenated tables to prevent a distinct from happening&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 15 Feb 2014 18:44:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Concatenation-De-duplication-of-Rows/m-p/310984#M710165</guid>
      <dc:creator />
      <dc:date>2014-02-15T18:44:29Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenation - De - duplication of Rows</title>
      <link>https://community.qlik.com/t5/QlikView/Concatenation-De-duplication-of-Rows/m-p/310985#M710166</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;if you need a distinct only on the small table Resource I think you can (without recno / rowno)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TmpResource:&lt;/P&gt;&lt;P&gt;load distinct ......&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Resident Resource;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;UserAction&lt;/SPAN&gt;:&lt;/P&gt;&lt;P&gt;noconcatenate load * ........... &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;FROM &lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;[UserAction.qvd] &lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;(qvd);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;concatenate (&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;UserAction&lt;/SPAN&gt;) load * resident Resource;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;drop table Resource;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 15 Feb 2014 19:07:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Concatenation-De-duplication-of-Rows/m-p/310985#M710166</guid>
      <dc:creator>maxgro</dc:creator>
      <dc:date>2014-02-15T19:07:43Z</dc:date>
    </item>
  </channel>
</rss>

