<?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 Scripting problem... in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Scripting-problem/m-p/278665#M103742</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have the following piece of script (I have simplified it, the first 2 sheets work perfectly fine):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;Sheet1:&lt;/P&gt;&lt;P&gt;Table1&lt;BR /&gt;%Customer_Key,&lt;/P&gt;&lt;P&gt;CustomerNumberKNA1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;EM&gt;(consisting following data: 10, 20, 50, 90, 100, 150 and 200)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;from ***.qvd&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sheet 2:&lt;/P&gt;&lt;P&gt;Table2:&lt;/P&gt;&lt;P&gt;%BUS_key,&lt;BR /&gt;[BUS - Code &amp;amp; Name]&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;EM&gt;(consisting following data: 2A, 2B, 2C and 2D)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;from ***.qvd&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Next, I want to make the following calculation:&lt;/P&gt;&lt;P&gt;if([BUS - Code &amp;amp; Name]=2A,TT,if([BUS - Code &amp;amp; Name]=2B,if(CustomerNumberKNA1&amp;gt;100,TT,None),None))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Meaning that &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;* Every 2A = 'TT'&lt;/P&gt;&lt;P&gt;* If it is 2B and the CustomerNr &amp;gt; 100 it is 'TT' as well&lt;/P&gt;&lt;P&gt;* If it is not 2A or 2B &lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG&gt;or&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;STRONG&gt; &lt;/STRONG&gt;if it is 2B but the CustomerNr &amp;lt; 100 it is 'None'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any idea how I can make that calculation? I can not simply concatenate the two tables, because I am using the two '%keys' later on in the script in one and the same table (so if I concatenate, it will connect to that table two times, because of the two keys).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hopefully I have explained it so that you guys understand it, thanks in advance!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 21 Sep 2011 13:50:23 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2011-09-21T13:50:23Z</dc:date>
    <item>
      <title>Scripting problem...</title>
      <link>https://community.qlik.com/t5/QlikView/Scripting-problem/m-p/278665#M103742</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have the following piece of script (I have simplified it, the first 2 sheets work perfectly fine):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;Sheet1:&lt;/P&gt;&lt;P&gt;Table1&lt;BR /&gt;%Customer_Key,&lt;/P&gt;&lt;P&gt;CustomerNumberKNA1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;EM&gt;(consisting following data: 10, 20, 50, 90, 100, 150 and 200)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;from ***.qvd&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sheet 2:&lt;/P&gt;&lt;P&gt;Table2:&lt;/P&gt;&lt;P&gt;%BUS_key,&lt;BR /&gt;[BUS - Code &amp;amp; Name]&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;EM&gt;(consisting following data: 2A, 2B, 2C and 2D)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;from ***.qvd&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Next, I want to make the following calculation:&lt;/P&gt;&lt;P&gt;if([BUS - Code &amp;amp; Name]=2A,TT,if([BUS - Code &amp;amp; Name]=2B,if(CustomerNumberKNA1&amp;gt;100,TT,None),None))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Meaning that &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;* Every 2A = 'TT'&lt;/P&gt;&lt;P&gt;* If it is 2B and the CustomerNr &amp;gt; 100 it is 'TT' as well&lt;/P&gt;&lt;P&gt;* If it is not 2A or 2B &lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG&gt;or&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;STRONG&gt; &lt;/STRONG&gt;if it is 2B but the CustomerNr &amp;lt; 100 it is 'None'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any idea how I can make that calculation? I can not simply concatenate the two tables, because I am using the two '%keys' later on in the script in one and the same table (so if I concatenate, it will connect to that table two times, because of the two keys).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hopefully I have explained it so that you guys understand it, thanks in advance!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Sep 2011 13:50:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Scripting-problem/m-p/278665#M103742</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-09-21T13:50:23Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting problem...</title>
      <link>https://community.qlik.com/t5/QlikView/Scripting-problem/m-p/278666#M103743</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't see the link between Table1 and Table2, but I'll assume there is one. You have several alternatives. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Use the lookup() function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. Join CustomerNumberKNA1 Table2, compute the new field and then drop CustomerNumberKNA1 from Table2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. Use ApplyMap(). In this example I'll assume %BUS_key exists in Table1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;custmap:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;MAPPING LOAD %BUS_key, CustomerNumberKNA1 RESIDENT Table1;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;In the table2 load:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;if([BUS - Code &amp;amp; Name]=2A,TT&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;,if([BUS - Code &amp;amp; Name]=2B,if(ApplyMap('custmap',%BUS_key) &amp;gt;100,TT,None),None))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;-Rob&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Sep 2011 14:17:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Scripting-problem/m-p/278666#M103743</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2011-09-21T14:17:51Z</dc:date>
    </item>
    <item>
      <title>Scripting problem...</title>
      <link>https://community.qlik.com/t5/QlikView/Scripting-problem/m-p/278667#M103744</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; check for sheet1 and sheet 2 table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if two field have same type of data then make their name same so that link will create&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and then apply this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if([BUS - Code &amp;amp; Name]=2A,'TT',if([BUS - Code &amp;amp; Name]=2B,if(CustomerNumberKNA1&amp;gt;100,'TT',None),None))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Sep 2011 14:22:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Scripting-problem/m-p/278667#M103744</guid>
      <dc:creator>SunilChauhan</dc:creator>
      <dc:date>2011-09-21T14:22:35Z</dc:date>
    </item>
    <item>
      <title>Scripting problem...</title>
      <link>https://community.qlik.com/t5/QlikView/Scripting-problem/m-p/278668#M103745</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello &lt;STRONG&gt;Rob,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;there is no &lt;SPAN style="text-decoration: underline;"&gt;direct&lt;/SPAN&gt; connection between table 1 and table 2.&lt;/P&gt;&lt;P&gt;The two tables consist data coming from SAP, concerning Customer Data (Table 1) and Product Data (Table 2).&lt;/P&gt;&lt;P&gt;Eventually (later on in the script) the both keys are named when loading the CO-PA table from SAP (the main table, consisting of all accounting data). At that moment, via the keys, the two tables are connected:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table 1 or Customer Data (a.o. %Customer_Key)&lt;/P&gt;&lt;P&gt;Table 2 or Product Data (a.o. %BUS_key)&lt;/P&gt;&lt;P&gt;CO-PA (a.o. %Customer_Key &lt;STRONG&gt;and &lt;/STRONG&gt;%BUS_key)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope the situation is more clear now, I can't get one of the 3 options named working at the moment.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And &lt;STRONG&gt;Sunil&lt;/STRONG&gt;: I can't have a field named the same in the both tables. This way, when the link is created via the CO-PA table later on, I get a loop:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table 1 or Customer Data (a.o. %Customer_Key &amp;amp; Field A)&lt;/P&gt;&lt;P&gt;Table 2 or Product Data (a.o. %BUS_key &amp;amp; Field A)&lt;/P&gt;&lt;P&gt;CO-PA (a.o. %Customer_Key &lt;STRONG&gt;and &lt;/STRONG&gt;%BUS_key)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This way, the two tables connect &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- indirectly via the keys in the CO-PA table&lt;/P&gt;&lt;P&gt;- directly via the 'Field A'&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Sep 2011 14:38:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Scripting-problem/m-p/278668#M103745</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-09-21T14:38:03Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting problem...</title>
      <link>https://community.qlik.com/t5/QlikView/Scripting-problem/m-p/278669#M103746</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So can you use option 2 or 3 using field CO-PA as the link?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Sep 2011 15:28:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Scripting-problem/m-p/278669#M103746</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2011-09-21T15:28:12Z</dc:date>
    </item>
    <item>
      <title>Scripting problem...</title>
      <link>https://community.qlik.com/t5/QlikView/Scripting-problem/m-p/278670#M103747</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Rob,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;whilst I was working out your point 3, the head of our ICT-department e-mailed me an old QV-script, in which the idea you mentioned was worked out already. Yesterday he said he couldn't find it, but he eventually did.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So the idea you mentioned was correct indeed, thanks for the help on the matter!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Sep 2011 09:32:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Scripting-problem/m-p/278670#M103747</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-09-22T09:32:04Z</dc:date>
    </item>
  </channel>
</rss>

