<?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: Group by in Load statement, how do I pick values from the same row? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Group-by-in-Load-statement-how-do-I-pick-values-from-the-same/m-p/850549#M298344</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you sunindia&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 08 Jun 2015 17:54:52 GMT</pubDate>
    <dc:creator>cicciput</dc:creator>
    <dc:date>2015-06-08T17:54:52Z</dc:date>
    <item>
      <title>Group by in Load statement, how do I pick values from the same row?</title>
      <link>https://community.qlik.com/t5/QlikView/Group-by-in-Load-statement-how-do-I-pick-values-from-the-same/m-p/850544#M298339</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a one-to-many Account - Contact structure, where a single Account can have many Contacts.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I need is simply to load the Account with first and last name of the first contact — which happens to have the lowest %ContactID — but I don't know, once I pick Min(%ContactID) how do I pick also first and last name of &lt;EM&gt;that row&lt;/EM&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This does not work:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Only, as intended, returns null when more than one value is found&lt;/LI&gt;&lt;LI&gt;placing &lt;SPAN style="font-family: 'courier new', courier; font-size: 13.3333330154419px;"&gt;Contact.FirstName&lt;/SPAN&gt; and &lt;SPAN style="font-family: 'courier new', courier; font-size: 13.3333330154419px;"&gt;Contact.LastName&lt;/SPAN&gt; in Group By returns multiple rows for the same account&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;LOAD %AccountID, &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Account.Name&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Account.DCF&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;FROM Account.qvd (qvd);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;LEFT JOIN (Account)&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;LOAD %AccountID, &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; MIN(%ContactID) AS %ContactID, &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Only(Contact.FirstName) &amp;amp; ' ' &amp;amp; Only(Contact.LastName) AS Account.PrimaryContactName&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;RESIDENT Contact.qvd (qvd)&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;GROUP BY %AccountID&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;ORDER BY %ContactID;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;/P&gt;&lt;P style="text-align: left;"&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;Thanks for your support&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="text-align: left;"&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="text-align: left;"&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;P.S.: the only solution I found is another LEFT JOIN (Account) with Contact and load corresponding first and last name, I was trying to understand if the same result can be achieved with one single pass and/or what is more efficient.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Jun 2015 17:39:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Group-by-in-Load-statement-how-do-I-pick-values-from-the-same/m-p/850544#M298339</guid>
      <dc:creator>cicciput</dc:creator>
      <dc:date>2015-06-08T17:39:16Z</dc:date>
    </item>
    <item>
      <title>Re: Group by in Load statement, how do I pick values from the same row?</title>
      <link>https://community.qlik.com/t5/QlikView/Group-by-in-Load-statement-how-do-I-pick-values-from-the-same/m-p/850545#M298340</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try using MINSTRING() and FirstValue&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="xml" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14337856211811608" jivemacro_uid="_14337856211811608"&gt;
&lt;P&gt;t:&lt;/P&gt;
&lt;P&gt;LOAD * INLINE [&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Account, FirstName, LastName&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1, john, doe&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1, william , smith&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1, abraham, lincoln&lt;/P&gt;
&lt;P&gt;];&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;LOAD&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Account,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; MinString(FirstName) as MinStringFirstName,&amp;nbsp; //&amp;nbsp; Abraham&lt;/P&gt;
&lt;P&gt;&amp;nbsp; FirstValue(FirstName) as FirstValueName&amp;nbsp; // john&lt;/P&gt;
&lt;P&gt;Resident t&lt;/P&gt;
&lt;P&gt;Group by Account;&lt;/P&gt;
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Jun 2015 17:41:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Group-by-in-Load-statement-how-do-I-pick-values-from-the-same/m-p/850545#M298340</guid>
      <dc:creator>Clever_Anjos</dc:creator>
      <dc:date>2015-06-08T17:41:38Z</dc:date>
    </item>
    <item>
      <title>Re: Group by in Load statement, how do I pick values from the same row?</title>
      <link>https://community.qlik.com/t5/QlikView/Group-by-in-Load-statement-how-do-I-pick-values-from-the-same/m-p/850546#M298341</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'courier new', courier; font-size: 13px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'courier new', courier; font-size: 13px;"&gt;&lt;STRONG&gt;LEFT JOIN (Account)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding: 0px 0px 0px 30px; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; text-align: left;"&gt;&lt;STRONG style="font-style: inherit; font-family: 'courier new', courier;"&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; text-align: left;"&gt;&lt;STRONG style="font-style: inherit; font-family: 'courier new', courier;"&gt;LOAD %AccountID,&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; text-align: left;"&gt;&lt;STRONG style="font-style: inherit; font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Min(%ContactID) AS %ContactID,&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; text-align: left;"&gt;&lt;STRONG style="font-style: inherit; font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FirstValue (Contact.FirstName &amp;amp; ' ' &amp;amp; Contact.LastName) AS Account.PrimaryContactName&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; text-align: left;"&gt;&lt;STRONG style="font-style: inherit; font-family: 'courier new', courier;"&gt;RESIDENT Contact.qvd (qvd)&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; text-align: left;"&gt;&lt;STRONG style="font-style: inherit; font-family: 'courier new', courier;"&gt;GROUP BY %AccountID&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; text-align: left;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;ORDER BY &lt;SPAN style="color: #3d3d3d; font-family: 'courier new', courier; font-size: 13px;"&gt;%AccountID, &lt;/SPAN&gt;%ContactID;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Jun 2015 17:44:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Group-by-in-Load-statement-how-do-I-pick-values-from-the-same/m-p/850546#M298341</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2015-06-08T17:44:43Z</dc:date>
    </item>
    <item>
      <title>Re: Group by in Load statement, how do I pick values from the same row?</title>
      <link>https://community.qlik.com/t5/QlikView/Group-by-in-Load-statement-how-do-I-pick-values-from-the-same/m-p/850547#M298342</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try FirstSortedValue:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding: 0 0 0 30px; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: 'courier new', courier;"&gt;LOAD %AccountID,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding: 0 0 0 30px; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; MIN(%ContactID) AS %ContactID,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding: 0 0 0 30px; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; FirstSortedValue(Contact.FirstName, %ContactID) &amp;amp; ' ' &amp;amp; FirstSortedValue(Contact.LastName, %ContactID) AS Account.PrimaryContactName&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding: 0 0 0 30px; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: 'courier new', courier;"&gt;RESIDENT Contact.qvd (qvd)&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding: 0 0 0 30px; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: 'courier new', courier;"&gt;GROUP BY %AccountID&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding: 0 0 0 30px; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: 'courier new', courier;"&gt;ORDER BY %ContactID;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding: 0 0 0 30px; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="padding: 0 0 0 30px; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="padding: 0 0 0 30px; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="padding: 0 0 0 30px; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Since you have sorted your records, also just a FirstValue(Contact.LastName) might work.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Jun 2015 17:46:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Group-by-in-Load-statement-how-do-I-pick-values-from-the-same/m-p/850547#M298342</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2015-06-08T17:46:04Z</dc:date>
    </item>
    <item>
      <title>Re: Group by in Load statement, how do I pick values from the same row?</title>
      <link>https://community.qlik.com/t5/QlikView/Group-by-in-Load-statement-how-do-I-pick-values-from-the-same/m-p/850548#M298343</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Won't MINSTRING return the first and last names in alphabetical order, regardless they are of the first or even of the same contact?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edit: I saw your edit, now I got it, what I need is the first entered, not the first in alphabetical order, thanks anyway&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Jun 2015 17:48:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Group-by-in-Load-statement-how-do-I-pick-values-from-the-same/m-p/850548#M298343</guid>
      <dc:creator>cicciput</dc:creator>
      <dc:date>2015-06-08T17:48:33Z</dc:date>
    </item>
    <item>
      <title>Re: Group by in Load statement, how do I pick values from the same row?</title>
      <link>https://community.qlik.com/t5/QlikView/Group-by-in-Load-statement-how-do-I-pick-values-from-the-same/m-p/850549#M298344</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you sunindia&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Jun 2015 17:54:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Group-by-in-Load-statement-how-do-I-pick-values-from-the-same/m-p/850549#M298344</guid>
      <dc:creator>cicciput</dc:creator>
      <dc:date>2015-06-08T17:54:52Z</dc:date>
    </item>
    <item>
      <title>Re: Group by in Load statement, how do I pick values from the same row?</title>
      <link>https://community.qlik.com/t5/QlikView/Group-by-in-Load-statement-how-do-I-pick-values-from-the-same/m-p/850550#M298345</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for the explanation&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Jun 2015 17:55:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Group-by-in-Load-statement-how-do-I-pick-values-from-the-same/m-p/850550#M298345</guid>
      <dc:creator>cicciput</dc:creator>
      <dc:date>2015-06-08T17:55:48Z</dc:date>
    </item>
  </channel>
</rss>

