<?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: Select only() on field based on Recno but Garbage after Group BY in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Select-only-on-field-based-on-Recno-but-Garbage-after-Group-BY/m-p/1146871#M634290</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not sure what you are trying to achieve, but IMHO, it doesn't make much sense to group by record number.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your code does not seem to return the same Description without the group by clause, though I might not use input records similar to yours.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;&amp;nbsp; %CO_Area,&lt;/P&gt;&lt;P&gt;&amp;nbsp; %Cost_Center,&lt;/P&gt;&lt;P&gt;&amp;nbsp; [Cost Center Description],&lt;/P&gt;&lt;P&gt;&amp;nbsp; KeepChar(Right(%Cost_Center,4) &amp;amp; '-' &amp;amp; %CO_Area &amp;amp; [Cost Center Description],[Cost Center Description]) As Description&lt;/P&gt;&lt;P&gt;INLINE [&lt;/P&gt;&lt;P&gt;&amp;nbsp; %CO_Area,&amp;nbsp; %Cost_Center,Cost Center Description&lt;/P&gt;&lt;P&gt;&amp;nbsp; 1010, 1111,EXAMPLE1&lt;/P&gt;&lt;P&gt;&amp;nbsp; 1020, 1111,EXAMPLE2&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 19 Jun 2016 11:29:35 GMT</pubDate>
    <dc:creator>swuehl</dc:creator>
    <dc:date>2016-06-19T11:29:35Z</dc:date>
    <item>
      <title>Select only() on field based on Recno but Garbage after Group BY</title>
      <link>https://community.qlik.com/t5/QlikView/Select-only-on-field-based-on-Recno-but-Garbage-after-Group-BY/m-p/1146867#M634285</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey there,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so I have this script, the description is unique to the rec num, and I can bring it in fine, but when I try to group by I get the garbage error. Here is the code below, am I approaching this incorrectly?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Garbage after statement&lt;/P&gt;&lt;P&gt;Test:&lt;/P&gt;&lt;P&gt;Load &lt;/P&gt;&lt;P&gt;&amp;nbsp; %CO_Area,&lt;/P&gt;&lt;P&gt;&amp;nbsp; %Cost_Center,&lt;/P&gt;&lt;P&gt;&amp;nbsp; only([Cost Center Description]),&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&amp;nbsp; only(KeepChar(Right(%Cost_Center,4) &amp;amp; '-' &amp;amp; %CO_Area &amp;amp; [Cost Center Description],[Cost Center Description])) As Description,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; RecNo() As RecNum&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; Group By&lt;/P&gt;&lt;P&gt;&amp;nbsp; RecNum&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;//Another QVD&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 18 Jun 2016 15:44:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Select-only-on-field-based-on-Recno-but-Garbage-after-Group-BY/m-p/1146867#M634285</guid>
      <dc:creator />
      <dc:date>2016-06-18T15:44:36Z</dc:date>
    </item>
    <item>
      <title>Re: Select only() on field based on Recno but Garbage after Group BY</title>
      <link>https://community.qlik.com/t5/QlikView/Select-only-on-field-based-on-Recno-but-Garbage-after-Group-BY/m-p/1146868#M634286</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;a) the GROUP BY clause should be put after the FROM &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;b) RecNum is created in the LOAD statement, so it's not available as field name from the input table source&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;c) you would need to apply aggregation functions to all fields not listed in the GROUP BY (e.g. there are missing aggregations for %CO_Area, %Cost_Center&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;d) why do you want to group by Recno() at all?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 18 Jun 2016 19:19:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Select-only-on-field-based-on-Recno-but-Garbage-after-Group-BY/m-p/1146868#M634286</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2016-06-18T19:19:03Z</dc:date>
    </item>
    <item>
      <title>Re: Select only() on field based on Recno but Garbage after Group BY</title>
      <link>https://community.qlik.com/t5/QlikView/Select-only-on-field-based-on-Recno-but-Garbage-after-Group-BY/m-p/1146869#M634287</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you so much for your input&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;see what is happening is, probably best illustrated by an example&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;a CO_AREA and Cost Center (ex.. 1010-1111 might have a description of EXAMPLE1&lt;/P&gt;&lt;P&gt;and another CO_AREA and Coster (ex.1020-1111 might have a description of EXAMPLE2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if I just load Cost Center Descriptions as is, both of these two rows/records will show EXAMPLE2 and I am hoping there might be a way to make sure each individual cost center description is associated with each row when imported from the QVD&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it explains it better!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 18 Jun 2016 22:35:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Select-only-on-field-based-on-Recno-but-Garbage-after-Group-BY/m-p/1146869#M634287</guid>
      <dc:creator />
      <dc:date>2016-06-18T22:35:53Z</dc:date>
    </item>
    <item>
      <title>Re: Select only() on field based on Recno but Garbage after Group BY</title>
      <link>https://community.qlik.com/t5/QlikView/Select-only-on-field-based-on-Recno-but-Garbage-after-Group-BY/m-p/1146870#M634288</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Oh and a quick follow up, where could I put the RecNo() function to count the records from the QVD and use it in the group by?, I can't do it in the load right, if I just load it I get the rec numbers fine and no crash and can see the column&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;just adding the group by crashes it, I tried aggregating the rest and then it tells me that RecNum is not a valid field or something to that effect haah&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Once again thanks for your input!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 18 Jun 2016 22:50:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Select-only-on-field-based-on-Recno-but-Garbage-after-Group-BY/m-p/1146870#M634288</guid>
      <dc:creator />
      <dc:date>2016-06-18T22:50:56Z</dc:date>
    </item>
    <item>
      <title>Re: Select only() on field based on Recno but Garbage after Group BY</title>
      <link>https://community.qlik.com/t5/QlikView/Select-only-on-field-based-on-Recno-but-Garbage-after-Group-BY/m-p/1146871#M634290</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not sure what you are trying to achieve, but IMHO, it doesn't make much sense to group by record number.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your code does not seem to return the same Description without the group by clause, though I might not use input records similar to yours.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;&amp;nbsp; %CO_Area,&lt;/P&gt;&lt;P&gt;&amp;nbsp; %Cost_Center,&lt;/P&gt;&lt;P&gt;&amp;nbsp; [Cost Center Description],&lt;/P&gt;&lt;P&gt;&amp;nbsp; KeepChar(Right(%Cost_Center,4) &amp;amp; '-' &amp;amp; %CO_Area &amp;amp; [Cost Center Description],[Cost Center Description]) As Description&lt;/P&gt;&lt;P&gt;INLINE [&lt;/P&gt;&lt;P&gt;&amp;nbsp; %CO_Area,&amp;nbsp; %Cost_Center,Cost Center Description&lt;/P&gt;&lt;P&gt;&amp;nbsp; 1010, 1111,EXAMPLE1&lt;/P&gt;&lt;P&gt;&amp;nbsp; 1020, 1111,EXAMPLE2&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 19 Jun 2016 11:29:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Select-only-on-field-based-on-Recno-but-Garbage-after-Group-BY/m-p/1146871#M634290</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2016-06-19T11:29:35Z</dc:date>
    </item>
  </channel>
</rss>

