<?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: How to eliminate system fields left over from a join. in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/How-to-eliminate-system-fields-left-over-from-a-join/m-p/803970#M663780</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't think the system fields have anything to do with it. And a table box will never show duplicate records. Your join is probably not doing what you expect. A left join does not guarantee that the result table won't have more records than the left table:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;T1:&lt;/P&gt;&lt;P&gt;LOAD * INLINE [&lt;/P&gt;&lt;P&gt;A, B&lt;/P&gt;&lt;P&gt;1, 2&lt;/P&gt;&lt;P&gt;1, 4&lt;/P&gt;&lt;P&gt;2, 6&lt;/P&gt;&lt;P&gt;2, 8&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Left Join (T4)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD * INLINE [&lt;/P&gt;&lt;P&gt;A, C&lt;/P&gt;&lt;P&gt;1, 10&lt;/P&gt;&lt;P&gt;1, 20&lt;/P&gt;&lt;P&gt;1, 30&lt;/P&gt;&lt;P&gt;1, 40&lt;/P&gt;&lt;P&gt;1, 50&lt;/P&gt;&lt;P&gt;1, 60&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The result of this join is a table with 14 rows, not 4 rows.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think you'll need have to take a good look at the data in key fields of the tables you're joining.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 13 Feb 2015 19:15:07 GMT</pubDate>
    <dc:creator>Gysbert_Wassenaar</dc:creator>
    <dc:date>2015-02-13T19:15:07Z</dc:date>
    <item>
      <title>How to eliminate system fields left over from a join.</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-eliminate-system-fields-left-over-from-a-join/m-p/803967#M663777</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 am a pretty new user and having an issue with something that I just can't seem to find anything about on the web.&amp;nbsp; I have actually been able to find answers to all my questions from previous posts, just not this one.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ok, what am I doing wrong.&amp;nbsp; I have two tables that I have joined together with a Left Join.&amp;nbsp; The first table has about 4k records, the second has 22k, so it should remove all by the 4k matches to the first table in the new joined table, right?&amp;nbsp; In fact, it does, kind of.&amp;nbsp; When I pull &lt;SPAN style="text-decoration: underline;"&gt;just&lt;/SPAN&gt; that data into a table box related to this table I can see just the 4k records.&amp;nbsp; However, if I look at the preview of the new table in the Table Viewer, it has 22k records.&amp;nbsp; It took me a while to figure out the discrepancy, but it is because of these system fields that start with a "$", in particular the $RowNo field.&amp;nbsp; It appears to have one of those for each row whether it was eliminated or not.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I might have been able to live with this but A) I am eventually going to have lots more records and don't want to waste the space, and B) I am trying to do calculations in the script off these rows with something like a PEEK function, but having all these dummy records in there is making that a lot harder.&amp;nbsp; What's more, i just feel like I must be doing something wrong.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Below is the part of the code in question in case that helps, as well as two screenshots of what it is producing.&amp;nbsp; You can see that the first, smaller table is actually a grouped portion of the original table, basically taking a weekly packaging BOM and reducing it to one line that represents to total cost of that BOM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance for any thoughts anyone can provide.&amp;nbsp; This is driving me crazy.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//********************Creates a second table to aggregate the data to just one line per finished good item per plant per week ending.************************&lt;/P&gt;&lt;P&gt;PackagingFilesTemp3:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp; [Summed Total STD PK $] / [Summed FG Units Produced] as [Std Cost/Unit],&lt;/P&gt;&lt;P&gt;&amp;nbsp; *;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD &lt;/P&gt;&lt;P&gt;&amp;nbsp; [FG Unique In Time],&lt;/P&gt;&lt;P&gt;&amp;nbsp; Avg([FG Units Produced]) as [Summed FG Units Produced],&lt;/P&gt;&lt;P&gt;&amp;nbsp; SUM([Total STD PK $] ) as [Summed Total STD PK $]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;Resident PackagingFilesTemp2&lt;/P&gt;&lt;P&gt;Group By [FG Unique In Time];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//*********************Joins the aggregated data back with the original table to give all the fields plus the summed up information.*************************&lt;/P&gt;&lt;P&gt;Left Join&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;&amp;nbsp; [Week Ending], &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Plant, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [FG Item], &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [FG Unique In Time]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;Resident PackagingFilesTemp2;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Drop Table PackagingFilesTemp2;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is a screenshot of a table box with JUST the fields from the table.&amp;nbsp; Looks ok as it is 1 record per finished good item number, plant and week ending.&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.qlik.com/legacyfs/online/78076_pastedImage_1.png" style="max-width: 1200px; max-height: 900px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is a second table box where I now pull in these system fields in.&amp;nbsp; Here you can see each finsihed good, plant and week ending have a number of lines, one for each line of the BOM, which all are duplicates now since they have been aggregated but the system fields are causing duplication.&amp;nbsp; This is how it looks in the Table Viewer preview too.&lt;/P&gt;&lt;P&gt;&lt;IMG class="jive-image image-2" src="https://community.qlik.com/legacyfs/online/78090_pastedImage_2.png" style="max-width: 1200px; max-height: 900px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Feb 2015 17:52:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-eliminate-system-fields-left-over-from-a-join/m-p/803967#M663777</guid>
      <dc:creator />
      <dc:date>2015-02-13T17:52:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to eliminate system fields left over from a join.</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-eliminate-system-fields-left-over-from-a-join/m-p/803968#M663778</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="text-decoration: line-through;"&gt;Does any field in the tables you create have the same name as a system field?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;edit: never mind, qlikview doesn't seem to like giving a field the same name as a system field. If you had done that you likely wouldn't be able to open the table viewer either. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Feb 2015 18:48:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-eliminate-system-fields-left-over-from-a-join/m-p/803968#M663778</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2015-02-13T18:48:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to eliminate system fields left over from a join.</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-eliminate-system-fields-left-over-from-a-join/m-p/803969#M663779</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the quick reply. I actually have no interest in using these system fields, but I can see they are causing the duplication of data in the table which is why I showed them in the table box. When I pull just the table fields the data LOOKS ok, just the 4k rows, but the table still has all 22k rows, thus lots of duplication. When I eventually load all my data there will be many millions of rows so I don't want that duplication, but it is also causing issues when I try to peek from one week to the one before (ie most of those duplicate rows and peeking to another duplicate rather than the prior week).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does that make more sense? Sorry, maybe pulling them into the table box was confusing, just wanted to point out what I believe is the source of the duplication.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sent from my Verizon Wireless 4G LTE smartphone&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Feb 2015 19:01:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-eliminate-system-fields-left-over-from-a-join/m-p/803969#M663779</guid>
      <dc:creator />
      <dc:date>2015-02-13T19:01:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to eliminate system fields left over from a join.</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-eliminate-system-fields-left-over-from-a-join/m-p/803970#M663780</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't think the system fields have anything to do with it. And a table box will never show duplicate records. Your join is probably not doing what you expect. A left join does not guarantee that the result table won't have more records than the left table:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;T1:&lt;/P&gt;&lt;P&gt;LOAD * INLINE [&lt;/P&gt;&lt;P&gt;A, B&lt;/P&gt;&lt;P&gt;1, 2&lt;/P&gt;&lt;P&gt;1, 4&lt;/P&gt;&lt;P&gt;2, 6&lt;/P&gt;&lt;P&gt;2, 8&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Left Join (T4)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD * INLINE [&lt;/P&gt;&lt;P&gt;A, C&lt;/P&gt;&lt;P&gt;1, 10&lt;/P&gt;&lt;P&gt;1, 20&lt;/P&gt;&lt;P&gt;1, 30&lt;/P&gt;&lt;P&gt;1, 40&lt;/P&gt;&lt;P&gt;1, 50&lt;/P&gt;&lt;P&gt;1, 60&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The result of this join is a table with 14 rows, not 4 rows.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think you'll need have to take a good look at the data in key fields of the tables you're joining.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Feb 2015 19:15:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-eliminate-system-fields-left-over-from-a-join/m-p/803970#M663780</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2015-02-13T19:15:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to eliminate system fields left over from a join.</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-eliminate-system-fields-left-over-from-a-join/m-p/803971#M663781</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ahhhhhh, ok.&amp;nbsp; So, when I first read your response I thought that couldn't be it.&amp;nbsp; I had tested the associations and they worked ok, and my table had a key that was unique to each row, so where your example created multiple rows in the joined table it is because there is not unique values in that column A.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, I was totally backwards in my thinking.&amp;nbsp; The first table in the LEFT JOIN had unique values, but the second table did not and that is why I was still getting the duplicates. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, there is probably a more elegant way of doing this, but I had basically created the key that I used for the aggregation off Plant/Item/week ending, and those were really the only fields I needed to pull back into the aggregated table, so I just used a subfield function to split out the key back into 3 separate fields.&amp;nbsp; Worked perfectly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you so much Gysbert.&amp;nbsp; I feel like an idiot but you got me off this train of thought around the system fields and back to the real issue.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Feb 2015 16:52:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-eliminate-system-fields-left-over-from-a-join/m-p/803971#M663781</guid>
      <dc:creator />
      <dc:date>2015-02-16T16:52:49Z</dc:date>
    </item>
  </channel>
</rss>

