<?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 How to create a new field using fields from different tables? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/How-to-create-a-new-field-using-fields-from-different-tables/m-p/253880#M711385</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Correct.&amp;nbsp; Individual sales are more fundamental that products.&amp;nbsp; Product should here be considered a dimension of sales.&amp;nbsp; Costs are associated with the sales, not with the product.&amp;nbsp; So costs go on the sales table.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 05 Aug 2011 20:41:02 GMT</pubDate>
    <dc:creator>johnw</dc:creator>
    <dc:date>2011-08-05T20:41:02Z</dc:date>
    <item>
      <title>How to create a new field using fields from different tables?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-create-a-new-field-using-fields-from-different-tables/m-p/253876#M711381</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Good afternoon respected members,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am new to qlikview and BI in general. So any help would be appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to create a new field called '&lt;STRONG&gt;Costs&lt;/STRONG&gt;'. In order to create this field i would need to use two different fields from two different tables. Costs = Product Standard Cost * Order Quantity. The fields involved in this metric are &lt;STRONG&gt;OrderQty &lt;/STRONG&gt;and &lt;STRONG&gt;StandardCost. OrderQty &lt;/STRONG&gt;can be found under the &lt;STRONG&gt;Sales &lt;/STRONG&gt;tab in the second LOAD script and &lt;STRONG&gt;StandardCost &lt;/STRONG&gt;can be found under the &lt;STRONG&gt;Product &lt;/STRONG&gt;tab in the Product table. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am attaching a copy of the document. Looking forward for the communities help in this regard.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ammad&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Aug 2011 19:54:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-create-a-new-field-using-fields-from-different-tables/m-p/253876#M711381</guid>
      <dc:creator />
      <dc:date>2011-08-05T19:54:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a new field using fields from different tables?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-create-a-new-field-using-fields-from-different-tables/m-p/253877#M711382</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In a chart, you'd just use StandardCost * OrderQty.&amp;nbsp; It doesn't matter that they're on different tables as long as the data model has the correct connections between the tables, and they look good to me on the surface.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Did you want to calculate Costs in the script instead of in charts?&amp;nbsp; There are several ways.&amp;nbsp; What I might do is load in a mapping table of the standard costs by product:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;[Product Costs]: MAPPING LOAD ProductID, StandardCost RESIDENT Product;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And then when joining the sales order detail onto the header, add another field:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;OrderQty * applymap('Product Costs',ProductID) as Costs,&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Aug 2011 20:23:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-create-a-new-field-using-fields-from-different-tables/m-p/253877#M711382</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2011-08-05T20:23:15Z</dc:date>
    </item>
    <item>
      <title>How to create a new field using fields from different tables?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-create-a-new-field-using-fields-from-different-tables/m-p/253878#M711383</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So you have OrderQty from SalesHeader Table and StandardCost from Product Table.&lt;/P&gt;&lt;P&gt;So, here is a question for you, in which table do you want this new field "Costs". Do you want it in Sales Header Table or Product table. You would need to mention it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Say, you want it in Product table,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then write in your script the following lines&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Temp1:&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;ProductID as ProdId,&lt;/P&gt;&lt;P&gt;StandardCost as StdCost&lt;/P&gt;&lt;P&gt;resident Product;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Outer Join(Temp1)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;ProductID as ProdId,&lt;/P&gt;&lt;P&gt;OrderQty as OrderQuanity&lt;/P&gt;&lt;P&gt;resident SalesHeader_New;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;left Join(Product) &lt;/P&gt;&lt;P&gt;Load &lt;/P&gt;&lt;P&gt;ProdId as ProductID,&lt;/P&gt;&lt;P&gt;OrderQuanity * StdCost as Costs&lt;/P&gt;&lt;P&gt;resident Temp1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;drop table Temp1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps,&lt;/P&gt;&lt;P&gt;do letme know.&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Bikash Debnath&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Aug 2011 20:29:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-create-a-new-field-using-fields-from-different-tables/m-p/253878#M711383</guid>
      <dc:creator />
      <dc:date>2011-08-05T20:29:31Z</dc:date>
    </item>
    <item>
      <title>How to create a new field using fields from different tables?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-create-a-new-field-using-fields-from-different-tables/m-p/253879#M711384</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i read that its best to have one fact table,&amp;nbsp; resulting in a star schema. Based on this, i would like my sales table to be the fact table and store all facts in there. I beleive Costs would be a fact, correct?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Aug 2011 20:36:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-create-a-new-field-using-fields-from-different-tables/m-p/253879#M711384</guid>
      <dc:creator />
      <dc:date>2011-08-05T20:36:25Z</dc:date>
    </item>
    <item>
      <title>How to create a new field using fields from different tables?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-create-a-new-field-using-fields-from-different-tables/m-p/253880#M711385</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Correct.&amp;nbsp; Individual sales are more fundamental that products.&amp;nbsp; Product should here be considered a dimension of sales.&amp;nbsp; Costs are associated with the sales, not with the product.&amp;nbsp; So costs go on the sales table.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Aug 2011 20:41:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-create-a-new-field-using-fields-from-different-tables/m-p/253880#M711385</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2011-08-05T20:41:02Z</dc:date>
    </item>
    <item>
      <title>How to create a new field using fields from different tables?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-create-a-new-field-using-fields-from-different-tables/m-p/253881#M711386</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Thank you for helping me out.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Aug 2011 17:14:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-create-a-new-field-using-fields-from-different-tables/m-p/253881#M711386</guid>
      <dc:creator />
      <dc:date>2011-08-08T17:14:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a new field using fields from different tables?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-create-a-new-field-using-fields-from-different-tables/m-p/253882#M711387</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Excellent Explanation John &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, 08 Jan 2015 11:35:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-create-a-new-field-using-fields-from-different-tables/m-p/253882#M711387</guid>
      <dc:creator />
      <dc:date>2015-01-08T11:35:18Z</dc:date>
    </item>
  </channel>
</rss>

