<?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 Trouble with lookup and concatenation in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Trouble-with-lookup-and-concatenation/m-p/525251#M693189</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tables SlsOrder and SlsLine (linked via OrderNum) and I am trying to change the Price-field for each item in SlsLine; this is done by dividing it by field ExcRate (located in SlsOrder table, if currency is EUR it is 1). I do not want to join these two tables, just recalculate the Price-field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Lookup-function seems like a good choice (both SlsOrder and SlsLine have already been loaded before the lines of code shown) for getting the ExcRate for the calculation. What I am having trouble with is extra rows forming in the SlsLine qvd; they contain only the OrderNum (if order nums for the 10 first records are 1 to 10 then these are the numbers shown in the extra rows).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro _jivemacro_uid_13772572243339246 jive_macro_code" jivemacro_uid="_13772572243339246"&gt;
&lt;P&gt;Temp_SlsLine:&lt;/P&gt;
&lt;P&gt;Concatenate LOAD&lt;/P&gt;
&lt;P&gt;OrderNum,&lt;/P&gt;
&lt;P&gt;(Price / (lookup('ExcRate','OrderNum',OrderNum,'SlsOrder'))) as Price&lt;/P&gt;
&lt;P&gt;Resident SlsLine;&lt;/P&gt;

&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Am I missing something here? Is lookup to a different table inside resident load even possible?&lt;BR /&gt;Any help appreciated!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Juho&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;UPDATE: I modified the script a bit and noticed that the lookup is not working - no value for ExcRate is saved into the qvd.&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Any ideas why so?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Juho Heino&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 23 Aug 2013 10:34:36 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2013-08-23T10:34:36Z</dc:date>
    <item>
      <title>Trouble with lookup and concatenation</title>
      <link>https://community.qlik.com/t5/QlikView/Trouble-with-lookup-and-concatenation/m-p/525251#M693189</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tables SlsOrder and SlsLine (linked via OrderNum) and I am trying to change the Price-field for each item in SlsLine; this is done by dividing it by field ExcRate (located in SlsOrder table, if currency is EUR it is 1). I do not want to join these two tables, just recalculate the Price-field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Lookup-function seems like a good choice (both SlsOrder and SlsLine have already been loaded before the lines of code shown) for getting the ExcRate for the calculation. What I am having trouble with is extra rows forming in the SlsLine qvd; they contain only the OrderNum (if order nums for the 10 first records are 1 to 10 then these are the numbers shown in the extra rows).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro _jivemacro_uid_13772572243339246 jive_macro_code" jivemacro_uid="_13772572243339246"&gt;
&lt;P&gt;Temp_SlsLine:&lt;/P&gt;
&lt;P&gt;Concatenate LOAD&lt;/P&gt;
&lt;P&gt;OrderNum,&lt;/P&gt;
&lt;P&gt;(Price / (lookup('ExcRate','OrderNum',OrderNum,'SlsOrder'))) as Price&lt;/P&gt;
&lt;P&gt;Resident SlsLine;&lt;/P&gt;

&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Am I missing something here? Is lookup to a different table inside resident load even possible?&lt;BR /&gt;Any help appreciated!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Juho&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;UPDATE: I modified the script a bit and noticed that the lookup is not working - no value for ExcRate is saved into the qvd.&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Any ideas why so?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Juho Heino&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Aug 2013 10:34:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Trouble-with-lookup-and-concatenation/m-p/525251#M693189</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-08-23T10:34:36Z</dc:date>
    </item>
    <item>
      <title>Re: Trouble with lookup and concatenation</title>
      <link>https://community.qlik.com/t5/QlikView/Trouble-with-lookup-and-concatenation/m-p/525252#M693190</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Juho,&lt;/P&gt;&lt;P&gt;ExcRate or Price? If no value is there for ExcRate then lookup would return null, right? If you meant Price then, that's a question. By any chance, is it possible that you share a sample app?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Aug 2013 11:37:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Trouble-with-lookup-and-concatenation/m-p/525252#M693190</guid>
      <dc:creator>tresB</dc:creator>
      <dc:date>2013-08-23T11:37:23Z</dc:date>
    </item>
    <item>
      <title>Re: Trouble with lookup and concatenation</title>
      <link>https://community.qlik.com/t5/QlikView/Trouble-with-lookup-and-concatenation/m-p/525253#M693191</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;lookup to another table is not possible. i would do a mapping load of the field "ExcRate" into the table SLSline.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Aug 2013 11:44:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Trouble-with-lookup-and-concatenation/m-p/525253#M693191</guid>
      <dc:creator>michael_maeuser</dc:creator>
      <dc:date>2013-08-23T11:44:07Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Trouble with lookup and concatenation</title>
      <link>https://community.qlik.com/t5/QlikView/Trouble-with-lookup-and-concatenation/m-p/525254#M693192</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;ExcRate, not Price; I wrote the update unclearly but I basically tested only&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13772582828077901" jivemacro_uid="_13772582828077901"&gt;
&lt;P&gt;(lookup('ExcRate','OrderNum',OrderNum,'SlsOrder')) as ExcRate&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;in the backend (load from source database) without doing the calculation Price/ExcRate as Price.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I do not think that sharing a sample app would help, because I have the following line in my front end and it works (loads data from SlsLine.qvd);&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13772582656108561" jivemacro_uid="_13772582656108561" modifiedtitle="true"&gt;
&lt;P&gt;(Price / (lookup('ExcRate','OrderNum',OrderNum,'SlsOrder'))) as NewPrice,&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I guess it has something to do with load orders and such, but SlsOrder has been loaded prior to this line.&lt;/P&gt;&lt;P&gt;Please see&amp;nbsp; the attached qvs!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Aug 2013 11:54:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Trouble-with-lookup-and-concatenation/m-p/525254#M693192</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-08-23T11:54:52Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Trouble with lookup and concatenation</title>
      <link>https://community.qlik.com/t5/QlikView/Trouble-with-lookup-and-concatenation/m-p/525255#M693193</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Lookup to another table is possible when the source is qvd - the same line I try to insert to my backend works in my frontend where data is loaded from qvd...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If lookup does not work when loading from database then I will have to try your approach with mapping load.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Aug 2013 11:57:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Trouble-with-lookup-and-concatenation/m-p/525255#M693193</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-08-23T11:57:38Z</dc:date>
    </item>
    <item>
      <title>Re: Trouble with lookup and concatenation</title>
      <link>https://community.qlik.com/t5/QlikView/Trouble-with-lookup-and-concatenation/m-p/525256#M693194</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You are right, load order matters here, specially when you use join and such complex operation the order of load is not well defined, and lookup returned value depends on the order when you have multiple values in the target field against a looked up value.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Aug 2013 12:01:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Trouble-with-lookup-and-concatenation/m-p/525256#M693194</guid>
      <dc:creator>tresB</dc:creator>
      <dc:date>2013-08-23T12:01:43Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Trouble with lookup and concatenation</title>
      <link>https://community.qlik.com/t5/QlikView/Trouble-with-lookup-and-concatenation/m-p/525257#M693195</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So mapping load is the method of choice instead of lookup, as Michael suggested?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Aug 2013 12:08:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Trouble-with-lookup-and-concatenation/m-p/525257#M693195</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-08-23T12:08:10Z</dc:date>
    </item>
    <item>
      <title>Re: Trouble with lookup and concatenation</title>
      <link>https://community.qlik.com/t5/QlikView/Trouble-with-lookup-and-concatenation/m-p/525258#M693196</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, if not join, go ahead with mapping load.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Aug 2013 12:18:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Trouble-with-lookup-and-concatenation/m-p/525258#M693196</guid>
      <dc:creator>tresB</dc:creator>
      <dc:date>2013-08-23T12:18:51Z</dc:date>
    </item>
    <item>
      <title>Re: Trouble with lookup and concatenation</title>
      <link>https://community.qlik.com/t5/QlikView/Trouble-with-lookup-and-concatenation/m-p/525259#M693197</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you both tresesco and Michael, I solved the issue by using Mapping Load and piped load (multiple load statements 'on top of each other'). My solution can be seen from the attached qvs should someone else face the same problem!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Juho&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Aug 2013 07:22:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Trouble-with-lookup-and-concatenation/m-p/525259#M693197</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-08-26T07:22:24Z</dc:date>
    </item>
  </channel>
</rss>

