<?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: Creating a new field from multiple tables in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Creating-a-new-field-from-multiple-tables/m-p/1561630#M40901</link>
    <description>&lt;P&gt;Need some parenthesis to dictate order of tests...&lt;/P&gt;&lt;PRE&gt;If(([Plant] = 'xxxx' or [Plant] = 'yyyy' or [Plant] = 'zzzz') and ([Customer] = 'aaaaa' or [Customer] = 'bbbbb'), 'Region B'.&lt;/PRE&gt;</description>
    <pubDate>Tue, 26 Mar 2019 22:28:23 GMT</pubDate>
    <dc:creator>dwforest</dc:creator>
    <dc:date>2019-03-26T22:28:23Z</dc:date>
    <item>
      <title>Creating a new field from multiple tables</title>
      <link>https://community.qlik.com/t5/App-Development/Creating-a-new-field-from-multiple-tables/m-p/1561614#M40897</link>
      <description>&lt;P&gt;Hi all;&lt;/P&gt;&lt;P&gt;I have created a new app and within this app I am creating new fields.&amp;nbsp; I have been doing this through a script, something new for me.&amp;nbsp; Within the script I am creating new fields based on the data within the excel spreadsheet.&amp;nbsp; I have been largely successful in this up until this problem.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In column B of my spreadsheet I have Customer and in column A of my spreadsheet I have Plant.&amp;nbsp; What I am doing is creating a new field called "region" and multiple Plants can be within a region.&amp;nbsp; That was easy enough to create the field for (if/then statement joined with or).&amp;nbsp; My problem comes when I have to create a region that is both plant and customer numbers.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For a normal Region the script I have created is this:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If([Plant] = 'xxxx' or [Plant] = 'yyyy' or [Plant] = 'zzzz', 'Region A'.&amp;nbsp; This works as planned returning Region A.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Where I cannot get the region to work is when I am combining Plant and Customer.&amp;nbsp; Here is how I have written the script:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If([Plant] = 'xxxx' or [Plant] = 'yyyy' or [Plant] = 'zzzz' and [Customer] = 'aaaaa' or [Customer] = 'bbbbb', 'Region B'.&amp;nbsp; This does not provide any data, or even the name of the region, when I load the data.&amp;nbsp; I am trying just to pull the data for those customers within these plants.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help in what I am doing wrong would be appreciated.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Mar 2019 21:20:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Creating-a-new-field-from-multiple-tables/m-p/1561614#M40897</guid>
      <dc:creator>wschefter</dc:creator>
      <dc:date>2019-03-26T21:20:10Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a new field from multiple tables</title>
      <link>https://community.qlik.com/t5/App-Development/Creating-a-new-field-from-multiple-tables/m-p/1561630#M40901</link>
      <description>&lt;P&gt;Need some parenthesis to dictate order of tests...&lt;/P&gt;&lt;PRE&gt;If(([Plant] = 'xxxx' or [Plant] = 'yyyy' or [Plant] = 'zzzz') and ([Customer] = 'aaaaa' or [Customer] = 'bbbbb'), 'Region B'.&lt;/PRE&gt;</description>
      <pubDate>Tue, 26 Mar 2019 22:28:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Creating-a-new-field-from-multiple-tables/m-p/1561630#M40901</guid>
      <dc:creator>dwforest</dc:creator>
      <dc:date>2019-03-26T22:28:23Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a new field from multiple tables</title>
      <link>https://community.qlik.com/t5/App-Development/Creating-a-new-field-from-multiple-tables/m-p/1561688#M40909</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;You should build separate table for region and form association with other data. that will be more convenient and you don't have to write multiple if conditions. Separate table can be maintained using INLINE Load or Excel.&lt;/P&gt;&lt;P&gt;For Example:&lt;/P&gt;&lt;P&gt;Load * Inline&lt;/P&gt;&lt;P&gt;[&lt;/P&gt;&lt;P&gt;Plant, Plant_Region&lt;/P&gt;&lt;P&gt;xxxx,RegionA&lt;/P&gt;&lt;P&gt;yyyy,RegionA&lt;/P&gt;&lt;P&gt;zzzz,RegionA&lt;/P&gt;&lt;P&gt;cdfg,RegionB&lt;/P&gt;&lt;P&gt;dfeg,RegionB&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Load * Inline&lt;/P&gt;&lt;P&gt;[&lt;/P&gt;&lt;P&gt;Customer, Cust_Region&lt;/P&gt;&lt;P&gt;Cust01,RegionA&lt;/P&gt;&lt;P&gt;Cust02,RegionA&lt;/P&gt;&lt;P&gt;Cust03,RegionA&lt;/P&gt;&lt;P&gt;Cust04,RegionB&lt;/P&gt;&lt;P&gt;Cust05,RegionB&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please try and let me know.&lt;/P&gt;&lt;P&gt;-amrinder&lt;/P&gt;</description>
      <pubDate>Wed, 27 Mar 2019 06:05:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Creating-a-new-field-from-multiple-tables/m-p/1561688#M40909</guid>
      <dc:creator>amrinder</dc:creator>
      <dc:date>2019-03-27T06:05:05Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a new field from multiple tables</title>
      <link>https://community.qlik.com/t5/App-Development/Creating-a-new-field-from-multiple-tables/m-p/1563087#M41024</link>
      <description>&lt;P&gt;Hi guys.&amp;nbsp; It has been a busy week and I have not been able to get back to this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the replies.&amp;nbsp; Unfortunately the brackets did not work.&amp;nbsp; As well I am not sure how exactly to write the inline.&amp;nbsp; When I attempt it as above it won't load.&amp;nbsp; I know I am doing something wrong, just no idea what.&amp;nbsp; I am pretty confused.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Overall I am looking to not have to do a v-lookup in excel and then load the data.&lt;/P&gt;</description>
      <pubDate>Fri, 29 Mar 2019 22:28:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Creating-a-new-field-from-multiple-tables/m-p/1563087#M41024</guid>
      <dc:creator>wschefter</dc:creator>
      <dc:date>2019-03-29T22:28:30Z</dc:date>
    </item>
  </channel>
</rss>

