<?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: Create a Condition using two fields which are in separate tables in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Create-a-Condition-using-two-fields-which-are-in-separate-tables/m-p/760945#M471304</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Jonathan.&amp;nbsp; Will try it out on my actual Qlikview Model that i work with and let you know.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;kind regards&lt;/P&gt;&lt;P&gt;Nayan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 20 Mar 2015 14:57:27 GMT</pubDate>
    <dc:creator />
    <dc:date>2015-03-20T14:57:27Z</dc:date>
    <item>
      <title>Create a Condition using two fields which are in separate tables</title>
      <link>https://community.qlik.com/t5/QlikView/Create-a-Condition-using-two-fields-which-are-in-separate-tables/m-p/760943#M471302</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 want to create a condition using two tabels which are in separate tables.&amp;nbsp; Let me elaborate.&amp;nbsp; I have the following 3 tabels:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. &lt;STRONG&gt;Sales Data&lt;/STRONG&gt;:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Containing Customer, Item Code and Sales Qty&lt;/P&gt;&lt;P&gt;2. &lt;STRONG&gt;Customer Data:&lt;/STRONG&gt;&amp;nbsp; Customer and Customer Group&lt;/P&gt;&lt;P&gt;3.&lt;STRONG&gt;Item Data:&lt;/STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Item Code and Item Category&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See attached Source Data and Qlikview Model.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to create a script that If the Customer Group is "Game" and the Item Category is "Sanware" , then this should be "Renewable" otherwise its "Non-Renewable" and this new field should be called Division.&amp;nbsp; This&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Because Item Category and Customer Group are in 2 seperate tables, how do I combine these 2 fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;kind regards&lt;/P&gt;&lt;P&gt;Nayan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Mar 2015 14:36:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Create-a-Condition-using-two-fields-which-are-in-separate-tables/m-p/760943#M471302</guid>
      <dc:creator />
      <dc:date>2015-03-20T14:36:28Z</dc:date>
    </item>
    <item>
      <title>Re: Create a Condition using two fields which are in separate tables</title>
      <link>https://community.qlik.com/t5/QlikView/Create-a-Condition-using-two-fields-which-are-in-separate-tables/m-p/760944#M471303</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;You will have to join the tables to apply the condition, like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Data:&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;LOAD Customer, [Item Code], [Sales Qty]&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;FROM SalesData;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Left Join (Data)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;LOAD Customer, [Customer Group]&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;FROM CustomerData;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Left Join (Data)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;LOAD [Item Code], [Item Category]&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;FROM ItemData;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Final:&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; If([Customer Group] = 'Game' And [Item Category] = 'Sanware', 'Renewable', 'Non-Renewable') As Division&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Resident Data;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;DROP Table Data;&lt;/EM&gt;&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>Fri, 20 Mar 2015 14:44:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Create-a-Condition-using-two-fields-which-are-in-separate-tables/m-p/760944#M471303</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2015-03-20T14:44:03Z</dc:date>
    </item>
    <item>
      <title>Re: Create a Condition using two fields which are in separate tables</title>
      <link>https://community.qlik.com/t5/QlikView/Create-a-Condition-using-two-fields-which-are-in-separate-tables/m-p/760945#M471304</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Jonathan.&amp;nbsp; Will try it out on my actual Qlikview Model that i work with and let you know.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;kind regards&lt;/P&gt;&lt;P&gt;Nayan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Mar 2015 14:57:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Create-a-Condition-using-two-fields-which-are-in-separate-tables/m-p/760945#M471304</guid>
      <dc:creator />
      <dc:date>2015-03-20T14:57:27Z</dc:date>
    </item>
    <item>
      <title>Re: Create a Condition using two fields which are in separate tables</title>
      <link>https://community.qlik.com/t5/QlikView/Create-a-Condition-using-two-fields-which-are-in-separate-tables/m-p/760946#M471305</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jonathan&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your scripting works.  Thank you.  I have another situation&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In my original data I have independent branches with the same data structure.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Attached herewith is the amended model which are link to 2 data sources.  The original I rename Joburg and the other is Durban.  Please note that there is an extra field called ‘Data Source”.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I reloaded the model, ITEM Category, Customer Group and “Renewable” under Division does not appear for Durban.  Please can you tell me where I am going wrong in my scripting.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &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;Nayan&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorry for the delayed reply, I had to leave for home and it was the weekend .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Mar 2015 14:01:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Create-a-Condition-using-two-fields-which-are-in-separate-tables/m-p/760946#M471305</guid>
      <dc:creator />
      <dc:date>2015-03-23T14:01:09Z</dc:date>
    </item>
  </channel>
</rss>

