<?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: Lookup and concat in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Lookup-and-concat/m-p/692012#M1056406</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Most probably the * specifier in your LOAD statement already pulls in a field called JD_CODE_REP. Check the source table Table_suivi_devis, or simply use a different name after AS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: line-through;"&gt;To be sure, put keyword NOCONCATENATE before the LOAD statement (after the table label)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Peter&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edit: sorry, noconcatenate only needed for good measure, not to fix the error.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 09 Oct 2014 14:21:04 GMT</pubDate>
    <dc:creator>Peter_Cammaert</dc:creator>
    <dc:date>2014-10-09T14:21:04Z</dc:date>
    <item>
      <title>Lookup and concat</title>
      <link>https://community.qlik.com/t5/QlikView/Lookup-and-concat/m-p/692005#M1056399</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello, here is my little problem:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For an order/quote analysis, I need to sort my quotes by commercial, customer and then order. So each quote has its own commercial, customer and finally order number. Until now, it worked perfectly until I met an order with different quotes that change of commercial over time. So two quotes where for commercial A and three quotes where for commercial B while the order number is the same.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to have the information of all the quotes but sort the order by the commercial and customer that are written on the last quote.&lt;/P&gt;&lt;P&gt;For the information, each quote has a unique code made up of the order number and the number of the quote: le say order is 105236 nd quote number 4, the unique code will look ike this: 105236v4&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Therefore I came up with the idea of using the lookup function like in excel:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD *,&lt;/P&gt;&lt;P&gt; lookup(concat(JD_NDEVIS&amp;amp;'v''max(JD_VARIANT)), JD_CODUNIQ, JD_CODE_REP&lt;/P&gt;&lt;P&gt;resident Table_suivi_devis&lt;/P&gt;&lt;P&gt;group by JD_NDEVIS;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;where JD_NDEVIS: order number&lt;/P&gt;&lt;P&gt;JD_NVARIANT: quote number&lt;/P&gt;&lt;P&gt;JD_CODUNQ: unique code of the quote&lt;/P&gt;&lt;P&gt;JD_CODE_REP: commercial&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but it tells me that there is nested aggregation or seomthing like that &lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Oct 2014 11:38:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Lookup-and-concat/m-p/692005#M1056399</guid>
      <dc:creator />
      <dc:date>2014-10-09T11:38:07Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup and concat</title>
      <link>https://community.qlik.com/t5/QlikView/Lookup-and-concat/m-p/692006#M1056400</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I do not understand this case, sorry. However, I cn try to explain why you're getting an error:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your concat() is an aggregation function and NOT a simple string concatenation (the &amp;amp; operator does that job). On the other hand, JD_CODUNIQ and JS_CODE_REP are not allowed in that spot without aggregation functions because these fields don't appear in the GROUP BY clause.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Peter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Oct 2014 12:26:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Lookup-and-concat/m-p/692006#M1056400</guid>
      <dc:creator>Peter_Cammaert</dc:creator>
      <dc:date>2014-10-09T12:26:36Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup and concat</title>
      <link>https://community.qlik.com/t5/QlikView/Lookup-and-concat/m-p/692007#M1056401</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well the thing is that I need to concatenate the JD_NDEVIS with 'v' and with the max of JD_NVARIANT (per JD_NDEVIS)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After that I need to lookup for this value I just created and get the JD_CODE_REP corresponding&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Oct 2014 12:32:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Lookup-and-concat/m-p/692007#M1056401</guid>
      <dc:creator />
      <dc:date>2014-10-09T12:32:51Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup and concat</title>
      <link>https://community.qlik.com/t5/QlikView/Lookup-and-concat/m-p/692008#M1056402</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So here is how my table looks liker right now:&lt;/P&gt;&lt;P&gt;&lt;IMG alt="plusieursrep.png" class="jive-image" src="https://community.qlik.com/legacyfs/online/68577_plusieursrep.png" style="width: 620px; height: 186px;" /&gt;&lt;/P&gt;&lt;P&gt;As you can see, for the same order, I have two customers and three commercial. Since the last quote of the order correspond to the comercial 'RS' and customer 'SPN', I would like that the other quotes go under that line &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Oct 2014 12:37:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Lookup-and-concat/m-p/692008#M1056402</guid>
      <dc:creator />
      <dc:date>2014-10-09T12:37:21Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup and concat</title>
      <link>https://community.qlik.com/t5/QlikView/Lookup-and-concat/m-p/692009#M1056403</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is how it looks like in excel and how it has to work:&lt;/P&gt;&lt;P&gt;&lt;IMG alt="excel.png" class="jive-image" src="https://community.qlik.com/legacyfs/online/68597_excel.png" style="width: 620px; height: 140px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Oct 2014 13:27:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Lookup-and-concat/m-p/692009#M1056403</guid>
      <dc:creator />
      <dc:date>2014-10-09T13:27:49Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup and concat</title>
      <link>https://community.qlik.com/t5/QlikView/Lookup-and-concat/m-p/692010#M1056404</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would do it like this:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;// Build mapping table to look up the value of &lt;EM&gt;JD_CODE_REP&lt;/EM&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;MapCodeRep:&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Mapping LOAD &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp; JD_CODUNIQ, &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp; JD_CODE_REP&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;resident &amp;lt;some table&amp;gt;;&amp;nbsp;&amp;nbsp; // this is the table containing the above two fields&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;// Now load the data and apply the map to get the correct JD_CODE_REP value&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Data:&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;LOAD *,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp; ApplyMap('MapCodeRep', JD_NDEVIS &amp;amp; 'v' &amp;amp; max(JD_VARIANT)) As JD_CODE_REP&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;resident Table_suivi_devis&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;group by JD_NDEVIS;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ApplyMap id the QV equivalent of vlookup or hlookup in Excel.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HTH&lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Oct 2014 13:39:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Lookup-and-concat/m-p/692010#M1056404</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2014-10-09T13:39:31Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup and concat</title>
      <link>https://community.qlik.com/t5/QlikView/Lookup-and-concat/m-p/692011#M1056405</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is what I need &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/grin.png" /&gt; but there is a small error, it tells me this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Fields name must be unique in table&lt;/P&gt;&lt;P&gt;Data:&lt;/P&gt;&lt;P&gt;LOAD *,&lt;/P&gt;&lt;P&gt;&amp;nbsp; ApplyMap('MapCodeRep', JD_NDEVIS &amp;amp; 'v' &amp;amp; max(JD_NVARIANT)) As JD_CODE_REP&lt;/P&gt;&lt;P&gt;resident Table_suivi_devis&lt;/P&gt;&lt;P&gt;group by JD_NDEVIS&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't see what the problem is &lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Oct 2014 13:51:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Lookup-and-concat/m-p/692011#M1056405</guid>
      <dc:creator />
      <dc:date>2014-10-09T13:51:32Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup and concat</title>
      <link>https://community.qlik.com/t5/QlikView/Lookup-and-concat/m-p/692012#M1056406</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Most probably the * specifier in your LOAD statement already pulls in a field called JD_CODE_REP. Check the source table Table_suivi_devis, or simply use a different name after AS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: line-through;"&gt;To be sure, put keyword NOCONCATENATE before the LOAD statement (after the table label)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Peter&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edit: sorry, noconcatenate only needed for good measure, not to fix the error.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Oct 2014 14:21:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Lookup-and-concat/m-p/692012#M1056406</guid>
      <dc:creator>Peter_Cammaert</dc:creator>
      <dc:date>2014-10-09T14:21:04Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup and concat</title>
      <link>https://community.qlik.com/t5/QlikView/Lookup-and-concat/m-p/692013#M1056407</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is how I load the data from the database:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table_suivi_devis:&lt;/P&gt;&lt;P&gt;LOAD ENDV_REPRESENTANT as JD_CODE_REP, etc...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;than I load it for the mapping and again for the applymap&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Oct 2014 14:31:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Lookup-and-concat/m-p/692013#M1056407</guid>
      <dc:creator />
      <dc:date>2014-10-09T14:31:25Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup and concat</title>
      <link>https://community.qlik.com/t5/QlikView/Lookup-and-concat/m-p/692014#M1056408</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If in the last LOAD you want to replace the original JD_CODE_REP with the new one, you must replace the * symbol in the last LOAD with a full field list from the original table Table_suivi_devis MINUS the original JD_CODE_REP column.&lt;/P&gt;&lt;P&gt;Otherwise you will be creating two columns with an identical name, which is not allowed in most query languages.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Peter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Oct 2014 14:37:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Lookup-and-concat/m-p/692014#M1056408</guid>
      <dc:creator>Peter_Cammaert</dc:creator>
      <dc:date>2014-10-09T14:37:13Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Lookup and concat</title>
      <link>https://community.qlik.com/t5/QlikView/Lookup-and-concat/m-p/692015#M1056409</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I tried by adding all the fields, but it still tells me there is an error &lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I will join the script (first tab) if you find it easier &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Oct 2014 14:50:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Lookup-and-concat/m-p/692015#M1056409</guid>
      <dc:creator />
      <dc:date>2014-10-09T14:50:27Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup and concat</title>
      <link>https://community.qlik.com/t5/QlikView/Lookup-and-concat/m-p/692016#M1056411</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry, forget my last remark, I was missing the point. Back to my first response: if you use a GROUP BY clause, you can only LOAD fields without aggregation function if those same fields appear in the GROUP BY clause. All others can only be listed as parameter of an aggregation function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now with respect to your code, I suggest you replace the entire code block for table &lt;SPAN style="text-decoration: underline;"&gt;Data&lt;/SPAN&gt;: (including its label, we won't need it anymore) by this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DROP Field JD_CODE_REP;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LEFT JOIN (Table_suivi_devis)&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;LOAD JD_NEVIS,&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ApplyMap('MapCodeRep', JD_NDEVIS &amp;amp; 'v' &amp;amp; max(JD_NVARIANT)) As JD_CODE_REP&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;RESIDENT Table_suivi_devis&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;GROUP BY JD_NDEVIS;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Oct 2014 15:13:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Lookup-and-concat/m-p/692016#M1056411</guid>
      <dc:creator>Peter_Cammaert</dc:creator>
      <dc:date>2014-10-09T15:13:55Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Lookup and concat</title>
      <link>https://community.qlik.com/t5/QlikView/Lookup-and-concat/m-p/692017#M1056412</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Works perfectly &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/grin.png" /&gt; Thank you very much!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Oct 2014 07:33:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Lookup-and-concat/m-p/692017#M1056412</guid>
      <dc:creator />
      <dc:date>2014-10-10T07:33:34Z</dc:date>
    </item>
  </channel>
</rss>

